Chilkat Online Tools

Objective-C / Cognite API v1 / Retrieve cursors for parallel reads

Back to Collection Items

#import <CkoHttp.h>
#import <CkoStringBuilder.h>

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

CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;

[http SetRequestHeader: @"api-key" value: @"{{api-key}}"];

CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [http QuickGetSb: @"https://domain.com/api/v1/projects/{{project}}/raw/dbs/:dbName/tables/:tableName/cursors" sbContent: sbResponseBody];
if (success == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

NSLog(@"%@%d",@"Response status code = ",[http.LastStatus intValue]);
NSLog(@"%@",[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"
  }
}