Errors have a returned status code of 400, 401, 403, 404, 429, or 500. Success has a returned
status code 200. See here for details.
- The
errors
field contains the array of errors, one per social network that had an error. - The
action
refers to the type of error returned. - The top-level
status
field will be “error” if the API call failed. For example, for a /post call if all social network posting were successful thestatus
field will be “success”, else the status field will be “error”. - The
code
field contains the Ayrshare reference error code. - The
message
field is the specific details of the error.
Handling Errors
You should handle any error responses and take the appropriate action. An error occurred if:- The response return code is not
200
- The JSON response status is
error
400 Bad Request
response code.
400 Bad Request
response code:
Retry Available
Sometimes the social networks have a unrecoverable error, such as their are having server issues, and the call ultimately fails even after numerous retries. In those cases, our system will determine if the error is retryable and if so, theretryAvailable
field will be true
.
Error Message Translation
The API error message response can be automatically translated to the language of your choice. This is useful if you want to display the error directly to your user in their preferred language. See here if you want to choose the language of the social linking page. In the header include:Language_Code
is one of the available language codes.
For example, the following will translate the error to French.