Forum Discussion

SGArchitect's avatar
SGArchitect
New Contributor II
4 years ago

Getting "Bad request" error while using REST POST snap

I am using REST POST snap to connect to an end point. Snap details are shown in the screenshot.
When I execute the snap, it returns the following error:

“status code = 400, reason phrase = Bad Request, refer to the error_entity field in the error view document for more details.”

When I use Postman, it is working fine. I just provide the end point and call it using POST method. The REST API should return something like “email: This field is required…”.
I am expecting the same result when I use REST POST snap. However, the snap is returning “400: bad request” error.

Could you please let me know what the issue could be?

4 Replies

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    @SGArchitect

    Open error view on the Rest Post Snap, and check the “error_entity” field inside the error.

    “error_entity” field should contain the specific error message.

    BR,
    Spiro Taleski

    • SGArchitect's avatar
      SGArchitect
      New Contributor II

      Thank you, Spiro.

      Error view showed me the details. We can mark this post as resolved.

  • vish_ch's avatar
    vish_ch
    New Contributor

    Hi SpiroTaleski ,

    I have faced the similar issue.
    My question here is, how can I fetch these error_entity details directly in error pipeline, what is the expression to use to extract them

    I know below expressions, and these doesn't provide error_entity details


     

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    vish_ch 

    You can access the field the same way you access the other fields: $error_entity

    But I think that not always that field is a part of the error message, so you should probably check first if the error_ entity field exist or not.