Interest Surveys
The interests selected by the user during the onboarding process can be changed, anytime, using the following endpoints.
Available Interest Surveys
GET /surveys/
Retrieve the available surveys for the user.
curl -X GET "https://api.sherpa.ai/v2/surveys" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
-H "accept: application/json" \
-H "content-type: application/x-www-form-urlencoded" \
-H "Accept-Language: en" \
[
{
"surveyId": 2513,
"title": "Interests"
},
...
]
Response
Code | Name |
---|---|
200 | OK |
401 | Unauthorized |
500 | Internal Server Error |
List of the available interest surveys for the user.
Field | Type | Description |
---|---|---|
surveyId | Integer | Survey ID |
title | String | Survey title |
Interest Survey Details
GET /surveys/{surveyId}
Retrieves the survey details with its ID and the list of items that can be selected.
curl -X GET "https://api.sherpa.ai/v2/surveys/2513" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
-H "accept: application/json" \
-H "content-type: application/x-www-form-urlencoded" \
-H "Accept-Language: en" \
{
"id": 2513,
"title": "Interests",
"items": [
{
"id": 2000,
"texto": "International",
"imagen": "https://s3-eu-west-1.amazonaws.com/sherpa-cdn/survey/interest/Gustos/square/2000.png",
"selected": false,
"weight": 0.0
},
...
]
}
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
survey_id | Query | ✓ | String | ID of the completed survey |
Response
Code | Name |
---|---|
200 | OK |
401 | Unauthorized |
404 | Not Found |
500 | Internal Server Error |
Field | Type | Description |
---|---|---|
survey_id | String | ID of the completed survey |
items | List | List of survey items and its response state |
Item
Field | Type | Description |
---|---|---|
id | String | ID of the item |
text | String | Related text |
image | String | URL of the related image |
selected | boolean | True if the user has selected it, false otherwise |
Update Interest Survey
POST /surveys/{surveyId}
Changes the state of the user's response for the current survey.
curl -X POST "https://api.sherpa.ai/v2/surveys/2513" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
-H "accept: application/json" \
-H "content-type: application/x-www-form-urlencoded" \
-H "Accept-Language: en"
-d '{"selected_items": [2000,2002] }' \
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
survey_id | Query | ✓ | String | ID of the completed survey |
selected_items | Body | ✓ | List | List of the selected items IDs |
Response
Code | Name |
---|---|
200 | OK |
401 | Unauthorized |
500 | Internal Server Error |