application/json
or application/x-www-form-urlencoded
payloads. RESTAPICLIENT will then receive and process the response from the external API by mapping the response content with defined OUT parameters.APP_URL
parameter, which corresponds to the REST API endpoint.
APP_REQUEST_CONTENT_TYPE
) is application/json
. application/x-www-form-urlencoded
is also supported.
APP_METHOD
) is GET
. Other request methods (POST
, PUT
, DELETE
, etc.) are also supported.
APP_RESPONSE_IGNORE_ERROR
OUT parameter is defined and has Y
as its value, the error will be ignored and defined OUT parameters (APP_RESPONSE_STATUS
or APP_RESPONSE_CONTENT
) will be mapped. Otherwise, an exception will be thrown.
RestApiClientRequestTimeout
parameter value in the web.config
file. The request timeout can also be defined in the APP_TIMEOUT
IN parameter; the maximum timeout is 3,600,000 milliseconds (1 hour).
APP_HEADER_xxx
parameters, where xxx
is the header field name. For more information, see the Header parameters section.
APP_REQUEST_CONTENT_FILE
or APP_REQUEST_CONTENT
IN parameters. When both parameters are defined, the APP_REQUEST_CONTENT_FILE
parameter has priority. For more information on these parameters, see the Request payload section.
APP_RESPONSE_CONTENT_FILE
or APP_RESPONSE_CONTENT
OUT parameters. Both parameters can be defined at the same time. For more information on these parameters, see the Response payload section.
RestApiClientLogLevel
parameter value in the web.config
file to 0
to disable logging (default), 2
for simple logs, or 3
for debug logs.
RestApiClientMaxResponseLength
parameter value in the web.config
file.
RestApiClientEnableFilesCleanUp
parameter value to N
in the web.config
file; the default value is Y
.APP_URL
APP_TIMEOUT
RestApiClientRequestTimeout
parameter value in the web.config
file.APP_METHOD
GET
. Supports POST
, PUT
, DELETE
, HEAD
, PATCH
APP_REQUEST_CONTENT_TYPE
application/json
and application/x-www-form-urlencoded
); the default is application/json
.APP_RESPONSE_IGNORE_ERROR
Y
, the application will ignore the error when a WebException
occurs or the external API returns a response status equal to or greater than 300
; the default is N
.APP_URL
optional parametersAPP_URL_xxx
xxx
is the URL parameter nameAPP_URL
parameter value between brackets (e.g. APP_URL_subscriptionId
for the URL https://management.azure.com/subscriptions/{subscriptionId}
)APP_URL
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}
APP_URL_subscriptionId
457a2a46-7a7f-4afa-940d-8779e1425fa8
APP_URL_resourceGroupName
dev-group-advantys
APP_URL_topicName
dev-topic
APP_URL
:APP_HEADER_xxx
xxx
is the header field nameAPP_HEADER_Authorization
Bearer AbCdEf123456
APP_HEADER_location
canadaeast
APP_HEADER_xxx
parameter name.APP_AUTH_BASIC_USERNAME
APP_AUTH_BASIC_PASSWORD
APP_AUTH_BASIC_USERNAME
parameterAPP_AUTH_BEARER_TOKEN
APP_AUTH_AZ_SAS_TOKEN
APP_AUTH_BEARER_TOKEN
is equivalent to defining the header parameter APP_HEADER_Authorization
.application/json
nor application/x-www-form-urlencoded
. You can set this request payload in a file/text data or directly in the text value.APP_REQUEST_CONTENT_FILE
APP_REQUEST_CONTENT
APP_REQUEST_CONTENT_FILE
has priority over APP_REQUEST_CONTENT
.
APP_REQUEST_CONTENT
has priority over IN parameters used to build a JSON or an URL encoded payload.application/x-www-form-urlencoded
as content type.param1
value1
param2
value2
param1
value1
param2
value2
APP_REQUEST_CONTENT_PAYLOAD_NAME
payload
APP_REQUEST_CONTENT_PAYLOAD_NAME
parameter is only supported with the application/x-www-form-urlencoded
request content type.application/json
as content type.person.address.street
160 Guy Street
person.address.zipcode
J4G 1U4
person.age
30
person.name
John
APP_REQUEST_CONTENT_IS_ARRAY
parameter value to Y
.APP_REQUEST_CONTENT_IS_ARRAY
Y
, the application will convert the JSON request payload into an array; the default is N
APP_REQUEST_CONTENT_IS_ARRAY
parameter to Y
will generate the following request payload:__JSON
suffix parameter sections below.person.spokenlanguages
) followed by the __X
suffix, where X
is the array index number.person.spokenlanguages__0
french
person.spokenlanguages__1
english
person.spokenlanguages__2
chinese
"spokenlanguages": [{"spokenlanguage":"french"}, {"spokenlanguage":"english"}]
) into a JSON property, see the next section.person.spokenlanguages__9999
).
person.spokenlanguages__90
, person.spokenlanguages__30
). The __30
parameter value will be the first array parameter, and __90
the second one.
person.spokenlanguages
and person.spokenlanguages__0
).
__X
suffix uses two underscore characters.
__JSON
suffix parameterperson.children
) followed by the __JSON
suffix with the JSON object/array as the parameter value.person.children__JSON
[{"name": "child 1"}, {"name": "child 2"}]
person.children
and person.children__JSON
).
__JSON
suffix uses two underscore characters.APP_RESPONSE_STATUS
APP_RESPONSE_CONTENT_TYPE
APP_RESPONSE_CONTENT_FILE
APP_RESPONSE_CONTENT
APP_RESPONSE_CONTENT_IS_ARRAY
Y
if the JSON payload is an arrayapplication/json
content type responses.person.address.street
DATA_STREET
person.address.zipcode
DATA_ZIPCODE
person.age
DATA_AGE
person.name
DATA_NAME
|
(using the APP_JSONPATH_DELIMITER
IN parameter). To get this information, the following parameters must be defined:APP_JSONPATH_DELIMITER
|
PARAM1__JSONPATH
person.children[?(@.name == 'Charles')].children[*].children[?(@.age > 7)].name
DATA1_VALUE
(value will be: George|Charlotte
)PARAM1__JSONPATH
parameter name, the PARAM1
name is not relevant but it must be followed by the __JSONPATH
suffix (two underscores are used in the suffix).
APP_JSONPATH_DELIMITER
is a comma (,
) when this parameter is not defined.GET_TOKEN
action: Obtaining an OAuth 2.0 access tokenaccess_token
OUT parameter and will be used when creating an Event Grid topic in the next section.APP_URL
https://login.microsoftonline.com/{tenandId}/oauth2/token
APP_URL_tenantId
a6e70c61-fabd-4885-89f7-97121e92db7f
APP_METHOD
POST
APP_REQUEST_CONTENT_TYPE
application/x-www-form-urlencoded
grant_type
client_credentials
client_id
b7e29e2f-6e2b-4375-9684-8151431d4ca6
client_secret
lxy/IwKyTedHUWMeeUtyCtu7/YUy0rNGoY3NNWXXotI=
resource
https://management.core.windows.net/
access_token
DATA_ACCESS_TOKEN
access_token
OUT parameter is mapped with the access_token
JSON property.CREATE_TOPIC
action: Creating an Event Grid topicAPP_URL
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}?api-version={api-version}
APP_URL_subscriptionId
235765d9-5d62-43f4-a730-2ed71a3f8adb
APP_URL_resourceGroupName
dev-group-advantys
APP_URL_topicName
new-topic-example
APP_URL_api-version
2018-09-15-preview
APP_METHOD
PUT
APP_REQUEST_CONTENT_TYPE
application/json
APP_AUTH_BEARER_TOKEN
DATA_ACCESS_TOKEN
location
canadaeast
Could not create SSL/TLS secure channel
error, strong encryption must be enabled by executing the following code in PowerShell: