REST Request
Consumes an Open API (formerly Swagger) definition to provide integration into REST API's.
Revision History
1.0.0.4 Initial Preview Release
1.0.2.2 First GA release
1.0.4.0 Added available enum options to samples
2.0.0.0 Added OpenAPI Support as well as ResponseHeaders
and ResponseCode
properties
2.0.0.1 Added ExcludeEmptyQueryParameters
property on Connection to signal that empty query parameters should not be included in the URL
2.0.0.5 Fixed bug where Test incorrectly reported an error
3.0.0.0 Improved sample handling
4.0.0.2 Fixed multiple OpenAPI definition parse issues
Properties
Connection
Type: Connection Input
The Connection Property
OpenApiUrl
Type: String Input
The URL to the OpenAPI (formerly Swagger) document. This is typically https://servicedomain.com/openapi.json
or https://servicedomain.com/openapi.yml
. Provide either OpenAPIUrl
or OpenApiDocument
.
OpenApiDocument
Type: Multiline Text Input
A document containing an OpenAPI document. This is useful for cases where the OpenAPI definition is not published with the service you are connecting to. Provide either OpenAPIUrl
or OpenApiDocument
.
Url
Type: String Input
The Url to the service you wish to invoke. This Property can be left empty if the OpenAPI definition provides defines the URL of the server.
AuthType
Type: List Input
The AuthType Property
- None - No auth information will be included (you may still manually provide auth data via the
Headers
Property). - Basic - A
Basic
Authorization header will be provided using theUsername
andPassword
Properties. The value following theBasic
keyword will be the Base64 encoding of `:. - Bearer - a
Bearer
Authorization will be provided usingAccessToken
.
Username
Type: String Input
The Username when AuthType
is set to Basic
.
Password
Type: Secret Input
The Password when AuthType
is set to Basic
.
AccessToken
Type: Multiline Text Input
The Access Token when AuthType
is set to Bearer
.
ReturnRestFailureResponses
Type: Boolean Input
When true, failure response information will be returned via the Node output Properties. When false, a failure will cause the Node to generate an error.
ExcludeEmptyQueryParameters
Type: Boolean Input
When true, query parameters that do not have a value will be included in the request URL. When false, they will be included.
OperationId
Type: String Static
Contains the ID of the operation chosen from a Node Sample. This property shouldn't be manually changed.
Description
Type: String Static
A generated description of the operation based on what was available in the Swagger document.
Headers
Type: Multiline Text Input
Any custom-custom headers can be passed in to this property. Headers can be composed using the Formatter Node and should be formatted one per line with the notation header-name:header-value
Request
Type: Multiline Text Input
Contains the request payload (usually JSON) that provides the detail of the operation to perform. A sample value for this property is populated when a Node Sample is selected.
ResponseCode
Type: String Output
Contains the response code returned from the server. 200 = Success etc.
ResponseHeaders
Type: Multiline Text Output
Contains the response headers as received from the server.
Response
Type: Multiline Text Output
Contains the response payload (usually JSON) as received from the API. Where possible, a sample value of this property is populated when a Node Sample is selected.
Custom Inputs
This Node supports Custom Input Properties and the appropriate properties will be added to the Node when a Node Sample is selected. These Properties are resolved into parameters in the URL that is generated for the request. For example, if the operation will query a customer record, the Swagger document may specify the URL template as /customers/{customerId}
. In this case, a Custom Property called customerId
will be added to the Node when a "get customer" Node Sample is selected.
Remarks
Setting up a Connection
- Provide the URL to the Swagger document in the
SwaggerUrl
field. Ensure this field is returning a JSON payload by using the same url in your browser and inspecting the content. - Select your authentication type under
AuthType
. If you need to dynamically obtain a token for authorization or need to add additional custom HTTP headers, do this on the Node design rather than in the Connection Pane. - Provide the base URL to the API that you are connecting to in the
SiteUrl
property. - If you are using Basic Authentication, fill in the
Username
andPassword
properties. - If you are using Access Tokens, provide the token in the
AccessToken
field. - Click
Refresh Metadata
to obtain the cache operations defined in the Swagger document pointed to bySwaggerUrl
- Save and Test the connection.
Using Query String Parameters
When selecting samples that support query string parameters, the Node will be populated with Custom Properties such as conditions
and orderBy
. Providing values on these properties will cause them to be incorporated into the request URL that is generated.
Example
See this Sample Workflow for an example.