Skip to main content
POST
/
api
/
loyalty
/
questions
Create a new question
curl --request POST \
  --url https://admin.snagsolutions.io/api/loyalty/questions \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "loyaltyRuleId": "123e4567-e89b-12d3-a456-426614174000",
  "questionText": "What is your favorite color?",
  "loyaltyQuestionAnswers": [
    {
      "text": "Red",
      "isCorrect": true,
      "sortIdentifier": 1,
      "id": "123e4567-e89b-12d3-a456-426614174333"
    }
  ],
  "allowMultipleAttempts": false
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "text": "<string>",
  "loyaltyQuestionChoices": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "text": "<string>",
      "sortIdentifier": 123
    }
  ]
}

Authorizations

X-API-KEY
string
header
required

Body

application/json

Body

loyaltyRuleId
string<uuid>
required

UUID of the loyalty rule

Example:

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

questionText
string
required

The text of the question

Example:

"What is your favorite color?"

loyaltyQuestionAnswers
Question Choices · object[]
required

Array of choices for the question

allowMultipleAttempts
boolean
default:false

Whether the question allows multiple attempts

Example:

false

Response

201

Response returned for a question

id
string<uuid>
required
text
string
required
loyaltyQuestionChoices
object[]
required