Receive XML File via webhook and read it

Is there any good guide how to read an XML file send to a bubble webhook? (API workflow external)

I want to read the information from this file and translate it to our app logic.

If this is sent as a file, you can call this file url with Bubble API Connector.

Either I sort of reversed in my mind back to the moment when I couldn’t send a file or somehting is off.

I am sending a file to a webhook in bubble.

Postman request is:
curl --location ā€˜webhook’
–header ā€˜Authorization: Bearer xxxx’
–header ā€˜Content-Type: text/plain’
–data ā€˜{
ā€œFileā€: {
ā€œfilenameā€: ā€œBla.xmlā€,
ā€œcontentsā€: ā€œbase64ā€
}
}’

And I get info

{
ā€œstatusCodeā€: 400,
ā€œbodyā€: {
ā€œstatusā€: ā€œMISSING_DATAā€,
ā€œmessageā€: ā€œMissing parameter for workflow expeditors_webhook: parameter Fileā€
}
}

So how should I build it that I can send a file?
I cannot put a postman param as a file, so I am missing something here.
If I use the form, it still doesn’t work for some reason.

I was there once, that I could send a file, but now I somehow lost this skill :smiley:

OK, I have solved it somehow by coping another curl that actually works.

So here comes another issue:
I want to read this xml file and schedule API flow based on the data in side the file.

Do I need to convert it or can I read it somehow via bubble.io?
As the file should have very strict syntax which doesn’t differ much one from another.

** this one simple issue already has a few topics, on forum, that’s crazy**

I already provided you the solution. Use API connector to fetch the xml file. Bubble will parse it. In API connector, in url forld, you just need to set [url] and dynamically fill this field fron backend WF file.

Thanks @Jici.

I didn’t understand your answer at the first time, thou I still cannot properly do it.

So I have a webhook that receives a file and then I am doing another API call where I send the file’s URL and expect Text? Or this API should expect a file and later I extract it’s URL?

As in both cases I do not receive the file’s content. I just get the file URL as a string.

The starting point for me is - that I already have a file from the webhook received and saved in my database.

Thanks for being supportive :slight_smile:

you first need to initialize the API connector. Use one of the file URL you have in your DB.

1 Like

OMG that… is… literally… awesome!
Thanks!

1 Like