REST API

1. Basic Parameters

To connect a REST API as a Data Source, fill in the following parameters (Image 1):

2. Schema

  1. Add in your applicable columns (Image 2). Review the documentation here for information on the column types available.

3. Other Sections

You can add in other sections by selecting the "Add a Section" drop down, and selecting from the list (Image 3). Note that a pagination block is mandatory.

3.1 Auth Request

You can add in an Auth Request (Image 4) by reviewing the documentation here.

3.2 Request Headers

You can add in Request Headers (Image 5) by reviewing the documentation here.

Cinchy v5.5 added an Authorization header type for REST API data syncs in Connections. An authorization request header can be used to provide credentials that authenticate a user with a server, allowing access to a protected resource. Selecting this header defines the Header Value as a password field.

3.3 Body

You are able to use this section to add body content (Image 6):

3.4 Pagination

A pagination block is mandatory (Image 7). Review the documentation here for more on pagination blocks.

4. Retry Configuration

Cinchy v5.5 introduced the Retry Configuration for REST API targets. This will automatically retry HTTP Requests on failure based on a defined set of conditions. This capability provides a mechanism to recover from transient errors such as network disruptions or temporary service outages.

Note: the maximum number of retries is capped at 10.

To set up a retry specification:

  1. Under the REST API source tab, select API Specification > Retry Configuration

2. Select your Delay Strategy.

  • Linear Backoff: Defines a delay of approximately n seconds where n = current retry attempt.

  • Exponential Backoff: A strategy where every new retry attempt is delayed exponentially by 2^n seconds, where n = current retry attempt.

    • Example: you defined Max Attempts = 3. Your first retry is going to be in 2^1 = 2, second: 2^2 = 4, third: 2^3 = 8 sec.

3. Input your Max Attempts. The maximum number of retries allowed is 10.

4. Define your Retry Conditions. You must define the conditions under which a retry should be attempted. For the Retry to trigger, at least one of the "Retry Conditions" has to evaluate to true.

Retry conditions are only evaluated if the response code is not 2xx Success.

Each Retry Condition contains one or more "Attribute Match" sections. This defines a Regex to evaluate against a section of the HTTP response. The following are the three areas of the HTTP response that can be inspected:

  • Response Code

  • Header

  • Body

If there are multiple "Attribute Match" blocks within a Retry Condition, all have to match for the retry condition to evaluate to true.

Note that the Regex value should be entered as a regular expression. The Regex engine is .NET and expressions can be tested by using this online tool. In the below example, the Regex is designed to match any HTTP 5xx Server Error Codes, using a Regex value of "5[0-9][0-9]". For Headers, the format of the Header string which the Regex is applied against is {Header Name}={Header Value}, e.g. "Content-Type=application/json".

Last updated