Webhooks post from external source to database

Is it possible to deploy a Business Logic Codeless service to receive information in json format from an external source as a webhook, without going through zapier or integromat to write it to the database? I know the external service is sending the data but I cant seem to be able to read or view the payload from it.

Here is the response from the service on the webhook.site service:

Hello @Andrew_Billcliffe,

yes, it’s possible. Have you tried it already? If so, is there any issues you faced during development?

This documentation might be helpful for you:
https://backendless.com/docs/bl-js/bl_basic_quick_start_guide_js.html

Regards,
Stanislaw

Hi Stanislaw, I’ve tried a few things in the codeless logic but normally when I call an the external API with a get request I would use the HTTPS block, and provide the path to send the request to, then read the response, and extract the data accordingly to save to the database.

But the external service also has the ability to post the json data to a webhook without having to call a get request to it first, however I can seem to find a codeless solution to read the incoming payload. I can see that its calling the backendless endpoint, but I cant work out how to retrieve the from it.

The endpoint: https://{myAppName}.backendless.app/api/services/awrsWebhook/awrsWebhookV1

Should I be using a post or get rest operation to read the incoming json?

If the external service makes a POST request, then you should create the POST endpoint in your API service in Backendless. Do you have control over the external service’s request?

I can only specify the endpoint/we hook it posts to. I don’t actually have the endpoint it posts from either. Although should be able to get it if I need use the HTTPS block to read from it?

The HTTPS block is for making requests, not for reading incoming ones.
In order to know how you should create the method for your webhook, I would need to know more details - how it looks like, etc.
Here is an example of how to create a base method in API Service using codeless:

But the data I entered depend on what the incoming request looks like.

Thanks Stanislaw.

The response returned comes through as

{
   "data": [

      {
         "index": 1,
         "URN": "string",
         "EDOR": "string",
         "Status": "string"
      },

      {
         "index": 2,
         "URN": "string",
         "EDOR": "string",
         "Status": "string"
      }

   ]
}

There may be 1 or 100 entries being posted. In this situation there are two being posted by the service. I can see two posts being made to the endpoint in the real time logging window, but I’ve tried a variety of options to extract the json data. Normally for a get request from the same service I just declare a variable called data and put the array/list into that and call out what I need to save to the database.

Thanks Stanislaw, this really helped!