JSON to API - Manual Settings

Does anyone knows how to set manually Webhook reading?
I’d like to read “message” that is child from “text”
No documentation…

Here is Jason
{
“text”: {
“message”: “Message Here”
}
}

Here API WebHook Settings
image

Tks in advance!

Instead, use detect request data and send the payload from the webhook or from another tool like postman or insomnia

1 Like

Jici, I’ve used https://webhook.site/
It returns the JSON…
I was able to manage all simple variables and it is working…
My question is when you have parent/child, how do I set this parameter in Bubble.

For instance : messageId is simple key to set.
But, how do I set “text-message” or “text.message” or…?
Was I clear?

Here is Json
{
“messageId”: “3A29DE669CD16D62256A”,
“text”: {
“message”: “Message Here”
}
}

You cannot do it manually, you need to use Detect request data in Backend WF (check the dropdown “parameter definition”)
By the way, the correct term is JSON not JASON

1 Like

Jici, tks again…

The problem is that some variables are not always sent by the Webhook.
And in this case I’m working… There are many variables that comes only when tey are not null…

So I need to set all them manually…, cause if they are not initialized, the endpoint won’t try read… I’m setting one by one manually cause they won’t be initialized properly by the “automatic way”

It is working, except for those with Child/Parent

My issue here is on how to set Manually Child/Parent variables in Bubble Key…
image

Tks in advance.

Like I told you, you need to use a tool like postman or insomnia and initialize the API endpoint with all possible payload that the endpoint will receive. You may need to manually create a payload and send it to the API Endpoint.

So for exmaple, the payload is:

{
	"user": {
		"id": "1234",
		"email": "test@email.com"
	},
	"hook_id": "1234",
	"content": {
		"image": "https://urltoimage.com/"
	}
}

But it could also be:

{
	"user": {
		"id": "1234",
		"email": "test@email.com"
	},
	"hook_id": "1234",
	"content": {
		"text": "sometext"
	}
}

So you need to create manually a payload that will contain both possibilities like:

{
	"user": {
		"id": "1234",
		"email": "test@email.com"
	},
	"hook_id": "1234",
	"content": {
		"image": "https://urltoimage.com/",
		"text": "sometext"
	}
}

And from postman or insomnia, send this payload to the Bubble API Endpoint in Detect request data mode initialized.
This is the only way you can do that.

1 Like

Ok…

So… there is no “manual” way to do that, whenever we have child/parent variables…

Now I’ve got to learn a little bit more about POSTMAN… :smile:
Jason corrected for JSON as well !

Tks Jici

1 Like

Manual, but not inside Bubble. Not like in API Connector sadly

understood ! Tks !

1 Like

Any known tutorial on how to do that Jici?
The easier way…?

There’s no tutorial for what I know. But does the Webhook provider have an payload example? In some case, the payload already have all the possible payload sent

I’ve got the documentation

I also thougt if we could manage all in Bubble…
Reading, retrieving and saving every payload…
join everything and the make a API to send and use de backend workflow to read…

Didn’t see a lot of informations except that you can configure different webhook for each event. The webhook doesn’t seem to change for a specific event and seem to be very simple.

Here is an example…
They return diferently, so no initialized variables won’t be read.
See “MESSAGE” in “FIRST READ” and “IMAGE” in “SECOND READ”.

FIRST READ…
{
“isGroup”: false,
“instanceId”: “3A47F1B0CBBA5055649EA6DBA04D09D8”,
“messageId”: “2617EEA807E44AFBD16C48A45226B685”,
“phone”: “154498398733”,
“fromMe”: true,
“momment”: 1644251431000,
“status”: “RECEIVED”,
“chatName”: “554498398733”,
“senderPhoto”: “https://pps.whatsapp.net/v/t61.24694-24/170931400_212202650511993_3423338295209291992_n.jpg?ccb=11-4&oh=ff11fb4358570d2b02211f0aee89565c&oe=6205CAE2”,
“senderName”: “Augusto”,
“photo”: “https://pps.whatsapp.net/v/t61.24694-24/170931400_212202650511993_3423338295209291992_n.jpg?ccb=11-4&oh=ff11fb4358570d2b02211f0aee89565c&oe=6205CAE2”,
“broadcast”: false,
“forwarded”: false,
“type”: “ReceivedCallback”,
"text": {
** “message”: “Sim”**
** }**
}

SECOND READ…
{
“isGroup”: false,
“instanceId”: " 3A47F1B0CBBA5055649EA6DBA04D09D8",
“messageId”: “8AFFA85884E1E6379921B42A3AE55168”,
“phone”: “5511988595293”,
“fromMe”: true,
“momment”: 1644251503000,
“status”: “RECEIVED”,
“chatName”: “Augusto Chip Cel”,
“senderPhoto”: “https://pps.whatsapp.net/v/t61.24694-24/195426429_1568709943331688_4024014069743613056_n.jpg?ccb=11-4&oh=01_AVxCVRJ8UvIjYfuBJ-1foDtbN_BN_H_EpLo7qptd-Pe9yw&oe=6205A309”,
“senderName”: “Augusto”,
“photo”: “https://pps.whatsapp.net/v/t61.24694-24/195426429_1568707743331688_4024014069743613056_n.jpg?ccb=11-4&oh=01_AVxCVRJ8UvIjYfuBJ-1foDtbN_BN_H_EpLo7qptd-Pe9yw&oe=6205A309”,
“broadcast”: false,
“forwarded”: false,
“type”: “ReceivedCallback”,
"image": {
** “imageUrl”: “https://storage.z-api.io/instances/3A47F1B0CBBA50066491A6DBA04D09D8/8AFFA85884E1E6379921B42A3AE55168.jpeg”,**
“thumbnailUrl”: “https://storage.z-api.io/instances/3A47F1B0CBB15006649EA6DBA04D09D8/8AFFA85884E1E6379921B42A3AE55168.jpeg”,
“caption”: “”,
“mimeType”: “image/jpeg”
}
}

How can I configure a different webhook?
I have only one slot in my provider…
Bubble creates that address that I set in my provider…

A second address there will be no avaiable slots in my provider

In the screenshot in documentation, it seem to have a field for each webhook event. You can create a different Backend WF for each of them and set the url for each event.

No Jici…

There are certainly other slots for other webhooks…
But those 2 returns came from the same slot.

I’ve got “to listen” both returns from the same slot…

SOLVED !
In Postman do a PAYLOAD and initialize variables the way you want.

This topic was automatically closed after 70 days. New replies are no longer allowed.