import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.loyalty.questionsResponses.submit({
loyaltyQuestionChoiceId: '123e4567-e89b-12d3-a456-426614174001',
});
console.log(response.alreadySubmitted);
{
"response": {
"id": "123e4567-e89b-12d3-a456-426614174002",
"userId": "123e4567-e89b-12d3-a456-426614174003",
"loyaltyQuestionId": "123e4567-e89b-12d3-a456-426614174004",
"loyaltyQuestionChoiceId": "123e4567-e89b-12d3-a456-426614174005"
},
"isCorrect": true,
"alreadySubmitted": false
}
This endpoint allows you to submit a response to a question.
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.loyalty.questionsResponses.submit({
loyaltyQuestionChoiceId: '123e4567-e89b-12d3-a456-426614174001',
});
console.log(response.alreadySubmitted);
{
"response": {
"id": "123e4567-e89b-12d3-a456-426614174002",
"userId": "123e4567-e89b-12d3-a456-426614174003",
"loyaltyQuestionId": "123e4567-e89b-12d3-a456-426614174004",
"loyaltyQuestionChoiceId": "123e4567-e89b-12d3-a456-426614174005"
},
"isCorrect": true,
"alreadySubmitted": false
}
Body
The body is of type object
.
200
Response returned when submitting an answer to a question
Was this page helpful?