REST API

1. Basic Parameters

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

Parameter

Value

HTTP Method

GET or POST

API Response Format

Specify a response format of the endpoint

Records Root JSONPath

Specify the JSON path for the results. This path will depend on the format of your response. Example: "$.payload" If the JSON response top-element is an object, $ will refer to the top-element of the response.

If the JSON response top-element is an array, the CLI code will wrap the array in an object. The object will contain the array under member name.

Path to Iterate

Specify the path to Iterate.

API Endpoint URL

API endpoint, including URL parameters like API key

Next Page URL JSON Path

Specify the path for the next page URL. This is only relevant for APIs that use cursor pagination

Image 1: Parameters. (Click to enlarge)

2. Schema

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

Image 2: Schema Columns

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.

Image 3: Other Sections

3.1 Auth Request

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

Image 4: Adding an Auth Request

3.2 Request Headers

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

Image 5: Adding Request Headers

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):

Image 6: Adding in Body Content

3.4 Pagination

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

Image 7: Selecting your type of pagination

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.

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.

Last updated

Was this helpful?