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
------------------------------

12 Replies

  • 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
    ------------------------------
    • DonLarson's avatar
      DonLarson
      Qrew Commander

      Phillip,

      I am trying to solve a similar issue.  I am making a Post with the REST API and want to get the RID back for the created record.    The documentation for the new API

      https://developer.quickbase.com/operation/upsert

      shows the RIDs are in a section 

      "metadata": { "createdRecordIds": [ 11, 12 ], "totalNumberOfRecordsProcessed": 3, "unchangedRecordIds": [], "updatedRecordIds": [ 1 ]

      I have been playing with the syntax to get the createdRecordIds and am struggling to get there.   Can you share an example on extracting it?

       

    • PrashantMaheshw's avatar
      PrashantMaheshw
      Qrew Captain

      Huge shout out to Phillip for discovering and posting this. It was a major lifesaver for me to find the RecordID of the item I just created using QuickBase MAKE REQUEST step in pipeline 



      ------------------------------
      Prashant Maheshwari
      ------------------------------
      • Hongkunliang's avatar
        Hongkunliang
        Qrew Cadet

        Hi Prashant,  I have the similar case as yours.  I am using the Make Request to call API "CopyMasterDetail", I'd like to get the parentRid.  Should I directly use the b.json.qdbapi.parentrid  or parsing the b.content?  Thanks in advance! 



        ------------------------------
        Hongkun liang
        ------------------------------
    • 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
        ------------------------------