Get NPS response
GET
/nps/{id}/response
const url = 'https://app.surveyrock.com/api/v1/nps/example/response?respondentId=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://app.surveyrock.com/api/v1/nps/example/response?respondentId=example' \ --header 'Authorization: Bearer <token>'Get an existing NPS response for a respondent
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
NPS element ID
Query Parameters
Section titled “Query Parameters”respondentId
required
string
Respondent ID
Responses
Section titled “Responses”NPS response data or null if not found
Media typeapplication/json
object
success
boolean
data
object
value
integer
type
string
recommendationSubject
string
meta
Standard response metadata
object
timestamp
Response timestamp in ISO 8601 format
string format: date-time
version
API version
string
requestId
Unique request identifier
string
Example
{ "success": true, "data": { "type": "nps" }, "meta": { "version": "3.0" }}Bad request - missing respondentId
Media typeapplication/json
Standard error response format
object
success
boolean
error
object
code
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
string
message
Human-readable error message
string
suggestion
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
string
retryable
Whether retrying the identical request might succeed without any change on the caller’s end
boolean
details
Additional, code-specific error details
object
meta
Standard response metadata
object
timestamp
Response timestamp in ISO 8601 format
string format: date-time
version
API version
string
requestId
Unique request identifier
string
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}