Access data posted to API method

An external platform, eSign (a contract signature service), is calling one of my custom API methods (as a webhook callback after a user signs a contract) and passing in a JSON data structure that I need to read and process. From their developer documentation: “eSign posts JSON data to your webhook. Every JSON payload posted contains event name (event_name ), event date (event_date ) and data related to that particular event (data )”. Attached is a sample request body from them. I am only able to provide them with the URL of my API method and to my knowledge, they won’t support me providing a method argument for the JSON data. How can I read the JSON data from inside my method? Would it be inside the Request or Request Context context blocks? I’m using codeless. Thanks!

Hello @Marc_Chriqui

Could you try to add an argument to your API method, and test if something comes when it runs?

Regards, Dima.

Hi. I just added an argument (called “data”) and attempted to log the value of it when the method is called by the external service. The method was successfully called by the external service, the log entry was created, but the value of the argument is empty. Here is my API method.

The problem must be in the logic of the logToTable function.

It’s a very simple utility I use to log to a table when desired. Here it is.

You could wrap the logic into try/catch block and log the error

1 Like

Ok it worked. I was able to see the JSON content in the method argument I created (“data”). I managed to see it once I used the Convert to Text block on the argument value, so I guess it wasn’t visible in object form. Thanks again for your help!

1 Like