Notifications: Callout

Knowledge Center > Workflow > Workflow Tasks > Notifications: Callout

Notifications: Callout

The callout task sends an HTTP request to a specified API endpoint. The data in the response can be used in downstream tasks of the workflow. 

The callout task supports the following HTTP methods:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE
  • CONNECT
  • OPTIONS
  • TRACE

The data returned from a callout task is added to the workflow data payload. The data can be referenced in subsequent tasks with a Liquid statement in the following format:

{{Data.Callout.<Data_Field>}}

The data will also be available for selection in data payload lists in subsequent tasks.

If a workflow contains multiple callout tasks, the returned data is stored as an array of records. A particular record can be referenced in the format of Data.Callout[number].<Data_Field>, where the number is the sequence of the record in the array. You can use the Swimlane to find out the workflow data payload that is fed into each task. 

For example, you can use Data.Callout[0].CATALOG to reference the data field highlighted in this screen capture.

workflow_callout_payload.png

Task Use

You use the callout task to establish communication and transfer data between Zuora and other systems.

You can also use the callout task to perform operations that are only possible with Zuora APIs. 

For example, you can create, update or delete multiple records of the same object in a single callout task. To do so, you need to perform a callout to the object update operation and include the array of records in the request body. You can use an iterate statement in Liquid to iterate the array in the request body. 

Here is an example request body for updating the Notes field of multiple accounts in Zuora with the data in the payload.

{
  "objects": [
  {% for account in Data.Account %}
    {
      "Id": "{{account.Id}}",
      "Notes":"{{account.Notes}}"
    }{% if forloop.last == false %} , {% endif %}
  {% endfor %}
  ],
  "type": "Account"
}

Task Settings

Headers

You can use the Zuora system constants or your own constants to refer to endpoints and credentials for Zuora and other systems. To learn about how to define a constant, see Global Constants of Workflow. For the available Zuora system constants, see the following table.

You need to wrap constants with double curly brackets.

Zuora Constants for Endpoints and Credentials Description
Credentials.zuora.username The username used in Workflow installation
Credentials.zuora.password The password used in Workflow installation
Credentials.zuora.url The SOAP API endpoint
Credentials.zuora.session The session ID of the Workflow instance
Credentials.zuora.entity_id The API entity ID of the Workflow instance
Credentials.zuora.rest_endpoint The REST API endpoint:  https://rest.zuora.com/v1/

Body

Only raw data is supported in the body of the callout task. You can use Liquid statements in the body.

Authentication

You select the authorization type and specify details in the Authentication tab. Zuora recommends that you use OAuth 2.0 to authenticate to the Zuora REST API. 

When sending callouts to Zuora, you can select zuora as the authorization type to use the credentials of you Zuora tenant. When this option is selected, you do not need to specify Zuora credentials in the header.

Response

If Zuora API Validation is selected, Workflow will retry a failed request in the case of API limit being reached, lock issues, or temporary errors.

Last modified

Tags

Classifications

(not set)