Monitor Export Activities Using REST APIs

You can configure and register your REST endpoint to receive notification whenever your export job completes. This usecase explains how to do this to receive completion notification through REST resource. This avoids the need to keep checking the export status.

Register an External REST Endpoint in Application Composer

To register an endpoint for notification:
  1. Create and enter into a sandbox by navigating to Configuration > Sandboxes > Create Sandbox.
  2. Navigate to Configuration > Application Composer > Web Services. Note that this option is available only when you are inside the sandbox.
  3. You can edit the existing endpoints, or create a new endpoint such as ExternalEndPoint1, by clicking the Create icon.
  4. Enter the name of the endpoint and the URL, and select the authentication scheme. For example, your URL can be in the format https://servername/ic/api/integration/v1/connections/cbveTest.
  5. Select and configure the POST method by clicking the check box for POST. Currently only POST method is supported for the Export Notification feature.
  6. Select and provide the code samples for the request and response payloads. Following is the sample for request and response payloads:
    {
    "items": [],
    "count": 0,
    "hasMore": false,
    "limit": 25,
    "offset": 0,
    "links": [{
    "rel": "self",
    "href": "https://servername/ic/api/integration/v1/connections/cbveTest",
    "name": "ExternalEndPoint1",
    "kind": "collection"
    }]
    }
  7. Click Save and Close.
  8. After making the changes, publish the sandbox to commit your changes.

Validate the Endpoint

To validate your REST endpoint and set an endpoint as default:
  1. Navigate to Tools > Export Management > Export Configuration > REST Notification.
  2. Here, select REST Notification as the notification type, and select the endpoint you registered from the Notification Endpoint drop-down list. In our example, select ExternalEndPoint1.
  3. To make this connection as the default one while creating export jobs, select the Set as default check box.
  4. To validate, click the Payload Details section, and click the Validate REST Endpoint button. If your endpoint is valid, then you see one of the following response statuses in the Response text box:
    • 200
    • 201
    • 202
    • 204
    Any other response status indicates that the endpoint is invalid.

Create the Export Activity and Monitor the Status

  1. Navigate to Tools > Export Management > Create Export Activity.
  2. Create the export activity, enter the name, and select the object and source file.
  3. Click the Advanced Options section and select the notification endpoint ExternalEndPoint1 from the Notification Endpoint drop-down list. If you do not want to receive the notification, then select a blank value in the dropdown list.
  4. Click Next and map the attributes on the Map Fields page. Review the configurations and submit the job.
  5. Once you submit the export, you can monitor the status by accessing the configured endpoint.
  6. Alternatively, you can verify whether the notification is submitted by downloading the log files. The last entry in the file indicates the status of notification.

Export Notification in REST

You can use the RestNotification attribute to specify your notification endpoint while creating your export activity using REST. For example, you can use the following sample payload to create your export activity:
{
"Name": "RESTExportActivity",
"ObjectCode": "Account",
"HighVolume": "YES",
"Activate": "YES",
"RestNotification": "ExternalEndPoint1",
"DataFiles" : [
{
"InputFileContentId": "UCMFA00012159"
}
]}

The following table describes the behavior when you do not provide the REST notification endpoint in REST: