Structure
When an API request fails, a json response of the following schema should be returned:
{
"description":"Representation of a PublisherApiException",
"type":"object",
"properties":{
"type":{
"description":"The exception type (PublisherApiException)",
"type":"string",
"required":true
},
"message":{
"description":"The exception message",
"type":"string",
"required":true
},
"code":{
"description":"The exception code number",
"type":"number",
"required":true
}
}
}
Possible PublisherApiException's
Undefined error: code: 800, HTTP Status Code: 500
Whenever something unexpected went wrong.
{
type: "PublisherApiException",
message: "undefined error occured",
code: 800,
}
Unauthorized: code: 801, HTTP Status Code: 403
If there is no appid provided or the requestet ip is not allowed.
{
type: "PublisherApiException",
message: "unauthorized",
code: 801,
}
Request signature invalid: code: 802, HTTP Status Code: 403
If the request signature is invalid.
{
type: "PublisherApiException",
message: "request signature invalid",
code: 802,
}
Object not found: code: 804, HTTP Status Code: 404
If a requested objected was not found.
{
type: "PublisherApiException",
message: "object not found",
code: 804,
}
No configuration available for appid: code: 805, HTTP Status Code: 404
If there is no configuration available for appid.
{
type: "PublisherApiException",
message: "no configuration available for appid",
code: 805,
}
No post data sent: code: 806, HTTP Status Code: 400
Empty json data sent in request body.
{
type: "PublisherApiException",
message: "no post data sent",
code: 806,
}
Request body not a valid json string: code: 807, HTTP Status Code: 400
Returned if the posted request body is not json_decode'able.
{
type: "PublisherApiException",
message: "request body not a valid json string",
code: 807,
}
Posted data not valid: code: 808, HTTP Status Code: 400
When the validation of the json request body went wrong.
{
type: "PublisherApiException",
message: "posted data not valid",
code: 808,
}