How to pass XML content when calling an External API

Options

The attached file "bpack 24h … No options.txt" contains sample XML content that I would like to pass in the external API request below.

Unfortunately I don't have a clue how to do it. Moreover, I have not found anything useful in the discussions.

Tagged:

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    How do you want to pass it in the API call? If there is documentation for the API you're using, perhaps you could share it?

  • AMDS Web Agency
    Options

    Here is the documentation: https://bpost.freshdesk.com/helpdesk/attachments/4132775081

    Please refer to page 23 (Create order API).

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    If you have the XML as a string, you can add it to the "params" in the external API request directly because that will set the body of a POST.

    So the key next question is: where does the XML string come from? Is it uploaded as a file reference by a form? Does it exist on some other HTTP endpoint that needs to be downloaded? Are you creating it in the function stack from a template?

  • AMDS Web Agency
    Options

    Indeed, I want to create xml string from a template. The injected data would come from the database in xano.

    Could you please point me to online resources so that I can work out a solution?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    I don't know of a blog post or what have you with the answer, but this is a great candidate to bring to Xano office hours. Their next one is 8pm EDT (0000 Wednesday GMT).

    I also run State Change, a program with daily office hours where we focus exclusively on the hardest 5% of challenges. Lots of Xano customers in our group, and Xano questions in the mix, because Xano is often where the hardest part of the initiative lives. Our next session is 7a EDT (1100 GMT) tomorrow.