Yotpo Reviews Generic Integration API Calls Troubleshooting
    • Dark
      Light

    Yotpo Reviews Generic Integration API Calls Troubleshooting

    • Dark
      Light

    Article summary

    Products


    Reviews
    Supported plans

    Free, Starter, Pro, Premium, Enterprise

    eCommerce Platform

    Custom

    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.

    Note:
    The single-purchase URL can only accept a single purchase per API call. The Mass Purchases API call can accept either a single purchase or multiple purchases but must be formatted correctly as per Reference API.

    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. 

    1. invalid_client
    {
      "error": "invalid_client"
    }
    1. Couldn't find Account with app_key
    {
        "status": {
            "message": "Couldn't find Account with app_key = ",
            "code": 404,
            "error_type": "Exceptions::RecordNotFound"
        }
    }
    1. You are not authorized to access this page
    {
      "status": {
        "message": "You are not authorized to access this page.",
        "code": 401,
        "error_type": "Exceptions::AccessDenied"
      }
    }
    Please note:
    • 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.
    1. 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
      }
    }
    Tip:
    Yotpo recommends running your code through a JSON validator such as JSONLint to help find formatting errors.

    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:

    1. Go to https://requestbin.com/
    2. Click the Create a RequestBin button
    3. Copy the URL under Bin URL (do not close this window)
    4. Direct your API call to this new URL you generated (This must be within the next 48 hours or the link will expire)
    5. Do not alter the URL in any way by adding an Appkey or Utoken to it
    6. 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.

    Important:
    JSONLint and RequestBin are third-party services and in no way affiliated with Yotpo Ltd. These products/services may be subject to their own separate terms and policies.

    Was this article helpful?