Ayrshare Error Codes
Ayrshare specific returned error codes.
The REST API will include a response with a list of errors if applicable.
Errors are dynamic and specific to the API call made.
For example, a post that is considered a duplicate by Twitter and Facebook would return the following response.
Please note:
- 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
For example, if Facebook link was removed by your user - they changed their password or removed Ayrshare’s access - the following response would occur when posting with a 400 Bad Request
response code.
An action might be to notify your user via your dashboard, text or email.
Another example is if the posted Instagram image is the wrong dimensions or ratio with a 400 Bad Request
response code:
An action might be resending the images with the correct ratio.
Error Message Translation
Error messages 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.
In the header include:
Where the Language_Code
is one of the available language codes.
For example, the following will translate the error to French.
Our system will automatically detect the error message language.