Update click
POST
/v2/client/clicks/{clickId}
Updates the click with the action and returns the changed state of the click, hence the GET click endpoint does not have to be called after calling this endpoint.
The action can be one of the following:
answer
- answers a questionskip
- skip a question, if skipping is allowedleave
- either leaves the survey or the click flow with a supplied reasonrate
- when a survey is completed, this action can be used to rate the survey
Path parameters
-
clickId string Required
click id
Body Required
-
answer_question object
-
skip_question boolean
-
leave_survey object
-
rate_survey object
-
sc_token string
Optional samplechain token. Can be ignored by most implementations.
POST /v2/client/clicks/{clickId}
curl \
-X POST https://api.bitlabs.ai/v2/client/clicks/{clickId} \
-H "Content-Type: application/json" \
-d '{"answer_question":{"answers":["1","2"]},"skip_question":true,"leave_survey":{"reason":"OTHER"},"rate_survey":{"rating":42},"sc_token":"string"}'
Request example
{
"answer_question": {
"answers": [
"1",
"2"
]
},
"skip_question": true,
"leave_survey": {
"reason": "OTHER"
},
"rate_survey": {
"rating": 42
},
"sc_token": "string"
}
Response examples (200)
{
"data": {
"answer_question": {
"question": {
"id": "e9bdff4e7d",
"language": "en",
"type": "TEXT",
"localized_text": "What is your favorite color?",
"answers": [
{
"code": "1",
"localized_text": "Red"
}
],
"can_skip": true,
"is_duplicate": false,
"example": "string",
"validation_info": {
"min": 1,
"max": 1,
"regex": "^.{1,30}$"
}
}
},
"redirect": {
"url": "https://web.bitlabs.ai"
},
"answered_questions": 42,
"required_questions": 42,
"click_type": "survey",
"question_mode": "default",
"survey_details": {
"id": "string",
"cpi": "1.2",
"value": "120",
"loi": 5.3,
"country": "US",
"language": "en",
"rating": 4,
"category": {
"name": "Automotive",
"icon_name": "string",
"icon_url": "string",
"name_internal": "automotive"
}
}
}
}
Response examples (422)
{
"data": {
"code": "REGEX_MISMATCH",
"reason": "string"
}
}