- DarkLight
Yotpo Reviews Generic Integration API Calls Troubleshooting
- DarkLight
When making API calls to Yotpo, it is important to check 4 things in order to ensure a 200: Correct response:
API Header
The header of the API call must be set to Content-Type: application/json in order for the data to be correctly formatted.
API Path and URL
Make sure that you are using the correct URL for the specific API call you wish to make and that the appkey and utoken keywords are replaced with the correct information.
API Body Content
All data must be sent as JSON and encoded in UTF-8.
validate_data value
validate_data is a boolean property and should not be in quotes. Make sure not to put it in 'single' or "double" quotes.
Such a request will return 200-OK, but the order won't be created.
Troubleshooting errors
If any of the following errors are encountered, check that the Appkey is correct and that the Utoken was generated recently and is correct.
- invalid_client
{
"error": "invalid_client"
}
- Couldn't find Account with app_key
{
"status": {
"message": "Couldn't find Account with app_key = ",
"code": 404,
"error_type": "Exceptions::RecordNotFound"
}
}
- You are not authorized to access this page
{
"status": {
"message": "You are not authorized to access this page.",
"code": 401,
"error_type": "Exceptions::AccessDenied"
}
}
- You cannot use the API Secret in place of the Utoken.
- Certain API calls have specific errors related only to those calls. In these cases, check the API documentation.
- If the following error is encountered, check the formatting of the JSON in the API call.
{
"status": {
"message": "Failure",
"error_type": "YotpoApiUnknownException",
"code": 500
},
"e": {
"u": "c7218545-4af8-4887-8d9e-5feef2fe0e35",
"s": 4
}
}
Testing your API call
If you are making an API call and unable to determine where the source of the error is coming from, send yourself a test API call by doing the following:
- Go to https://requestbin.com/
- Click the Create a RequestBin button
- Copy the URL under Bin URL (do not close this window)
- Direct your API call to this new URL you generated (This must be within the next 48 hours or the link will expire)
- Do not alter the URL in any way by adding an Appkey or Utoken to it
- Once the API call has been made, refresh the unique RequestBin URL to view the breakdown of your API Call.
Check to see that the Content-Type is set to application/json and inspect the JSON for any errors as per the Troubleshooting section.