This page lists every error that the Pristo API endpoints POST /v1/events/send and POST /v1/links/generate/{prjId} return, with the message in the body and the fix.
How errors look
Section titled “How errors look”- Most
400and404errors have a plain-text body, for examplecontact is required. It isn’t JSON, so read it as text. 401,415, some400and most500errors have a JSON problem body (Content-Type: application/problem+json) withtitleandstatus. A500may add adetailmessage.- The API checks the request in this order: the path, the body, the API key, then the data. A request with several problems returns the first one only.
Errors on both endpoints
Section titled “Errors on both endpoints”| Status | Body | Cause | Fix |
|---|---|---|---|
400 |
JSON problem body, title Bad Request |
The body is missing or isn’t valid JSON, or a field has the wrong JSON type, such as "isReusable": "true" |
Send a JSON object. Send {} when you have no fields to set |
400 |
Payload size exceeds the maximum allowed size of 10000 bytes |
The body is larger than 10,000 bytes | Send fewer or shorter custom fields |
400 |
Value is invalid |
The X-API-Key value is shorter than 24 characters. On events, type or contact.id is only spaces. On links, language isn’t an ISO 639-1 code |
Copy the whole key. Fix the field |
401 |
JSON problem body, title Unauthorized |
The X-API-Key header is missing or empty, or the key is wrong, deactivated or deleted |
Send an active key. See Authenticate with an API key |
405 |
Empty | The request didn’t use POST |
Send POST |
415 |
JSON problem body, title Unsupported Media Type |
The Content-Type header isn’t application/json |
Add Content-Type: application/json |
500 |
Internal server error, or a JSON problem body |
Something failed on the Pristo side | Wait and retry. If it continues, contact Pristo support |
Send an event
Section titled “Send an event”| Status | Body | Cause | Fix |
|---|---|---|---|
400 |
contact is required |
The body has no contact object |
Add contact with at least id |
400 |
type is required and must be between 1 and 50 characters long |
type is missing, empty or longer than 50 characters |
Send the event type’s Unique Identifier |
400 |
contact.id is required and must be between 1 and 50 characters long |
contact.id is missing, empty or longer than 50 characters |
Send your ID for the contact |
404 |
no population is associated with this api key |
The API key’s program has no population | Create the program’s population, or use a key from a program that has one |
404 |
Population with id not found |
The program’s population could not be found when the event was saved | Check the population in the app, then retry |
Generate a survey link
Section titled “Generate a survey link”| Status | Body | Cause | Fix |
|---|---|---|---|
400 |
provided surveyId is not valid |
The prjId in the path isn’t a 22-character questionnaire ID. A full UUID fails too |
Copy the ID from the questionnaire’s Share tab |
400 |
expiresInMinutes must be between 1 and 1576800 |
expiresInMinutes is below 1 or above 1,576,800 |
Send 1 to 1,576,800, or leave it out for no expiry |
400 |
language must be exactly 2 characters long (iso 639-1) |
language isn’t 2 characters |
Send a code such as en or he |
400 |
title must be at most 50 characters long |
title is longer than 50 characters |
Shorten the title |
400 |
customField values must be strings |
A value in customFields is a number, a boolean, an object or an array |
Send every value as a string |
400 |
customField keys and values must be at most 50 characters long |
A key or a value in customFields is longer than 50 characters |
Shorten it |
404 |
project with id <UUID> not found |
No questionnaire with this ID in the API key’s account, or the questionnaire was deleted | Check the ID and the key’s account |
500 |
JSON problem body, detail project does not have a form associated |
The questionnaire has no form | Contact Pristo support with the questionnaire ID |
500 |
JSON problem body, detail a problem occurred, please try again later |
The questionnaire could not be loaded | Wait and retry |