SELECT.API
This command supports sending HTTP(S) requests, e.g. to a remote API and retrieve the response into a binary stream for further processing within the Action.
The command is introduced in Perfion 2023-R2.
Properties
From | The From argument must specify a URI and optional the authentication settings for the endpoint to call. The From argument supports either a simple URL, a reference to a Remote Connection String or a variable containing the connection string parameters. Please refer the URL Connection String section for more details. |
To | The command returns an instance of PHttpClientResponse containing resulting HTTP status code (e.g. 200 for OK), response headers, and the response content in a PBinaryStream. |
Script | The Script argument must contain the body of the request. The Script argument is optional. |
Parameters
@RelativeUrl | The connection string as specified by the From argument, can be used to identify a base URL. The RelativeUrl parameter can then be used to further specified the final URL. This parameter is optional. Default is empty. |
@Method | Specifies the HTTP verb, e.g. GET, POST, PUT, PATCH, to use in the request. This parameter is optional. Default is ‘GET’ |
@ContentType | Specifies the content type of the body, e.g. text/xml, being sent in the request. This parameter is required if the Script argument is not empty, meaning the request will include content. |
@CommandTimeout | Specifies the request timeout in seconds. This parameter is optional. Default is 100 seconds. |
@RetryPolicy | Specifies the retry policy to use. Retries can be disabled by choosing ‘None’.
This parameter is optional. Default is ExponentialInterval |
@RetryCount | Specifies how many retries the command should make, before returning an error. This parameter is optional. Default is 3. |
@RetryInterval | Specifies the interval - or waiting time - between retries. Note that depending on the chosen RetryPolicy, the waiting time may be exponentially longer than specified here. This parameter is optional. Default is 1000 milliseconds (1 second). |
@ThrowIfNotSuccessful | Indicates is the command should throw an error if the response from the remote server does not indicate a success (e.g. a status code 200). If set to false, the command will return a response containing any information returned by the remote server. This parameter is optional. Default is true |
Map headers
From | Value to the header. |
To | Specifies additional HTTP headers to include in the request. Prefix the header with Header-<header-name> If the connection string includes authentication, the command will automatically add the Authorization header. |
Connection string
The SELECT.API command require an URL and optionally some authentication settings, to identify where to send the request. The command supports several different authentication schemes as described below
The connection string can be specified either ..
directly in the From argument
by referencing a Remote Connection (@RemoteConnectionName=<Remote connection name>)
by referencing a properly initialized variable within the Action.
Common for these options are that the URL needs to be configured as described in one of the following sections
Simple URL
In the simplest example, the connection string can be just a URL, or more specifically it can use the URL parameter
https://example.com/some-endpoint
URI="https://example.com/some-endpoint"
Basic authentication
The basic authentication scheme uses a username and password for authentication
URI="https://example.com/some-endpoint";
AuthType="Basic";
UID="user";
PWD="password";
Bearer Token authentication
The BearerToken scheme uses a pre-defined, typically long-lived, bearer token for authentication.
OAuth Client Credentials authentication
The OAuth ClientCredentials scheme uses a client application id and a secret to authenticate. The SELECT.API command supports both Generic and Microsoft Azure token providers.
Generic provider
Microsoft Azure (Entra ID)
OAuth Resource Owner Password Credentials
The OAuth Resource Owner Password Credentials (ROPC) scheme uses a simple username and password for authentication. The SELECT.API command supports both Generic and Microsoft Azure token providers.
Generic provider
Microsoft Azure (Entra ID)
Examples
Downloading a file/image
Call Perfion SOAP API
Â