Skip to main content
GET
/
api
/
loyalty
/
questions
JavaScript
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: 'My API Key',
});

const questions = await client.loyalty.questions.list({
  loyaltyRuleIds: '123e4567-e89b-12d3-a456-426614174000',
});

console.log(questions.data);
{
  "data": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "text": "<string>",
      "loyaltyQuestionChoices": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "text": "<string>",
          "sortIdentifier": 123
        }
      ]
    }
  ],
  "hasNextPage": true
}

Authorizations

X-API-KEY
string
header
required

Query Parameters

loyaltyRuleIds
required

UUID of the loyalty rule to fetch questions for

Example:

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

websiteId
string<uuid>

UUID of the website to fetch questions for

Example:

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

organizationId
string<uuid>

UUID of the organization to fetch questions for

Example:

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

userId
string<uuid>

UUID of the user to fetch questions for

Example:

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

limit
integer
default:10

Maximum number of records to return (max 100)

Required range: 1 <= x <= 100
Example:

50

startingAfter
string<uuid>

Pagination cursor to start after a specific resource ID

Example:

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

Response

200

data
Question Response · object[]
required
hasNextPage
boolean
required