How You Monitor Import Activities Using REST APIs
You can receive import completion notification through REST resource. This avoids the need to keep checking the import status.
To receive import 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 notification whenever your import 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 Import 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 import 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 import 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 Import Activity and Monitor the Status
-
Navigate to
-
Create the import activity, enter the name, and select the object and source file.
-
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 map the attributes on the Map Fields page. Review the configurations and submit the job. For more information on creating an import activity, see the topic Import Data.
-
Once you submit the import, 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.
Import Notification in REST and External Data
Loader Client (EDLC
)
You can use the EDLC command listResthooks to get the list of resources registered in Application Composer. For example,
java -jar oscdataloader.jar listResthooks -username importuser -target-url https://mypod.oracle.com
You can then use the notification endpoint to get the import notification with the following command:
java -jar oscdataloader.jar submit -input-file "AccountCSV.csv" -import-name "AccountImport" -mapping-number 30010011859 -object Account -username importuser -target-url https://mypod.oracle.com -high-volume -rest-notification "ExternalEndPoint1"
You can use the RestNotification attribute to specify your notification endpoint while creating your import activity using REST. For example, you can use the following sample payload to create your import activity:
{
"Name": "RESTImportActivity",
"ObjectCode": "Account",
"HighVolume": "YES",
"Activate": "YES",
"RestNotification": "ExternalEndPoint1",
"DataFiles" : [
{
"InputFileContentId": "UCMFA00012159"
}
]
}
The following table describes the behavior when you don't provide the REST notification endpoint in REST and EDLC.
REST Notification Value |
Endpoint Used for Import 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. |