Skip to main content
Gainsight Inc.

Bulk Status API

This article explains how to use the Bulk Status API to track progress of the Bulk API doc.

Introduction

The Bulk Status API can be used to check the progress of the Bulk API job. When you successfully run the cURL command, it returns true with the Request ID and Status ID. This Status ID is used to retrieve the data from the Bulk Status API to track the progress of the upload.

Prerequisites

Before running the Bulk Status API doc, ensure that you have created a Bulk API connection and run the cURL command. For more information on how to create the Bulk API connection, refer to the Gainsight Bulk API article.

Headers

Key Value
Content Type application/json
Accept application/json, text/plain, */*
Accept Language en-GB,en-US;q=0.9,en;q=0.8

Bulk Status API

The Bulk Status API can be used to check the progress of the Bulk API job. When you successfully run the cURL command, it returns true with the Request ID and Status ID. This Status ID is used to retrieve the data from the Bulk Status API to track the progress of the upload.

Method

GET

Endpoint URL

https://<customer domain>//v1.0/admin/connector/job/bulkimport/status/{statusID}

Note:

  • Replace {statusID} with the actual status URL to check the job status. The statusID is returned in the response of the Bulk API job. 
  • Replace <customer domain> with the actual domain used in the Bulk API.

Sample Request Body

https://<<customer domain>//v1.0/admin/connector/job/bulkimport/status/{statusID}

Parameters

Parameter (*mandatory) Data type Values Description
statusID * String   The String value that contains the status id that is returned when the Bulk API Curl is accepted and can be used to track the jobStatus.

Sample Success Response 

The response on running the above URL provides the following important information:

  • Job Status: Status of the Bulk API job - INIT (initiated) , IN_PROGRESS, or COMPLETED.
  • Count: Number of records that were successful, or failed, denoted by successCount and failureCount respectively. 
  • Response File: URL to access the file content of successful or failed records, denoted by successFile and  errorFile respectively.

Note: In case of partial success, you will receive two URLs - one for the successful records (successFile) and another for the failed records (errorFile).

{
    "result": true,
    "requestId": "b8624b3c-8cd1-420f-be42-c22011561fec",
    "data": {
        "successCount": 100000,
        "failureCount": 0,
        "jobStatus": "COMPLETED",
        "requestStartDateTime": 1656663854035,
        "requestEndDateTime": 1656663973538,
        "jobId": "dca4f51d-85e2-4823-a1ed-bc683fbf518d",
        "successFile": "https://<customer domain>/v1.0/api/connector/job/bulkimport/status/{statusID}/fileDownload/success"
    }
}

Sample Partial Success Response

{
    "result": true,
    "requestId": "af0fa349-5ca5-4f89-a673-56b412f732d1",
    "data": {
        "successCount": 1,
        "failureCount": 1,
        "jobStatus": "COMPLETED",
        "requestStartDateTime": 1658140872537,
        "requestEndDateTime": 1658140934314,
        "errorFile": "https://integration-demo-intbulkapi.develgs.com:9015/v1.0/api/connector/job/bulkimport/status/UC-6D083115-14B6-447E-9905-5BB187169C1F/fileDownload/error",
        "jobId": "5a314c34-ad05-4236-9841-b0a693fd5132",
        "successFile": "https://integration-demo-intbulkapi.develgs.com:9015/v1.0/api/connector/job/bulkimport/status/UC-6D083115-14B6-447E-9905-5BB187169C1F/fileDownload/success"
    }
} 

Sample Failure Response

{
    "result": true,
    "requestId": "86c570ae-da05-4251-a8a8-5be3742415dc",
    "data": {
        "successCount": 0,
        "failureCount": 2,
        "jobStatus": "COMPLETED",
        "requestStartDateTime": 1658141103180,
        "requestEndDateTime": 1658141146903,
        "errorFile": "https://integration-demo-intbulkapi.develgs.com:9015/v1.0/api/connector/job/bulkimport/status/UC-C2FF8EF3-A38A-4633-A7AB-F3844BDBD34D/fileDownload/error",
        "jobId": "5a314c34-ad05-4236-9841-b0a693fd5132"
    }
}

Success or Error Response File

You can use the response file URL obtained from the Bulk Status API to stream and download the contents of the file as an API response. You can use this response to view detailed information of the underlying records. 

Method

GET

Endpoint URL

https://<customer domain>/v1.0/api/connector/job/bulkimport/status/{statusID}/fileDownload/success

Sample Success File Response

gsid,user email,company name,deleted
1P07OZATH1BA7ISW201OP91K0RS9LEM7VCHX,tsa@gait.com,Netflix,false, 

Sample Error File Response

user email,company name,deleted
tsarkar123@gainsight.com,Netflix,false,"[{""columnName"":""usergsid"",""errors"":[{""code"":""lookup_failed"",""message"":""Error""}]}]"
swe@gm.com,Netflix,false,"[{""columnName"":""usergsid"",""errors"":[{""code"":""lookup_failed"",""message"":""Error""}]}]"

Sample Missing File Response Response

 {
    "result": false,
    "errorDesc": "No error file to download",
    "requestId": "2039a128-9445-4eeb-a61e-16744a7521d5"
}
  • Was this article helpful?