REST (Import)

ConnectIT 365

REST (Import)

The main import flow for REST is the same as the manual process. If you click on the process> Import data button, the REST connection is establised and data is imported. How to import & process is described in Manually (Import) .

The following REST fields are available on the import definition card:

General

Field

Description

Field

Description

URL

Specifies the URL for the REST request. Can be used in combination with temporary values to create a dynamic request URL.

Authorization Type

Specifies the authorization used for the REST request. The following options are available:

  • Anonymous

  • Basic Authorization

  • Bearer Token

  • OAuth 2.0 Client Credential Grant

  • OAuth 2.0 Authorization Code Grant

  • OAuth 2.0 Custom Grant Flow

  • API Key Deprecated, use Custom instead

  • Custom

Using temp values in the URL

If you use temporary values in the definition lines, it is possible to use these in the URL. With the Function SETTEMPVAL you set the value and use the code of the temporary value to replace it with the value from the data. Like in the example below [Customer], the CUSTOMER is the temporary value code and will be replaced with the value in this case customer number.

https://api.idyn.nl/api/v1/basisprofielen/[Customer]?geoData=false

Using parameter values in the URL
In the URL you may want to add parameter values like page no. or for example the ID of an item you want to get details for. In this case you will have to add %i (where i is an integer value) in the URL.
For example, in the below URL, %1 is added for the page no. value:

For more information on working with variable parameters in the URL, alsosee this page: REST Parameter Tasks

Paging

Field

Description

Field

Description

Use Paging

Specifies if paging should be used for this definition. If enabled, the import will check if additional requests are needed to get the import data for all pages.

Paging Method

Specifies the method that is used for paging. The following options are available:

  • Page No.

  • Link

Page No. Element Name

Specifies the element name in the response content where the page number can be found. This is used to determine the next page number.

Position of ‘Page No.’ in URL (%1)

Specifies where in the REST request URL the page number should be placed. Use %1 as substitute variable in the URL.

Total Pages Element Name

Specifies the element name in the response content where the total page count can be found. This is used to determine if there is a next page.

Next Link Element Name

Specifies the element name in the response content where the next URL can be found. Is used with Paging Method Link where the complete next URL is expected in the response.

Paging is avaliable for REST calls with data format JSON or XML. Currently there are two paging methods implemented, being:

  • Page No., where you will have to provide the element names of the Current Page No. and Total Pages.

  • Link, where you will have to provide the element name of the next URL.

Authorization types

Type

Extra fields

Description

Type

Extra fields

Description

Anonymous

 

This is used when no credentials are needed.

Basic Authorization

User Name (or Client-ID)

Specifies the username or client-id.

Basic Authorization

Password (or Secret)

Specifies the password or secret.

Bearer Token

Bearer Token

Specifies the bearer token. If a bearer token should be used, but should also automatically refresh using OAuth 2.0, use one of the OAuth2 authorization types instead.

OAuth 2.0 Client Credential Grant

OAuth2 Authorization Code

Specifies the OAuth2 authorizations code where the OAuth 2.0 grant flow is configured.

OAuth 2.0 Authorization Code Grant

OAuth2 Authorization Code

Specifies the OAuth2 authorizations code where the OAuth 2.0 grant flow is configured.

OAuth 2.0 Custom Grant Flow.

OAuth2 Authorization Code

Specifies the OAuth2 authorizations code where the OAuth 2.0 grant flow is configured.

API Key

-

The API key need to be configured in the Request Headers.

Custom

Auth. Key Name

Specify the key name that will be used for authorization. This key will be added to the request headers. This is used for authorization type Custom.

With OAuth2 authorizations settings it is also possible to configure custom login options that don’t fit into a standard protocol

Custom

Auth. Value

Specify the value for the key name that will be used for authorization. This is used for authorization type Custom.

Request Headers

Field

Description

Field

Description

Key

Key name to include as request header in the REST request.

Value

The value to assign to the request header key.

If applicable, add lines in the request headers part to include additional headers to the REST request.

 

For testing purpose it is possible to test a REST connection by using a mocked server, below 2 examples:

https://my-json-server.typicode.com/  

https://apidocs.apigee.com/docs/mock-target/1/routes

 

IDYN