Create a connector for an API

In this topic, you learn how to create a connector for an API.

The API must be correctly defined with both request and response properties. These properties need to match the data the API consumes and returns.

Methods

Example

Get : One record

List : Many records

Get

/people/(peopleId)

Request Parameters:

connectors get request parameters

/people/(peopleId)

Response Body:

connectors get response body

/people

Response Body:

connectors get people response body

/people

Response Body Definition:

connectors get reponse definition

List

/people

Response Body:

connectors list response body

/people

Response Body Definition:

connectors list response body definition

Create the connector

First, select at least one method (different Adaptive Templates need different methods):

connector create definition

Preview is for enabling the preview of the data the Connector supplies within the Adaptive Designer context, when choosing a Connector:

connector preview
NOTE

How to utilize the preview:

  1. Go to Connector.

  2. Select an API connector from the list.

  3. Toggle to edit mode.

  4. Switch to DATA SOURCE mode.

  5. Select the Enable preview option.

  6. Save it.

  7. Go to Adaptive Designer.

  8. Select the New button.

  9. Select the Connector field to show the list of connectors.

  10. Find the connector and select the preview icon.

The sample API connector currently contains some data and should be able to see this data on preview:

Use Generate Field Catalog to automatically create a field catalog based on all the input and output parameters of your chosen API endpoints, that you have defined in the API Designer:

connector generate field catalog

Available fields in the Adaptive Designer

Input, Both and Output defines where they can be used in each of the templates (not all operations will support all parameters).

Example:

Input

Only allows it to be added as a filter/search.

Output

Only allows it to be returned.

Both

Either of these options.

Removing a property from here will stop it from returning that property in the response.

Cleanup Field Catalog should remove any field catalog items that are not currently mapped in the mapping tab, this is because they would not do anything if used in an adaptive application.

You can adjust the names of properties within the edit button of each item, to make the process user-friendly within the Adaptive Designer context.

connector in api namemapping

Modifying the name in the Field Catalog will necessitate replacing the property in the applications it is used within.

Generate mapping

When creating a field catalog automatically, you will also get the option to generate the mapping, this will be ok in most cases, (most notably not if you changed the field catalog field names to be more user-friendly).

In-path properties on API requests are mapped in API connectors.

We generate a mapping between the potentially nested structure of each API operation (response) and the flat structure of the field catalog. The left-hand side is input properties and the right-hand side is output properties. You can manually set values by using drag and drop or the built-in value help and remove them by selecting the eraser icon:

connectors mapping

The drag and drop:

connectors mapping draganddrop

The value help:

connectors mapping valuehelp

Result

With everything set up correctly, the API connector should work just like a standard connector in the Adaptive Designer.