Provide data via API using custom application integration

Provide data via API using custom application integration

An interface is needed to provide project data from Relatics to an external application.

Configure an interface in the workspace*

  1. In the workspace menu, click on Settings - Relatics icon Settings.
  2. Click on the menu Application integration, then Providing data.
  3. Click on  New interface. As a result, the dialog Create interface for providing data to an external application is opened.
  4. For the field Name, enter a text representing the use.
  5. For the field API key, select the desired entrance key.
  6. For the field Endpoint, enter a text that represents the data.
  7. Click Create. This opens the details of your providing data interface, where Interface endpoint URL can be copied and used to make the API call.

Script* 

When setting up an Interface for providing data to an external application, the content of the interface will be defined in the Script table using the script syntax. This syntax can be entered manually or pasted from the Copy script/query – Query for export definition, found in:

  1. In the workspace, navigate to the My view or a Use case for which you want to generate a snippet. 
  2. In the view, click on Context menu - Relatics icon Open menu.
  3. Click Export syntax copy query script - Relatics icon Copy Script/Query.
  4. Click Export syntax copy query script - Relatics icon Query for export definition.
  5. Paste the snippet into the Query table.

Note:

  • Only a single root iterator may be used in the script.

Deprecated: Interface for providing IDs and display names (as input for external relations)* 

This feature is deprecated. If they are in use, all existing Interface for providing IDs and display names (as input for external relations) should be deleted before setting up an Interface for providing data to an external application. Use the following script to rebuild the interface:

  1. Replace element with the name of the element.
  2. Fill Script with:
    [nameElement]
         {@id}
         {@DisplayName}
    [.nameElement]

Note:

  • This table is only visible for workspaces that have existing Interfaces for providing IDs and display names (as input for external relations).

Provide data via API request

An HTTP GET request is required to get data from Relatics. The request consists of an endpoint URL, headers, and a body:

  • You can submit the GET request to the Interface endpoint URL. This URL can be found on the detail page of the interface and should look something like this:

https://myenvironment.relatics.com/api/v1/workspaces/755053b0-ba42-494a-b467-c2cf408be65/interfaces/providing/myendpoint

  • The headers that need to be set are described in the table below:
Key name Value Description
Authorization string “Bearer {Access_token}”

Where:

Accept list The structure type of response body. The options are:

  • application/json
  • A request body is not needed for this method.

 

If successful, this method returns the elements in the response body. Depending on the specified value of the ‘Accept’ key in the header, the response will be in json.

Notes:

  • You can use the http status to track the success of the request.
* In the workspace, the user type of your user must be set to power user to use this feature.