Links

Ayrshare Error Codes

Ayrshare specific returned error codes.
The REST API will include a response with a list of errors if applicable.
Error have a returned status code of 400, 401, 403, 404, 429, or 500. Success has a returned status code 200. See here for details.
Errors are often 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.
{
"status": "error",
"errors": [
{
"action": "post",
"status": "error",
"code": 110,
"message": "Status is a duplicate.",
"post": "Today is a great day",
"platform": "twitter"
},
{
"action": "post",
"status": "error",
"code": 107,
"message": "Facebook Error: This status update is identical to the last one you posted. Try posting something different, or delete your previous update.",
"platform": "facebook"
}
],
"postIds": [],
"id": "6APU4qqI7XO7JM3BOy6B"
}
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 the status 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.
{
"status": "error",
"errors": [
{
"action": "post",
"status": "error",
"code": 161,
"message": "Facebook authorization error. This can occur if your Facebook security changes. Try unlinking and re-linking Facebook or contact us for assistance.",
"platform": "facebook"
}
],
"postIds": [],
"id": "gh7SyTpeD2CQAMxWk3oh",
"post": "A great Facebook Posts"
}
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:
{
"status": "error",
"errors": [
{
"action": "post",
"status": "error",
"code": 138,
"message": "Instagram Error: There was an issue posting to Instagram. The submitted image with aspect ratio ('1440/2158',) cannot be published. Please submit an image with a valid aspect ratio.",
"platform": "instagram"
}
],
"postIds": [],
"id": "Jxe2nMM3FmEvMXFSY3g4",
"post": "Is this a good image?"
}
An action might be resending the images with the correct ratio.