Portal API
Incoming Webhooks
The request shown here is used to start tasks from external systems.
Its operation proceeds as follows. The portal receives the webhook after which it passes it to the job which the runner retrieves, as the webhook was passed from the very beginning therefore the executed script has access to the data passed by the webhook.
Creating webhook
To create a webhook you must edit the workflow in which you want to add it. Once there, you need to find the triggers section and then select Add trigger -> Webhook there.

Then you enter the name of the webhook you are creating and any parameters if you need them. Once you have done that click save, and the webhook has been created!

Running webhook
After creating the webhook, you may notice that a link has been generated that you will use to run the job from an external source.
To run the webhook send a request to this address, if you want you can also add various parameters that will appear in the body of the job but it is not required. Below is shown an example in which one parameter was sent.
Handling webhook
To get to the parameters sent in the webhook you need to get yourself the data of the whole job, which you can get to by the environment variable (ANYROBOT_PAYLOAD_FILE) that points the path to the payload file. Feel free to check the documentation related to runner environment variables to learn more about this topic.
Below is a small example of how to access the payload and what a sample payload looks like with the parameters sent in the webhook:
Attachments
Attachments are elements that mainly appear in Job Results and Assist Requests.
They come in several types, but the fields are always similar:
genre - a type of attachment.
name - the name of the attachment.
code - code that is url-friendly - used to group the same attachments in the
electrical_parameters_voltageseriesbody - the body of the attachment, varies depending on the type
Currently available are the types listed below.
Text
Text object, displayed in an iframe in Portal.

HTML
HTML object, displayed in an iframe in Portal.

File
File, of any type. The body field is encoded according to RFC2397, and has a format like this:
data:<content-type>;base65,<base64 encoded content>

Table
Data in the table is encoded in base64 format, similar to the example above, the uploaded file is a CSV file, and we also support markdowns.

KPI
Your key performance indicator.

Job results
It is a request to change the status of a job.
Their structure is as follows:
genre -
successorfailureis sent at the end of the process,updatewhile the script is running.code - here Linux-standard - the error code returned by the script, 0 when success, anything over when not.
result - what the script threw out.
attachments - according to the documentation here Attachments.
Currently, we can change the work status to 3 different types, and these are:
Update
Such information comes out from the bot during Job execution, can come down many times and we display it in the user panel.

Success
Failure
Assist Request
In some advanced cases, human intervention may be needed, and for these cases, we have this request that allows you to ask several types of questions.
The basic request should look like this, the different types will be described below.
Text input

Yes/No

Radio buttons

Checkboxes

List

Last updated