Chilkat Online Tools

Go / Salesforce Platform APIs / Get Job Query Result

Back to Collection Items

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global_Ref.html">Global Unlock Sample for sample code.

    http := chilkat.NewHttp()
    var success bool

    http.SetRequestHeader("Content-Type","application/json")
    // Adds the "Authorization: Bearer <access_token>" header.
    http.SetAuthToken("<access_token>")
    http.SetRequestHeader("Accept","test/csv")

    sbResponseBody := chilkat.NewStringBuilder()
    success = http.QuickGetSb("https://domain.com/services/data/v{{version}}/jobs/query/{{_jobId}}/results",sbResponseBody)
    if success == false {
        fmt.Println(http.LastErrorText())
        http.DisposeHttp()
        sbResponseBody.DisposeStringBuilder()
        return
    }

    fmt.Println("Response status code = ", http.LastStatus())
    fmt.Println(*sbResponseBody.GetAsString())

    http.DisposeHttp()
    sbResponseBody.DisposeStringBuilder()

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-H "Accept: test/csv"
https://domain.com/services/data/v{{version}}/jobs/query/{{_jobId}}/results

Postman Collection Item JSON

{
  "name": "Get Job Query Result",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "type": "text",
        "value": "test/csv"
      }
    ],
    "url": {
      "raw": "{{_endpoint}}/services/data/v{{version}}/jobs/query/{{_jobId}}/results",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "jobs",
        "query",
        "{{_jobId}}",
        "results"
      ],
      "query": [
        {
          "key": "locator",
          "value": "",
          "disabled": true
        },
        {
          "key": "maxRecords",
          "value": "",
          "disabled": true
        }
      ]
    }
  },
  "response": [
  ]
}