Export data endpoints

The following information shows you how you can perform an export. For detailed information on the REST APIs used in this section, refer to the REST API documentation.

To export data, perform the following steps:
  1. Trigger the export using the executeExport endpoint.
  2. Monitor the export status using the getExportProcess endpoint. Once the export has finished, download the exported and status files.
  3. You can stop the export process by using the abortExportProcess endpoint if necessary.
An export can be initiated using the following steps:
  1. Initiate the export by using the exportProcess endpoint. Provide the name of the file that will contain the exported data. The following example is of an archived export:
    [
      {
        "fileName": "Profiles.json",
        "format": "json",
        "id": "Profiles",
           "params" : {
              "q" : "id eq <id>"
           }
      },
      {
        "fileName": "Accounts.json",
        "format": "json",
        "id": "Accounts",
           "params" : {
              "q" : "id eq <id>"
           }
      }
    ]

    The following example is of a standalone export:

    POST /ccadmin/v1/exportProcess
         {
           "fileName": "product.json",
           "mode": "standalone",
           "accounts": "Products",
           "format": "json",
           "params" : {
              "q" : "id eq <id>"
           }
         }

    Note that the number of records in the export should be limited to 100 thousand. Exporting large quantities of data can cause performance issues. You can do limit the record number by using the q parameter.

  2. You can review the export progress by using the process ID returned from the exportProcess API. For example:
    GET /ccadmin/v1/exportProcess/{processId}
  3. Once the export job is done, the resulting payload provides the links you can use to download the export and status files. The following is an example of a response for a completed export in archive mode:
    {
      "progress": "succeeded",
      "startTime": "2020-05-22T07:28:04.242Z",
      "links": [
        {
          "rel": "meta",
          "href": "<base_url>/export/rKjSiAtgt8WCzJ1YHXrAc5mTQ_10000/exportStatus.zip"
        },
        {
          "rel": "file",
          "href": ""<base_url>/export/rKjSiAtgt8WCzJ1YHXrAc5mTQ_10000/datafile.zip"
        },
        {
          "rel": "self",
          "href": ""<base_url>/exportProcess/rKjSiAtgt8WCzJ1YHXrAcmTQ_10000?fileName=datafile.zip"
        }
      ],
      "endTime": "2020-05-22T07:28:05.434Z",
      "completed": true,
      "requestStatus": 200
    }
    The file URL can be used to download the exported data file. The meta URL is the status file that contains the following data:
    • startTime - Indicates the start time of the export process.
    • endTime - Indicates that the time that the export process ended.
    • successCount - This indicates the number of records that were successfully exported.
    • failureCount - The number of records that failed to successfully export.
    • failureExceptions - This provides error details if there are any errors that were created during the export process.

    A sample status file resembles the following:

    {
      "endTime" : 1587782346639,
      "startTime" : 1587782346602,
      "failureCount" : 1,
      "successCount" : 202,
      "failureExceptions" : [Some error message]
    }

Abort an export

An export can be aborted any time after triggering the export and before completion of the export. Once the export is aborted, the export process terminates and there are no partially exported files available.

To abort an export, use the POST /ccadmin/v1/exportProcess/{processId}/abort REST endpoint.