API Call logic
  • Updated on 16 Oct 2019
  • 2 minutes to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

API Call logic

  • Print
  • Share
  • Dark
    Light

You can integrate with any API which supports formats:

  • JSON
  • XML
  • SOAP

api_call

Nodes that are marked with grey square are added automatically to handle errors that occur when API is called.

URL API

api_call_URL_API

  • URL - URL to retrieve data

  • Request format - request format

    • Corezoid - request to API in corezoid format
    • Default - gives possibility to select HTTP method of request to API
  • Request method - GET, POST, PUT, DELETE, HEAD, PATCH

  • Content-Type - defines what data format is being transferred in API request:

    • application/json
    • application/x-www-form-urlencoded
    • application/xml
    • text/xml
    • application/soap+xml

Parameters

Key-Value

api_call_parameters

Key (parameter name) = Value (parameter value)

+ Add "key-value" - button to add new key-value pair

Value may contain:

  • constant
  • {{parameter_name}} from task which value will be passed. If parameter contains array or parameter's name is specified incorrectly - empty value will be passed
  • {{root.task_id}} - task ID (generated by the system)
  • {{root.ref}} - task reference
  • {{root.conv_id}} - process ID
  • {{root.node_id}} - node ID
  • {{root.prev_node_id}} - previous node ID
  • {{root.create_time}} - task creation time in unixtime
  • {{root.change_time}} - time of task modifying in unixtime
  • {{root.end_time}} - dynamic time of timer work (for example, if you need timer to work at 8 AM)
  • {{root.user_id}} - user ID (who modified the task for the last time).

Code editor

api_call_parameters_code_editor

Adding request parameters as JSON object (key-value pairs):

editor_code

Additionally

Header parameters

api_call_header

Adding parameters to header of HTTP request in "key-value" format.

Customize the response parameters

Allows to get access to header and body parameters:

api_call_customize

Response format - defines type of the reply from API:

  • Default
  • application/json
  • application/x-www-form-urlencoded
  • application/xml
  • text/xml
  • application/soap+xml

+ Add "key-value" - add other parameters from reply

Limit the number of simultaneous requests to the API

api_call_threads

Maximum amount of the number of simultaneous requests to API.

By default = 5.

Send system parameters

Enable this flag if you want to add system parameters to request URL.

api_call_send_sys

For example,

http://api.openweathermap.org/data/2.5/weather?q=london&units=metric&conv_signature={{conv_signature}}&conv_time={{conv_time}}&conv_id={{conv_id}}

conv_signature - key generated in the node with API logic. It is a unique value and is formed according to "Protocol description" section.

conv_time - request time (unixtime) in seconds (epoch time), Greenwich (GMT+0), integer, required parameter.

conv_id - process ID.

Debug info

api_call_debug

Enable this flag to add to the task a runtime of HTTP request to API in milliseconds. This value contains parameter {{__conveyor_api_debug__.http_exec_time}}.

Sign the request by secret key

api_call_sign_request

Enable this flag if there is a key to sign the API request formed as signature.

Sign the request by certificate

api_call_srtificate

Enable this flag to sign API request by certificate:

-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----

Alert when there is tasks queue

The critical number of tasks in the node or the tasks limit.

More details about how it works.

Limit the time of the task in the node

Time interval specified in the field Limit the time of the task in the node. After the time expires, the task goes to the specified node.

More details about how it works.

Was this article helpful?