POST to API

Just going around in circles trying to understand how to use the fetch JSON column to make a POST request to an API.

I struggle a lot with the syntax, and to be honest I don’t even know if it’s possible. But does anybody know what I need to do to get this test example from the API docs to work?

curl --location --request POST 'https://api.dibsy.one/v1/payments' \
--header 'Authorization: Bearer sk_test_42069ce69ea8686921f128be69d65ddf9706' \
--header 'Content-Type: application/json' \
--data-raw '{
   "description":"Gold Style Watch - Special Edition",
   "amount":56.99,
   "metadata":{
      "product_id":156,
      "customer_id":345
   },
   "customer":{
      "name":"John Doe",
      "email":"your_customer@email.com",
      "phone":"+97433333333"
   },
   "redirectUrl":"https://example.com/order"
}'

Here are the docs:

https://docs.dibsy.one/api-reference/payments-api/create-payments

The Fetch JSON column uses a GET request, and cannot use Bearer-style authorization.

This column can also be called arbitrarily often and repeatedly, so it’s not safe to use it to trigger actions like making payments.

The Webhook action can make POST requests.

1 Like

Fair enough!

I use A LOT of webhooks to do things with Integromat.

But using that API docs example POST request, how would I dial that into the webhook action so that it posts straight to the Dibsy API?

There’s HTTP module in Integromat. It can make POST requests. So you could first send a webhook from Glide to Integromat and then use HTTP module to make request to the API you want.

4 Likes

This :point_up_2:

I’m aware of that, I was thinking it was possible to do it from Glide to cut out the middle-man. Nevermind, back to plan B!

you can do it in Google scripts… and use webhook to update a sheet that is connected to your Glide App:

PP avatar background stripe avatar background

2 Likes