Accessing payload from third-party call to REST endpoint?

Backendless Version 5.5.1 Online

Application ID: B9941993-E38E-A647-FF0F-626E69BF9900

Expected Behavior

  1. I have created an API Service endpoint that I am calling from a Stripe webhook.
  2. Stripe sends a request header with an object that includes payment info, billing info, etc. Successful handshake.
  3. From the Codeless interface, I expect to be able to access the above payload.

Actual Behavior

From the Codeless interface, I cannot seem to access that payload. “Request Headers” gives only regular header info such as “Accept”, “Connection”, “User-Agent”, “Remote-Address”, etc.

How can I access the payload that Stripe (and other services) deliver with the RESTful request?

Hello @Stephen_Peasley

I just checked and it works for me, I have access to all the request headers:

could you please provide minimal logic and curl which doesn’t work for you

Regards, Vlad

The issue is that I need to access the Request Body, not the Request Headers. I am not able to customize Stripe’s headers, so this simulation doesn’t apply. The data I need is sent through the request body, much like your native Backendless API calls. How can I access the Request Body from the Codeless UI?

Hi Stephen,

I have few questions for you which will help me suggest a solution:

  1. Is your API Service also written in Codeless?
  2. Do you use our Stripe plugin or communicate with Stripe directly from your code/logic?

Regards,
Mark

  1. Yes, my API Service is written in Codeless.
  2. I had no idea that there was a Backendless Stripe plugin! Looking into this now. Thank you.

In case our plugin doesn’t work out, here’s how to get the body of a request made to an external service:

2 Likes

Thank you. Since the Stripe plugin does not assign Stripe events to a user or save user information, I will explore this to assign the Stripe customer to the user. In your example, what does the path value represent?

Hello @Stephen_Peasley

In the example above, use the path to the file, which is located in the File section of the console.
You can, for example, specify the path to the index.html file in the path, to get it go to the File section - web - and click Copy link to Clipboard, and you will get a link, but something like the following
https://backendlessappcontent.com//console/XXXXX/files/view/web/index.html

The path value represents the endpoint URL of a resource you get the payload from. In your case, it would be Stripe’s API endpoint.

Regards,
Mark