REST API adapter

A REST API adapter provides access to services that provide a REST API. After you have successfully configured the REST API adapter, eShare displays the document tree, document list, and document metadata provided by the target service.

The REST API adapter gets information from REST APIs that provide JSON data, and supports different authentication schemes.

Configuring a REST API adapter requires expert-level IT skills, programming experience, and solid experience in eShare administration. To be able to configure a REST API adapter, you need to be familiar with the REST API concept, the principles how REST APIs work, and JSON. You also need to understand the service for which you are configuring the adapter, and be familiar with configuring data sources in eShare.

The REST API adapter works as follows:

  1. The user selects an object that is linked to an external service that supports the REST API.
  2. eShare sends the request to the external service. The request contains the HTTP method and URL, and if required, customized headers and a body.
  3. The external service processes the request.
  4. The external service sends eShare an HTTP response. The response contains a header and a body.
  5. eShare parses the response.
  6. eShare shows the response to the user.

eShare's REST API adapter allows you to test the configuration while you create it.

To configure a REST API adapter:

  1. Create the REST API adapter.

  2. Add the data source. A REST API adapter must have one or more data sources. The data source type depends on the needs of the project.

  3. Test the configuration.

Prerequisites

Familiarize yourself with the target system and its REST API documentation. When you configure the REST API adapter, you need to enter information from the target system. This information is system-specific and project-specific, therefore this documentation cannot provide specific guidelines.

Creating a REST API adapter

Do the following:

  1. Navigate to the project to edit, and then click Project Admin in the main menu. The project administration view opens.

  2. Click Adapters and Data Sources. The Adapters and Data Sources configuration view opens.

  3. Click Add.

  4. In the Available Adapter Types section, select REST API Adapter, and then click Create adapter.

  5. In the Adapter section, enter a name and description (optional) for the adapter, and specify whether the adapter should be enabled.

  6. In the Adapter Configuration section, specify the following settings:

    • REST API base URL – Enter the URL of the system to which the REST API adapter should connect.

    • Authentication method – Define the authentication method for accessing the service.

      • None – The user can access the service without providing any credentials.

      • Basic – Define a custom username and password. You can define only one set of credentials, that is, the credentials are not user-specific but all users use the same username and password.

      • Windows – The user can access the service with his or her Windows credentials. If you use Windows authentication, define also if client impersonation is enabled or disabled. If you enable impersonation, the credentials are user-specific. If you disable impersonation, the system will use the Internet Information Services (IIS) identity. Note that not all systems support client impersonation.

      • Windows (custom) – Define a custom username and password that work in the domain. You can define only one set of credentials, that is, the credentials are not user-specific but all users use the same username and password.

    • Use Authentication Request – Authentication requests are needed for session-based services. If set to Enabled, select Auth Type.

      • If you select Generic, the request to be sent must be configured with the following settings:

      • If you select OAuth, the request to be sent must be configured with the following settings:

  7. Click Save.

Creating a REST API adapter data source

Add a data source to a REST API adapter to enable the adapter to retrieve specific type of data from the target system. You can define one or more data sources depending on the project needs.

Do the following:

  1. Navigate to the project to edit, and then click Project Admin in the main menu. The project administration view opens.

  2. Click Adapters and Data Sources. The Adapters and Data Sources configuration view opens.

  3. On the Adapters list, click the REST API adapter to which to add the data source.

  4. In the Data Sources section of the adapter settings, click Add data source.

  5. In the Available Data Source Types section, select the data source type to use:

    • REST API Document Data Source – to retrieve documents from the external system.

    • REST API Categorization Data Source – to retrieve categorization data, for example, to categorize objects according to their construction status (purchased/delivered/installed) or risk level (low/medium/high). The categories have been defined and are maintained in the external system.

    • REST API Object Attributes Data Source – To display retrieved data in object attributes in the Model view.

  1. Click Create data source, and specify the data source-specific settings.

  2. Click Save.

Related Topics

Configuring REST API document data source

Configuring REST API categorization data source

Configuring REST API object attributes data source