Chilkat Online Tools

delphiAx / Cognite API v1 / Retrieve cursors for parallel reads

Back to Collection Items

var
http: TChilkatHttp;
success: Integer;
sbResponseBody: TChilkatStringBuilder;

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

http := TChilkatHttp.Create(Self);

http.SetRequestHeader('api-key','{{api-key}}');

sbResponseBody := TChilkatStringBuilder.Create(Self);
success := http.QuickGetSb('https://domain.com/api/v1/projects/{{project}}/raw/dbs/:dbName/tables/:tableName/cursors',sbResponseBody.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add('Response status code = ' + IntToStr(http.LastStatus));
Memo1.Lines.Add(sbResponseBody.GetAsString());

Curl Command

curl -X GET
	-H "api-key: {{api-key}}"
https://domain.com/api/v1/projects/{{project}}/raw/dbs/:dbName/tables/:tableName/cursors?

Postman Collection Item JSON

{
  "id": "getCursors",
  "name": "Retrieve cursors for parallel reads",
  "request": {
    "url": {
      "host": "{{baseUrl}}",
      "path": [
        "api",
        "v1",
        "projects",
        "{{project}}",
        "raw",
        "dbs",
        ":dbName",
        "tables",
        ":tableName",
        "cursors"
      ],
      "query": [
        {
          "key": "minLastUpdatedTime",
          "description": "The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.",
          "disabled": true
        },
        {
          "key": "maxLastUpdatedTime",
          "description": "The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.",
          "disabled": true
        },
        {
          "key": "numberOfCursors",
          "description": "The number of cursors to return, by default it's 10.",
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "dbName",
          "description": "Name of the database.",
          "disabled": true,
          "type": "string"
        },
        {
          "key": "tableName",
          "description": "Name of the table.",
          "disabled": true,
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
      {
        "key": "api-key",
        "value": "{{api-key}}",
        "description": "An admin can create API keys in the Cognite console."
      }
    ],
    "description": "Retrieve cursors based on the last updated time range. Normally this endpoint is used for reading in parallel.\n\nEach cursor should be supplied as the 'cursor' query parameter on GET requests to [Read Rows](#operation/getRows).\n**Note** that the 'minLastUpdatedTime' and the 'maxLastUpdatedTime' query parameter on [Read Rows](#operation/getRows) are ignored when a cursor is specified.\n"
  }
}