Forum Discussion

LaszloM's avatar
LaszloM
Qrew Trainee
3 years ago

To capture an XML response from an API in Pipelines

Hi All,

  I would like to use a simple Quickbase API (API_ProvisionUser) in a Pipeline and use the  user id included in the response in my subsequent Pipeline steps. Response promised in the API docs:
<?xml version="1.0" ?>
<qdbapi>
   <action>api_provisionuser</action>
   <errcode>0</errcode>
   <errtext>No error</errtext>
   <userid>112248.5nzg</userid>
</qdbapi>
   Is there a way I can parametrize a Quickbase channel API request to get the XML response? Suppose getting my stuff out of the XML text would be somehow possible, but how can I capture the API response? Seems Pipelines does not offer any available new field after establishing this API request step. Or I am doing something wrong...
   Thank You!

------------------------------
Laszlo M
------------------------------
  • Hi Laszlo. It's not very well documented, but the Quickbase API channel actually returns a JSON object that you can easily access with Jinja if you know how. If you make the call in step A of your pipeline, for example, you can access the result with {{a.json.qdbapi.value}}. Give that a try.

    PHILLIP DENNIS
    Principal | Watkyn LLC
    Quickbase Partner
    (954) 900-6690 | hello@watkyn.com
    www.watkyn.com
    Watkyn LLC

    ------------------------------
    Phillip Dennis
    ------------------------------
    • LaszloM's avatar
      LaszloM
      Qrew Trainee
      Thank You Phillip!

      That opened the door and now I'm down the rabbit hole into JSON parsing and JINJA filters....
      I asked for it, I know...

      Thank you so much, just that little piece was what I needed!


      ------------------------------
      Laszlo M
      ------------------------------
      • Hongkunliang's avatar
        Hongkunliang
        Qrew Cadet

        Hi Laszlo,  I have the same situation.  Do you mind to share your code how to get the user id?  Much appreciated! 

        Best regards,

        Hongkun



        ------------------------------
        Hongkun liang
        ------------------------------
    • MalcolmMcDonald's avatar
      MalcolmMcDonald
      Qrew Cadet
      This is a gift -- thank you Phillip!

      ------------------------------
      Malcolm McDonald
      ------------------------------
    • DamonWalls's avatar
      DamonWalls
      Qrew Member
      What would channel/step would come after the Quickbase Make Request channel step that would accept the {{a.json.qdbapi.value}} response?

      ------------------------------
      Damon Walls
      ------------------------------
      • MalcolmMcDonald's avatar
        MalcolmMcDonald
        Qrew Cadet
        For my use, I did another make request as the second request depended on the the result of the first.

        https://xxx.quickbase.com/db/xxx?a=API_SendInvitation&userid={{b.json.qdbapi.userid}}&usertext="Welcome."​

        I can definitely see use cases where you would want to create a record to store the request and result, or update a record with new information etc.

        ------------------------------
        Malcolm McDonald
        ------------------------------