API documentation

Listing survey responses

Retrieve all survey responses for your account.

Results are returned in creation order, with the oldest item first, and are paginated. See the parameters section below for more information regarding pagination.

Endpoint

GET /v1/survey_responses.json

Example request

curl https://api.delighted.com/v1/survey_responses.json \
  -u YOUR_DELIGHTED_API_KEY:
Delighted::SurveyResponse.all # returns an Enumerable
delighted.surveyResponse.all(); // returns a promise
delighted.SurveyResponse.all()
\Delighted\SurveyResponse::all();

Example response

[
  {
    "id": "1",
    "person": "10",
    "score": 5,
    "comment": null,
    "permalink": "https://delighted.com/r/2jo3B7Gak9q37XkuHrGLGAbCdevemcx8",
    "created_at": 1495622384,
    "updated_at": null,
    "person_properties": { "purchase_experience": "Retail Store", "country": "USA" },
    "notes": [],
    "tags": []
  },
  {
    "id": "2",
    "person": "11",
    "score": 10,
    "comment": "I loved this app!",
    "permalink": 'https://delighted.com/r/5pFDpmlyC8GUc5oxU6USto5VonSKAqOa',
    "created_at": 1495624184,
    "updated_at": 1495624784,
    "person_properties": null,
    "notes": [
      { "id": "1", "text": "Note 1", "user_email": "foo@bar.com", "created_at": 1495624184 },
      { "id": "2", "text": "Note 2", "user_email": "gyp@sum.com", "created_at": 1495625084 }
    ],
    "tags": []
  },
  ...
]

Parameters

Name Type Description
per_page Integer Number of results to return per page. The default is 20. The maximum is 100.
page Integer The page number to return. The default is 1.
since Integer An optional Unix timestamp to restrict responses to those created on or after this time. Formatting example (for 1 hour ago): 1495622384.
until Integer An optional Unix timestamp to restrict responses to those created on or before this time. Formatting example (for the current time): 1495625984.
updated_since Integer An optional Unix timestamp to restrict responses to those updated on or after this time. Formatting example (for 1 hour ago): 1495622384.
updated_until Integer An optional Unix timestamp to restrict responses to those updated on or before this time. Formatting example (for the current time): 1495625984.
trend String An optional ID of a trend to restrict responses to that trend. To obtain the ID for a trend, visit the trends page. For example, if the URL for the desired trend ends with /trends/1234 the ID of that trend is 1234.
person_id String An optional ID to restrict responses to a specific person.
person_email String An optional email to restrict responses to a specific person.
order String

An optional sort order for the responses based on creation time. The default is asc, which will return responses in chronological order by (oldest first). To get responses in reverse chronological order (newest first), specify desc.

You may also sort responses based on the time they were last updated. To get responses sorted in this way, specify asc:updated_at for chronological order or desc:updated_at for reverse chronological order.

expand Array An optional array specifying the objects you want expanded. To expand the person object, pass expand[]=person. To expand the notes objects, pass expand[]=notes. To expand the person and notes objects, pass expand[]=person&expand[]=notes. The default is expand[]=notes.