I am working with an external web service called Paystack. They are a payment processing company that services Africa; they have webhook functionality. However, they only allow you to register one webhook URL for multiple events e.g “charge.success” event/ “subscription.create” event. Each event has a different JSON payload. In Bubble, you can use the request data functionality to automatically parse the JSON payload for one event. However, since Paystack only allows you to register one URL for multiple events, I am currently grappling (unsuccessfully). with how to create a URL endpoint that can parse all the events.
Each JSON payload has an “event” field that can be used to differentiate between payloads
{
“event”:“subscription.create”
…
}
{
“event”:“charge.success”
…
}
However, I’m still running into the problem of the automatic detection of data by Bubble’s request data action - which only recognizes the payload for one type of event.
Any suggestions or tips on how to move forward with this?
You will need to manually create a merge of all the payload and use a service like postman or Insomnia to send this payload to Bubble initialize endpoint.
So imagine that one payload is
Thanks so much for the quick reply! ( as well as all that you do for the Bubble ecosystem) Your answers have helped me on more than a couple of occasions! Just to make sure I’m on the same page; the answer to this problem would be to use a service like postman to create a (SUPER) json payload that has all the properties of the different event types that I’m interested in. Then pass that off to the Bubble initialize endpoint. Which would then allow me to access the necessary fields in the “request data” object in Bubble’s API workflow page.
Exactly!
Bubble will not care after if there’s missing fields in future payload.
The goal is just to make Bubble detect all the possible payload format in one time and you can use it in a single endpoint.