System Admin and Configuration

Get Involved. Join the Conversation.

Topic

    Adam Birkholz
    Bulk Extracting Contacts, Incidents, and Threads by Created...Answered
    Topic posted October 23, 2019 by Adam Birkholz, last edited October 23, 2019 
    38 Views, 2 Comments
    Title:
    Bulk Extracting Contacts, Incidents, and Threads by Created Date for local archive
    Summary:
    Has anyone extracted contact, incident, and thread records in bulk for local archiving?
    Content:

    I am looking to do a bulk extract of all Incidents (plus Threads) and Contacts by creation date to decrease storage of those objects within Oracle Service Cloud. It is desired to locally store this archived data.

    The following REST APIs cover this from a service standpoint:
    Retrieve collection of incidents, Retrieve an instance of Incident, Retrieve collection of contacts, and Retrieve an instance of Contact.

    However, the REST APIs will take days to execute to just extract a single year of data.  I have been looking into the Bulk Extract API (https://docs.oracle.com/en/cloud/saas/service/19a/cxsvc/c_osvc_bulk_extract.html) and wonder if that can be used for the Incident|Thread and Contact extraction.
     

    Thanks.

    Version:
    Service Cloud 19B

    Best Comment

    Adam Birkholz

    We were able to leverage the Bulk Extract feature to obtain the desired data sets.  Figuring out the operators for the call were key.  The below examples show how we did this by Created Time.

     
    === To see available filter operators: ===
     
    GET https://mysite.com/services/rest/connect/v1.4/namedIDs/bulkExtracts/filters/filterOperator
    OSvC-CREST-Application-Context: archive
     
     
     
     
    === To schedule a bulk extract with date filters: ===
     
    POST https://mysite.com/services/rest/connect/v1.4/bulkExtracts 
    Content-Type: application/json
    OSvC-CREST-Application-Context: archive
     
    {
    "class": "Incident",
    "name": "ExtractExample",
    "state": {
    "lookupName":"Run"
    },
    "filters": [
    {
    "leftOperand": "CreatedTime",
    "filterOperator": {
    "lookupName": ">="
    },
    "rightOperand": "'2017-01-01T00:00:00Z'"
    },
    {
    "leftOperand": "CreatedTime",
    "filterOperator": {
    "lookupName": "<"
    },
    "rightOperand": "'2018-01-01T00:00:00Z'"
    }
    ],
    "version": "v1.4"
    }
     
     
     
    === To see a list of available bulk extract results: ===
     
    GET https://mysite.com/services/rest/connect/v1.4/bulkExtractResults
    OSvC-CREST-Application-Context: archive
     
     
     
    === To get metadata for an individual bulk extract result: ===
     
    GET https://mysite.com/services/rest/connect/v1.4/bulkExtractResults/1
    OSvC-CREST-Application-Context: archive
     
     
     
     
    === To download a compressed bulk extract file: ===
     
    GET https://mysite.com/services/rest/connect/v1.4/bulkExtractResults/1/exportedData?download
    OSvC-CREST-Application-Context: archive
     
     
    === Curl command to download a compressed bulk extract file: ===
     
    curl -XGET -u username:password -H 'OSvC-CREST-Application-Context: archive' 'https://mysite.com/services/rest/connect/v1.4/bulkExtractResults/1/exportedData?download' --output archive.tgz

    Comment

     

    • Tushar Gupta

      You can do this by using SOAP API in the .net Addin

    • Adam Birkholz

      We were able to leverage the Bulk Extract feature to obtain the desired data sets.  Figuring out the operators for the call were key.  The below examples show how we did this by Created Time.

       
      === To see available filter operators: ===
       
      GET https://mysite.com/services/rest/connect/v1.4/namedIDs/bulkExtracts/filters/filterOperator
      OSvC-CREST-Application-Context: archive
       
       
       
       
      === To schedule a bulk extract with date filters: ===
       
      POST https://mysite.com/services/rest/connect/v1.4/bulkExtracts 
      Content-Type: application/json
      OSvC-CREST-Application-Context: archive
       
      {
      "class": "Incident",
      "name": "ExtractExample",
      "state": {
      "lookupName":"Run"
      },
      "filters": [
      {
      "leftOperand": "CreatedTime",
      "filterOperator": {
      "lookupName": ">="
      },
      "rightOperand": "'2017-01-01T00:00:00Z'"
      },
      {
      "leftOperand": "CreatedTime",
      "filterOperator": {
      "lookupName": "<"
      },
      "rightOperand": "'2018-01-01T00:00:00Z'"
      }
      ],
      "version": "v1.4"
      }
       
       
       
      === To see a list of available bulk extract results: ===
       
      GET https://mysite.com/services/rest/connect/v1.4/bulkExtractResults
      OSvC-CREST-Application-Context: archive
       
       
       
      === To get metadata for an individual bulk extract result: ===
       
      GET https://mysite.com/services/rest/connect/v1.4/bulkExtractResults/1
      OSvC-CREST-Application-Context: archive
       
       
       
       
      === To download a compressed bulk extract file: ===
       
      GET https://mysite.com/services/rest/connect/v1.4/bulkExtractResults/1/exportedData?download
      OSvC-CREST-Application-Context: archive
       
       
      === Curl command to download a compressed bulk extract file: ===
       
      curl -XGET -u username:password -H 'OSvC-CREST-Application-Context: archive' 'https://mysite.com/services/rest/connect/v1.4/bulkExtractResults/1/exportedData?download' --output archive.tgz