Synchronize data via API using custom application integration

Synchronize data via API using custom application integration

To synchronize data with Relatics from an external application an interface is needed.

Configure an interface in the workspace*

  1. Create a new external type element.
  2. In the workspace menu, click on  Settings.
  3. Click on the menu  Application integration, then Receiving data.
  4. Click on New interface, choose Custom. This results in the dialog Create interfaces for receiving data (Custom).
  5. For the field Name, enter a text representing the use.
  6. For the field Type element, select the desired external type element.
  7. For the field Initiator, select External application (via API request).
  8. For the field Relatics API key for requests by external application, select the desired requests key.
  9. For the field Endpoint, enter a text that represents the data.
  10. Click Create. The interface is created and ready to be used.

Synchronize data via API request

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

  • You can submit the POST 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-8c2cf408be65/interfaces/synchronizing/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
  • application/xml

The default is application/json.

  • In the request body, supply the complete set of elements. The data should be structured in either JSON or XML format, corresponding to the specified structure in the request header.

 

If successful, the web server returns an HTTP status of 200 and a response body. This means that the presented request body has the correct structure. To see if the data is processed successfully, you can check the Sync issues log of the interface or the elements in the type element overview. The response body contains the externalid and a Relatics URL to the corresponding element in the same structure as the provided data.

Notes:

  • Only properties and relations where the data ownership is configured as external can the value be changed in the request.
  • Elements not supplied in the request body will be deleted.
* In the workspace, the user type of your user must be set to power user to use this feature.