How You Monitor Export Activities Using REST APIs
This topic explains how to receive completion notification through REST resource and also avoid the need to constantly keep checking the export status.
To receive export completion notification through REST service, you must define the REST service endpoint in Application Composer. You can configure and register your REST endpoint to receive notifications whenever your export job completes.
Register an External REST Endpoint in Application Composer
To register an endpoint for notification:
-
Create and enter into a sandbox by navigating to
. -
Navigate to
Note that this option is available only when you're inside the sand box. -
You can edit the existing endpoints, or create a new endpoint such as
ExternalEndPoint1
, by clicking the Create icon. -
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.
-
Select and configure the POST method by clicking the check box for POST. Currently only POST method is supported for the Export Notification feature.
-
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" }] }
-
Click Save and Close.
-
After making the changes, publish the sandbox to commit your changes.
Validate the Endpoint
You can validate the REST endpoint to ensure that your REST web service configuration in Web Services in Application Composer is correct and the export process can call the endpoint successfully. To validate your REST endpoint and set an endpoint as default:
-
Navigate to
. -
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
. -
To make this connection as the default one while creating export jobs, select the Set as default check box.
-
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
-
Navigate to
-
Create the export activity, enter the name, and select the object to export.
-
Click the Advanced Options section and select the notification endpoint
ExternalEndPoint1
from the Notification Endpoint drop-down list. If you don't want to receive the notification, then select a blank value in the drop-down list. -
Click Next and select the attributes to export on the Map Fields page. Create a filter for at least the top-level object, and click Next. For more information on creating an export activity, see the topic Export Data.
-
Review your export configurations and submit the export job. Once you submit the export, you can monitor the status by accessing the configured endpoint.
-
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": "Account_Export",
"ExportObject": "Account",
"ExportFilterCriteria": "OrganizationName IS NOT NULL",
"ExportFileName": "Account.zip",
"Activate": "YES",
"RestNotification": "ExternalEndPoint1"
}}
The following table describes the behavior when you don't provide the REST notification endpoint.
REST Notification Value |
Endpoint Used for Export Job |
REST Notification Behavior |
---|---|---|
null |
Default endpoint is selected |
REST notification is sent to the default REST endpoint. |
REST notification not passed |
Default endpoint is selected |
REST notification is sent to the default REST endpoint. |
"" |
No REST endpoint is selected |
No REST notification is sent. |