Skip to main content
POST
/
api
/
loyalty
/
questions_responses
Submit a response to a question
curl --request POST \
  --url https://admin.snagsolutions.io/api/loyalty/questions_responses \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "loyaltyQuestionChoiceId": "123e4567-e89b-12d3-a456-426614174001",
  "websiteId": "123e4567-e89b-12d3-a456-426614174001",
  "organizationId": "123e4567-e89b-12d3-a456-426614174001",
  "userId": "123e4567-e89b-12d3-a456-426614174003"
}
'
{
  "response": {
    "id": "123e4567-e89b-12d3-a456-426614174002",
    "userId": "123e4567-e89b-12d3-a456-426614174003",
    "loyaltyQuestionId": "123e4567-e89b-12d3-a456-426614174004",
    "loyaltyQuestionChoiceId": "123e4567-e89b-12d3-a456-426614174005"
  },
  "isCorrect": true,
  "alreadySubmitted": false
}

Authorizations

X-API-KEY
string
header
required

Body

application/json

Body

loyaltyQuestionChoiceId
string<uuid>
required

UUID of the selected choice

Example:

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

websiteId
string<uuid>

UUID of the website to filter responses

Example:

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

organizationId
string<uuid>

UUID of the organization to filter responses

Example:

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

userId
string<uuid>

UUID of the user who submitted the response

Example:

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

Response

200

Response returned when submitting an answer to a question

response
object
required
isCorrect
boolean
required

Whether the submitted answer was correct

Example:

true

alreadySubmitted
boolean
required

Whether the user had already submitted an answer to this question

Example:

false