Using parameterized authorization

Consider a workflow that is triggered by a webhook. When triggered, it creates a new card in Trello and sends the card details through email.

About this task

By using parameterized authorization, you can control which Trello and email accounts are used, based on the parameters received in the webhook request.

Procedure

  1. Retrieve service access token and create object.
    Using your account's OAuth server, create an access token for the service (in this case, Trello) and insert it in the access\_token field of the following mentioned object. It is the standard object to be used for all service actions:
    [ 
      { 
         "auth" : { "access_token" : "9276fb05d973105df631d29894a8b49af8564b85951d121d0ca584a29761d89c" },     
         "actions" : [ "a0" ] 
      } 
    ]

    Here, a0 refers to the Id of the action you want to create a parameterized account for. You can find this Id on the action configuration window.

  2. Next, retrieve an access token for the Gmail service and add it to the object for Gmail service. Add this object below the Trello object.
    [ 
        { 
           "auth" : { "access_token" : "9276fb05d973105df631d29894a8b49af8564b85951d121d0ca584a29761d89c" },     
           "actions" : [ "a0" ] 
        },
    
        { 
            "auth" : { "access_token" : "ya94.GltcBIa387LWmFugL3Zi9m23yslgx4xkaIzeUR6ZeHkYD0ZfcBQdLHi2A" }, 
            "actions" : [ "a1" ] 
        } 
    ]
  3. Encode an object. As you created the object, encode it with Base64 encoding. You can use this online service to encode the object.
  4. Append encoded object to webhook URL.

    After you have encoded the object, you can append it to the webhook URL of the workflow you want to run. Add ?authorizations= to your webhook URL, followed by your encoded object.

    If your webhook URL is https://runflow.built/run/8..., it should look like https://runflow.built/run/8...?authorizations=IFsgDQogICAgICAgeyANCiAgICAgICAgICJ0b2tlbiIgO.... Replace the sample string with your actual encrypted data to dynamically pass authorization details when triggering the workflow.
  5. Run the webhook URL.

Results

When you run the webhook URL, it calls the workflow and replaces the existing accounts with the parameterized accounts.