Why is bubble not able to parse application/x-www-form-urlencoded

I have a webhook setup that’s receiving a “payload” https://bit.ly/3NDEHCm
For the life of me, I cannot figure out how to parse this data so that I can use it to create and update things. Do I really need to use an external service to parse the data into a format that bubble can understand?

Any assistance would be greatly appreciated.

Show us your event setup in your backend.

Thanks @doug.burden https://bit.ly/44iIYCo

since the payload is pretty much fixed at this point, click edit raw data and format it properly and bubble should restructure it above. The looks of it, the whole object for the ‘payload’ is a string value which needs to be changed.

I’ve tried formatting it correctly but when the webhook fires no data is created https://bit.ly/3XDsjqo & https://bit.ly/3pz91G3 & https://bit.ly/43bl9uH

Well it looks like you’re definitely getting closer. How confident are you that there in fact wasn’t empty data passed? Or rather that you’re using the right ‘version-test’ url for the webhook?

Also be sure to remove /initialize

This is the payload the service provider sent me when initializing so there is data. I think bubble just cant read it in this state.

Also did remove /initialize

1 Like

You’re probably right.

can you send me that string? Data doesn’t have to be included just the key value pairs

Seems “wrong” to use an external service to parse this data. Right?

unfortunately this service is sending back a single json item. which is a ‘payload’ and a string which is the actual object you need.

{
“payload”: “{“id":7,“status”:“completed”,“totalAmount”:100,“tipAmount”:0,“feeAmount”:3,“settleAmount”:97,“requiredAmount”:null,“date”:“2023-07-05T18:19:33Z”,“snapCode”:“Fa4GM9V2”,“snapCodeReference”:“4fc42639-2f3b-4e21-a674-e64269fe51f3”,“userReference”:"don@abc.com”,“merchantReference”:null,“statementReference”:null,“authCode”:null,“deliveryAddress”:null,“deviceSerialNumber”:null,“extra”:{“merchantId”:“82C252D3-2105-4D80-9716-1842EED711EA”,“transactionType”:“Payment”,“checksum”:“77394C74EC593067887B0F50C466A2792C2E6D9927416D4EC127B0C8D081BBE4”,“amount”:“100”,“strict”:false,“redirectUrl”:”",“successRedirectUrl”:"",“failRedirectUrl”:"",“id”:"",“wegotOrderId”:null,“plugin”:"",“plugin_version”:""},“isVoucher”:false,“isVoucherRedemption”:false,“paymentType”:“gateway”,“transactionType”:“payment”}"
}

I honestly can’t think of a quick fix for you. I mean, that string needs a JSON.parse method, but then how do you access the data from bubble even if you could with a custom method? Unless this method parses the response and also creates a new thing (which is possible)

I was thinking the same thing: https://bit.ly/3JMHaZQ

I’d love to help you with a custom solution for this. Interested? Get in my DMs.

Thanks for the effort. Really appreciate it.

I’ll keep that in mind1! :wink:

No free help? Dang it!

1 Like

You can redirect the json part to another backend WF using API connector that will call this backend wf in a POST request and in JSON. Be sure to include application/json for content-type header

2 Likes

Hi @Jici
Can you please show me an example of how to setup the API connector for this so that it parses the raw POST body that hasn’t been parsed or decoded?