What is the Task?

In the API Integration module, the integration process with each system or application is called a task.

Apinizer has not adopted defining a task/connection type for each of the endpoints that can be called with the API, as it adopts to make integrations with API calls as much as possible.

That's why there are14 different tasks on Apinizer:


The picture below shows the task selection:


Common Fields in Tasks

When creating a task there are some input and output fields that are the same for each type. This information is the selected fields in the image below.


The fields used for configuring common information in tasks are shown in the table below.

FieldDescription

Execute This Task For

The type of how the result produced from the previous task will be run in the current task is selected. A process is produced by using the run result in the relevant field in the task.

  • Once: The current task is run once.
  • Loop: The current task is run in a loop with the definition to be specified on the result from the previous task. Therefore, the data type for the result of the previous task must be an array. The longer the array, the more it is run in the current task.

This option is active if the task operation type is selected as loop. The result of the value given with JSON Path/XPath is run as a loop.

Apinizer Sythax

Bu alandaki kritik nokta değerin Apinizer'ın söz dizimine uygun yazılmasıdır. Bu kuralda dikkat edilmesi gereken 2 unsur vardır.

Sythax 1: Veriyi sorgulama

Syntax rules;

  • It should be opened and closed with 2 curly brackets.
  • The first part of the syntax is called the output key of the previous task. The # sign is placed at the end.
  • In the second part of the syntax, the value to be taken from the output value is written with one of the query languages (JSONPath, XPath) of the data type.

Let's look at the formula of the syntax;

{{previous-task-output-name#<this-part-is-written-in-JSONPath-or-Xpath-format>}}

Let's examine an example syntax;

  • In one of the previous tasks, a result named centralRates is produced. The values of the result include the exchange rate information of the Central Bank.
  • The query /Date/Currency is written with XPath to get the elements in the array contained in this result one by one.

{{centralRates#/Date/Currency}}


Sythax 2: Using loop data in task

Elements taken from the data with syntax can be used in the task (sending mail, processing database, writing scripts, etc.). To be able to use it, it must be referenced with the variable key named LOOP_VARIABLE.

Let's look at the formula of the syntax;

{{LOOP_VARIABLE#<this-part-is-written-in-JSONPath-or-Xpath-format>}}

Let's examine an example syntax;

{{LOOP_VARIABLE#/Currency/Name/text()}}

The detailed example usage is explained on the API Integrator Scenarios pages.

If the operation fails, then continue

This option is active if the task operation type is selected as Loop.

If an error occurs while executing the actions in the loop, the process is governed by which the task must continue running or be stopped immediately.

Output Keys

The list of output key created in previous tasks appears. Thus, it can use the output key here in the job definition inputs.

Output Key

The variable name to which the value that will be created when the task is run will be assigned is entered. Tasks after this task will use the output key entered in this field if they want to process the output of this task.

  • No spaces should be left in the output key.
  • Output key names must be singular in the defined flow.

Name

Write the name of the task. This information is assigned as the value of the {{taskflow.name}} variable. Therefore, when this variable is written to the other input field and run, the value of the variable will appear in the relevant output.

Description

A description of the task is written.