Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
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>
|
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
Code Block | ||
---|---|---|
| ||
https://example.com/some-endpoint |
Code Block |
---|
URI="https://example.com/some-endpoint" |
Basic authentication
The basic authentication scheme uses a username and password for authentication
Code Block |
---|
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.
Code Block |
---|
URI="https://example.com/some-endpoint"; AuthType="BearerToken"; Token="eyJhbGciOiJIUzI<redacted for brevity>"; |
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
Code Block |
---|
URI="https://example.com/some-endpoint"; AuthType="OAuth:ClientCredentials"; AuthProvider="Generic"; ResourceURL="https://example.com/some-endpoint"; AuthURL="https://example-token-provider.com/oauth2/token"; ClientAppId="b0db83dd-16d9-4ab1-a011-750bfe978c9e"; ClientSecret="b0db83dd-16d9-4ab1-a011-750bfe978c9e"; |
Microsoft Azure (Entra ID)
Code Block |
---|
URI="https://example.com/some-endpoint"; AuthType="OAuth:ClientCredentials"; AuthProvider="Azure"; ResourceURL="https://example.com/some-endpoint"; AuthURL="https://login.microsoftonline.com/contoso.com"; Scope="https://graph.microsoft.com/.default"; ClientAppId="b0db83dd-16d9-4ab1-a011-750bfe978c9e"; ClientSecret="b0db83dd-16d9-4ab1-a011-750bfe978c9e"; |
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
Code Block |
---|
URI="https://example.com/some-endpoint"; AuthType="OAuth:ROPC"; AuthProvider="Generic"; ResourceURL="https://example.com/some-endpoint"; AuthURL="https://example-token-provider.com/oauth2/token"; ClientAppId="b0db83dd-16d9-4ab1-a011-750bfe978c9e"; UID="username"; PWD="password"; |
Microsoft Azure (Entra ID)
Code Block |
---|
URI="https://example.com/some-endpoint";
AuthType="OAuth:ROPC";
AuthProvider="Azure";
ResourceURL="https://example.com/some-endpoint";
AuthURL="https://login.microsoftonline.com/contoso.com";
Scopes="user.read openid profile";
ClientAppId="b0db83dd-16d9-4ab1-a011-750bfe978c9e";
UID="username@contoso.com";
PWD="password"; |
OAuth Refresh Token
The OAuth Refresh Token scheme relies on a long-lived refresh token that may be used for issuing access tokens. The process of issuing a refresh token differ across Identity Providers, so please refer to the documentation for the identity provider used for the integration. The SELECT.API command supports only the Generic token provider for refresh tokens.
Code Block |
---|
URI="https://example.com/some-endpoint";
AuthType="OAuth:RefreshToken";
AuthURL="<OAuth token endpoint URL>";
ClientAppId="<application id>";
RefreshToken="<refresh token>"; |
Examples
Downloading a file/image
Call Perfion SOAP API
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|