import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const question = await client.loyalty.questions.update('id', {
loyaltyQuestionAnswers: [{ isCorrect: true, sortIdentifier: 1, text: 'Red' }],
questionText: 'What is your favorite color?',
});
console.log(question.id);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"loyaltyQuestionChoices": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"sortIdentifier": 123
}
]
}
This endpoint allows you to update an existing question.
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const question = await client.loyalty.questions.update('id', {
loyaltyQuestionAnswers: [{ isCorrect: true, sortIdentifier: 1, text: 'Red' }],
questionText: 'What is your favorite color?',
});
console.log(question.id);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"loyaltyQuestionChoices": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"sortIdentifier": 123
}
]
}
Body
The body is of type object
.
200
Response returned for a question
Was this page helpful?