Skip to main content

Configure Entity Fetcher

Entity fetching is the process in which Tonkean sends an API request to an application to get or update a single data source record for a specified entity. For example, the entity fetcher might request the updated status of a single Opportunity in Salesforce.

Entity fetching occurs whenever a create or update action is activated for the data source and Tonkean sends a request to get the latest updates for the relevant data source record. For example, if you have a module workflow featuring a Salesforce action that updates an Opportunity, Tonkean first sends an API call to update the Opportunity, and then sends a second call to get the updated Opportunity from Salesforce, ensuring the Tonkean database is in sync with Salesforce. This second request is made by the entity fetcher.

Simply put, entity fetching is how Tonkean keeps data source records up to date between the Tonkean database and the application itself whenever a relevant action occurs.

Configure the Entity Fetcher Request

To ensure data source records are updated as expected, you must configure the API request, including defining the path, query parameters, and header, where necessary. To locate the information needed to configure the request, refer to the relevant API documentation for your application.

  1. In the Entities Settings panel, select Entity Fetcher. The Entity Fetcher screen displays.

    entities_fetcher_select.png
  2. Select the entity you configured the collect for. The Entity Fetcher configuration screen displays.

    entities_fetcher_select_entity.png
  3. In the Entity Fetcher URL field, select the method dropdown and choose the API method for the request.

    In most cases, the entity fetcher sends a GET request.

    entities_fetcher_url_method.png
  4. Referring to the relevant documentation for your application, locate the request path and enter it into the Entity Fetcher URL field. If you created a parameter to provide a value for a path variable, select the insert field button, insert_field.png, to add the parameter.

    entities_fetcher_url_path.png
  5. Some APIs may require you to pass in certain query parameters (params). To add a query param, select + Add Query Param. A pair of param configuration fields displays: Param and Value.

    • Param - The query param name, sourced from the application's API documentation.

    • Value - The assigned query param value.

    entities_fetcher_add_query_param.png
  6. Enter the Param and Value, then select the On which request? dropdown to choose when to pass in the param value.

    entities_fetcher_add_query_param_values.png
  7. Where relevant, select + Add Header to add any header values to the request. Header Name and Header Value fields display.

    It's rare to include header values with the entity fetcher. Header values are often used for authentication and configured on the Authentication screen. Refer to the application's relevant documentation to determine if you need to include header values.

    entities_fetcher_add_header.png
  8. Enter the Header Name and Header Value for each header value you include.

    entities_fetcher_add_header_values.png

Set Advanced Request Options

The Advanced section features several options for more complex use cases. Select the relevant checkbox to enable any of these options:

  • Ignore untrusted certificates - Ignore warnings generated by SSL or TLS certificates your browser has marked as untrusted.

  • Disable auto charset - Disable automatic assignment of the character set. Enable this option if you want to set the charset for your request by manually setting a value for Content-Type (for example, Content-Type: text/html; charset=utf-8).

  • Disable follow redirects - Disable automatic browser redirection.

  • Keep trailing forward slash - Maintain the trailing forward slash, "/" in the request path. Generally, the presence of a trailing slash indicates the resource is a directory as opposed to a file, which doesn't usually have a trailing slash.

  • Remove keys with empty values - Remove any keys without a corresponding value.

  • Support file download - Enable file download. Select this option only for APIs with built-in file storage and download capability (such as downloading a file from DocuSign).

Test the Entity Fetcher Request

After you have configured the request, you can test it to make sure it's working as expected.

  1. Select Test. The Run Test window displays.

    entities_fetcher_run_test_select.png
  2. Enter the values for any custom params you included. In the example below, the endpoint requires passing in the id for the user, which we created a custom param, "Id", for when configuring the entity collect.

    entities_fetcher_run_test_add_variable_values.png
  3. When finished, select Test.

    entities_fetcher_run_test_test.png

Handle the Entity Fetcher Response

With the request complete and successfully tested, you can select the field in the response you want to extract to ensure Tonkean updates the correct data source record.

  1. Select Response Handling. The Response Handling tab displays.

    entities_fetcher_response_handling_select.png
  2. In the response you received from the previous test, select the relevant object for the entity you want to collect.

    Because the fetch requests a single data source record, it's common for the response to contain an object without a parent element you can select. If the response doesn't contain a parent element, select the insert field button, insert_field.png, in the Entity field and select the Body response param.

    We recommend wrapping the "Body" param in brackets, making the extracted entity an array. Including brackets helps Tonkean to extract multiple data source records if a fetch occurs after multiple data source records were updated simultaneously.

    entities_fetcher_response_add_entity.png
  3. After selecting the entity you want to collect, select Extract Entities. After processing, several new entity fields display on the Response Handling tab.

    entities_fetcher_response_extract_entities.png
  4. In the Entity Unique Identifier field, select the insert field button, insert_field.png, and select the field that acts as the unique identifier for each entity object.

    entities_fetcher_response_entity_unique_id.png
  5. Enter an Entity Display Name. This is the name that displays for other users who connect to the data source—it displays on the Data screen and on the relevant business report. We recommend using a clear, title-case name. For example, "User" instead of "user".

    entities_fetcher_response_entity_disp_name.png
  6. For each remaining field, enter a value manually or select the insert field button, insert_field.png, and select the corresponding field from the response, if desired.

  7. When finished, select Save.

Entity fetching is configured.

Next Step