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

CodeName
200OK
401Unauthorized
500Internal Server Error

List of the available interest surveys for the user.

FieldTypeDescription
surveyIdIntegerSurvey ID
titleStringSurvey 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

FieldSourceMandatoryTypeDescription
survey_idQueryStringID of the completed survey

Response

CodeName
200OK
401Unauthorized
404Not Found
500Internal Server Error
FieldTypeDescription
survey_idStringID of the completed survey
itemsListList of survey items and its response state

Item

FieldTypeDescription
idStringID of the item
textStringRelated text
imageStringURL of the related image
selectedbooleanTrue 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

FieldSourceMandatoryTypeDescription
survey_idQueryStringID of the completed survey
selected_itemsBodyListList of the selected items IDs

Response

CodeName
200OK
401Unauthorized
500Internal Server Error