Pulling out information via API

Previous section: Triggering surveys via API

In addition to triggering sending via API, you can also leverage our various endpoints to collect feedback, metrics, and additional details. In this section, we’ll cover submitting a GET request, our various endpoints for pulling out information, and several other key suggestions for maximizing your use of Delighted’s API for retrieving data.

Design your Request

Once you’re ready to get started with pulling out information via our API, here are a few key elements for designing your API request:

  • Request Method: GET
  • Hosthttps://api.delighted.com/
  • Endpoint: /v1/survey_responses.json (Listing responses)
  • Endpoint: /v1/metrics.json (Listing account metrics)
  • Endpoint: /v1/people.json (Listing people historically imported)
  • Language: Delighted offers support for Curl, Ruby, Node.js, Phyton, and PHP. You can view sample request formats via our API documentation

Breakdown of Key Parameters

Each endpoint will have slightly unique parameters that can be accepted per request. Below, we’ll touch on our three key endpoints for pulling out information, as well as a quick link to each endpoint’s respective documentation:

Endpoint (Listing Responses)

You can access the listing responses documentation here: https://delighted.com/docs/api/listing-survey-response. This endpoint will provide a list of all total responses for your account. A few key parameters to consider include:

  • per_page: This parameter will adjust the number of responses shown per page. Set to 20 by default.
  • since and until: Both of these parameters will limit the time window used to list your responses.
  • expand: This is a key parameter to consider for revealing more information regarding each response. If you’re interested in showing the respondent’s name, be sure to pass “expand[]=person” to expand the Person object.

Endpoint (Listing Metrics)

You can access the metrics documentation here: https://delighted.com/docs/api/getting-metrics. This endpoint will provide a list of all total responses for your account. A few key parameters to consider include:

  • since and until: Similar to the above survey response endpoint, since/until parameters will help restrict the time period considered for your metrics.
  • groups: Interested in finding out your response rates, open rates, and other key sending metrics? Pass the parameter of “groups[]=email” in your request to retrieve those metrics.
  • trend: Passing this parameter will generate your metrics for a specific trend. To find the value passed along with this parameter, simply copy the digits at the end of the trend’s URL string (ex. /trends/1234)

Endpoint (Listing People)

You can access the listing active people documentation here: https://delighted.com/docs/api/listing-active-people. This endpoint will provide a list of all total responses for your account. A few key parameters to consider include:

  • since and until: Similar to both endpoints above, since/until parameters will help restrict the time period considered for your metrics.

Additional Notes

  • UI: In addition to being available via API, you can always export data, via CSV, directly from your dashboard
  • Additional Metrics: In addition to the endpoints above, we also have a way to pull other key data from Delighted - ranging from a list of those who have unsubscribed, to all survey requests that bounced. For a full listing of endpoints, check out our full API docs

Ready to start testing? The next section will cover some best practices for testing and moving into production.

Next section: Testing and production

Still need help? Contact Us Contact Us