GET
/
api
/
loyalty
/
questions
import SnagSolutions from '@snagsolutions/sdk';

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

async function main() {
  const questions = await client.loyalty.questions.list({
    loyaltyRuleIds: '123e4567-e89b-12d3-a456-426614174000',
    organizationId: '123e4567-e89b-12d3-a456-426614174002',
    websiteId: '123e4567-e89b-12d3-a456-426614174001',
  });

  console.log(questions);
}

main();
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "text": "<string>",
    "loyaltyQuestionChoices": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "text": "<string>",
        "sortIdentifier": 123
      }
    ]
  }
]

Query Parameters

loyaltyRuleIds
required

UUID of the loyalty rule to fetch questions for

Example:

"123e4567-e89b-12d3-a456-426614174000"

websiteId
string
required

UUID of the website to fetch questions for

Example:

"123e4567-e89b-12d3-a456-426614174001"

organizationId
string
required

UUID of the organization to fetch questions for

Example:

"123e4567-e89b-12d3-a456-426614174002"

Response

200
application/json
200
id
string
required
text
string
required
loyaltyQuestionChoices
object[]
required