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

Properties

Connection

Type: Connection Input
The Connection Property

SwaggerUrl
Type: String
The URL to the Swagger document, for example https://petstore.swagger.io/v2/swagger.json

AuthType
Type: List
Provides the authentication type to be used.

None - No authentication will be provided
Basic - The Authorization header will be passed the value Basic followed by the Base64 encoded value of Username:Password
Bearer - The Authorization header will be passed the value Bearer followed by the value specified in AccessToken

SiteUrl
Type: String
The base URL for the REST API

Username
Type: String
The username to be used when AuthType is set to Basic

Password
Type: Password
The password to be used when AuthType is set to Basic

AccessToken
Type: Password
The token to be used when AuthType is set to Bearer

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

OperationId

Type: String Input
Contains the ID of the operation chosen from a Node Sample. This property shouldn't be manually changed.

Description

Type: String Input
A generated description of the operation based on what was available in the Swagger document.

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.

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.

ResponseHeaders

Type: Multiline Text Output
Contains the response headers as received from the API Server.

ResponseCode

Type: Type: String Output
Contains the response code returned from the API Server. 200 = Success etc.

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 and Password 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 by SwaggerUrl
  • 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 https://flowgear.me/#s/oGmiukg for an example.