Here is a list of error codes with HTTP status code that Platio API uses to report each error.
Note that load balancers, CDN and proxy servers may return an error other than these errors, and its response body may not be JSON in those cases. You need to handle these errors properly too.
Code | Description |
---|---|
ATTACHMENT_TOO_LARGE | The size of the attachment exceeds the limit (The maximum attachment size varies depending on an Application). |
DUPLICATED_USER_NAME | A user couldn’t be created because another user with that name already exists. |
DUPLICATED_VALUES | The record you tried to create or update contains duplicated values for columns with unique constraints. |
INVALID_APPLICATION_ID | The application ID is invalid. |
INVALID_ATTACHMENT_ID | The attachment ID is invalid. |
INVALID_BODY | The body is not valid. It might be undefined, malformed (an invalid JSON, for instance), or too big. |
INVALID_COLLECTION_ID | The collection ID is invalid. |
INVALID_COLUMN_ID | The column ID is invalid. |
INVALID_CONTENT_TYPE | Content-Type header is missing or invalid. You need to
specify application/json when you pass a body in JSON. |
INVALID_LIMIT | A value for limit parameter is invalid, or too
big. |
INVALID_PARAM | A param in the body is invalid. |
INVALID_RECORD | You tried to create or update a record with invalid values. |
INVALID_RECORD_ID | The record ID is invalid. |
INVALID_SKIP | A value for skip parameter is invalid. |
INVALID_SORT | The specified column is not sortable. |
INVALID_SORT_KEY | A value for sortKey parameter is invalid. |
INVALID_SORT_ORDER | A value for sortOrder parameter is invalid. |
INVALID_TIMEZONE | A value for timezone parameter is invalid. |
INVALID_UPSERT_KEY_COLUMN | The upsert key is not searchable or unique. Check “Unique” and “Searchable” in Studio to use a field as a key. |
INVALID_USER_ID | A user ID of a creator is invalid when creating a Record. This error code is used too when creators aren’t specified for part of the records when creating multiple Records. |
MISSING_PARAM | A required body param is missing. |
MISSING_UPSERT_KEY_VALUE | The value for the upsert key inside values is
missing. |
NOTIFICATIONS_NOT_ENABLED | Push notifications are not enabled in this application. |
PERMISSION_DENIED | You don’t have permissions to do this operation. |
TOO_LONG_VALUES | The record you tried to create or update contains too long values for columns with indexes. |
TOO_MANY_RECORDS | You tried to manipulate too many records at once. |
TOO_MANY_EXISTING_RECORDS | This collection already has too many records exceeding the limit. |
UNKNOWN_PARAM | An unknown param is present in the body. |
USER_NAME_UNAVAILABLE | A user couldn’t be created with that name. |
Code | Description |
---|---|
AUTHENTICATION_FAILED | The authentication failed. User ID and/or password or Bearer token were wrong. |
AUTHENTICATION_REQUIRED | The authentication is required. Provide user ID and password or Bearer token. |
Code | Description |
---|---|
API_ACCESS_NOT_ALLOWED | This user is not allowed to use API. |
IP_ADDRESS_NOT_ALLOWED | You’re not allowed to call API from this IP address. |
Code | Description |
---|---|
APPLICATION_NOT_FOUND | The specified application was not found. |
ATTACHMENT_NOT_FOUND | The specified attachment was not found. |
COLLECTION_NOT_FOUND | The specified collection was not found. |
COLUMN_NOT_FOUND | The specified column was not found. |
NOT_FOUND | The requested URL doesn’t exist. |
RECORD_NOT_FOUND | The specified record was not found. |
USER_NOT_FOUND | The specified user was not found. |
Code | Description |
---|---|
OPERATION_NOT_ALLOWED | The HTTP verb used was not allowed. |
Code | Description |
---|---|
TOO_MANY_REQUESTS | You have reached the maximum number of API requests you can make in a certain period. |
Code | Description |
---|---|
INTERNAL_SERVER_ERROR | There was an internal server error. |
Code | Description |
---|---|
SERVICE_UNAVAILABLE | The service is unavailable temporarily. |
Here are some examples of errors.
Using a wrong password returns 401 status code with
AUTHENTICATION_FAILED
.
curl -u uf598c3f:wrongPassword \
'http://api.plat.io/v1/pkyfjjjmlyffnlgeb5oh2eqs2aa/collections/tf71dbb9/records'
{
"code": "AUTHENTICATION_FAILED"
}
Using a wrong collection ID returns 400 status code
with INVALID_COLLECTION_ID
.
curl -u uf598c3f:mypassword \
'http://api.plat.io/v1/pkyfjjjmlyffnlgeb5oh2eqs2aa/collections/123/records'
{
"code": "INVALID_COLLECTION_ID"
}
Accessing a non-existing Record (or a deleted Record) returns
404 status code with RECORD_NOT_FOUND
.
curl -u uf598c3f:mypassword \
'http://api.plat.io/v1/pkyfjjjmlyffnlgeb5oh2eqs2aa/collections/tf71dbb9/records/ri5f3cykexfbkzk7ohzqm2oocni'
{
"code": "RECORD_NOT_FOUND"
}
Having an unknown body parameter when creating a Record returns
400 status code with UNKNOWN_PARAM
.
curl -u uf598c3f:mypassword \
-X POST \
-H 'Content-Type: application/json' \
-d '{"unknown_param":"unknown value","values":{"c002c2c0":{"type":"String","value":"Scott Tiger"}}}' \
'https://api.plat.io/v1/pkyfjjjmlyffnlgeb5oh2eqs2aa/collections/tf71dbb9/records'
{
"code": "UNKNOWN_PARAM",
"params": {
"name": "unknown_param"
}
}
Having a missing parameter when creating a Record returns
400 status code with MISSING_PARAM
.
curl -u uf598c3f:mypassword \
-X POST \
-H 'Content-Type: application/json' \
-d '{"new_values":{"c002c2c0":{"type":"String","value":"Scott Tiger"}}}' \
'https://api.plat.io/v1/pkyfjjjmlyffnlgeb5oh2eqs2aa/collections/tf71dbb9/records'
{
"code": "MISSING_PARAM",
"params": {
"name": "values"
}
}
Having an invalid body (passing an invalid JSON as a body) returns
400 status code with INVALID_BODY
.
Note that there is no closing ” for the key type
.
curl -u uf598c3f:mypassword \
-X POST \
-H 'Content-Type: application/json' \
-d '{"values":{"c002c2c0":{"type:"String","value":"Scott Tiger"}}}' \
'https://api.plat.io/v1/pkyfjjjmlyffnlgeb5oh2eqs2aa/collections/tf71dbb9/records'
{
"code": "INVALID_BODY"
}