Create a survey response (i.e. a score and comment from a person).
POST /v1/survey_responses.json
curl https://api.delighted.com/v1/survey_responses.json \
-u YOUR_DELIGHTED_API_KEY: \
-H "Content-Type: application/json" \
-d '{ "person": 1, "score": 9 }'
Delighted::SurveyResponse.create(person: '1', score: 9)
delighted.surveyResponse.create({ person: '1', score: 9 });
delighted.SurveyResponse.create(person='1', score=9)
\Delighted\SurveyResponse::create(array('person' => '1', 'score' => 9));
{
"id": "2",
"person": "1",
"survey_type": "nps",
"score": 9,
"comment": null,
"permalink": "https://app.delighted.com/r/0DkeDVFJSBgvJ8UtdacQtudYcXBt3Ecl",
"created_at": 1732192125,
"updated_at": 1732192125,
"person_properties": null,
"notes": [],
"tags": [],
"additional_answers": []
}
Name | Type | Description |
---|---|---|
person |
String | The ID of the person responding. (required) |
person_properties |
Map/Dictionary |
Custom properties to associate with this response. You can add as many properties as you need. For each property you wish to add, pass a separate
For example, if you wanted to add a “Customer ID” and a “Location” to the response, you could pass 2 parameters, This parameter is optional. |
score |
Integer | Score of the response, from 0 to 10. (required) |
comment |
String | An optional comment that the person left when responding. |
created_at |
Integer |
An optional Unix timestamp of the time when the survey response was collected. If you do not pass this value, we will automatically set this value to the current time. Formatting example (for the current time): 1732192125 .
|