POST
/
api
/
loyalty
/
questions
/
{id}
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});

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
    }
  ]
}

Path Parameters

id
string
required

Body

application/json

Body

The body is of type object.

Response

200
application/json

200

Response returned for a question