[502 Bad Gateway] when I got all product reviews of a shop via API

anhdinh89anhdinh89 Member Posts: 10
I have tried get all reviews of product on whole my shop via API but I got an error from lightspeed that it is [502 Bad Gateway] during at that time

So How do I avoid errors? if I want get all reviews of product on whole my shop

Thanks
"https://api.webshopapp.com/nl/reviews.json": Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

6 comments

  • Alex LugoAlex Lugo Administrator, Lightspeed Staff Posts: 155 moderator
    Hello @anhdinh89,

    Earlier today we experienced some issues with our API Server, this was identified by our DevOps team and corrected. Please give it another try. Let me know if you still experience issues.
    Alex Lugo
    API Support Specialist
    Lightspeed HQ
  • anhdinh89anhdinh89 Member Posts: 10
    Hello @Alex Lugo

    At now sometime it return 500 error

     I/O error on GET request for "https://api.webshopapp.com/nl/reviews.json": Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
     at [Source: <html>
    <head>
      <title>500 Internal Server Error</title>
    </head>
    <body>
      <h1>Internal Server Error</h1>
      <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p><p>Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.</p><p>More information about this error may be available in the server error log.</p>
      <hr>
      <p>Message ID: 99c9e6001f9bde328f25043df267ed79</p>
    </body>
    </html>; line: 1, column: 2]; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
     at [Source: <html>
    <head>
      <title>500 Internal Server Error</title>
    </head>
    <body>
      <h1>Internal Server Error</h1>
      <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p><p>Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.</p><p>More information about this error may be available in the server error log.</p>
      <hr>
      <p>Message ID: 99c9e6001f9bde328f25043df267ed79</p>
    </body>
    </html>

    I  tried it via postman , it return the valid response 


  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 573 moderator
    @anhdinh89 have you been able to get things working?

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • anhdinh89anhdinh89 Member Posts: 10
    Adrian Samuel

    I think I need to workaround with the issue

    Thanks
  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 573 moderator
    @anhdinh89 oh, are you still not able to gather all the reviews off your website? Could you make another HTTP request and give us both the full details of the request and the response body including headers without showing us your API keys

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • anhdinh89anhdinh89 Member Posts: 10
    edited October 2018
    Adrian Samuel

    I realized that I have called more than one thousand requests to get whole reviews (each product),and I hope all of them will be success,
    No matter how your system that you build is better moreover will assure that all my requests are success that is impossible , therefore I have changed  the way that I get all reviews of my shop (approximate 4 requests), and I create a "Fail-Safe-Return" to re-try when an error return from lightspeed

    Thanks
    Post edited by anhdinh89 on
Sign In or Register to comment.