PowerBuilder / Cognite API v1 / Retrieve rows
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "id": 1844083276579324,
// "start": 0,
// "end": -14940119,
// "limit": 100,
// "cursor": "laborum",
// "columns": [
// "voluptate esse dolor",
// "ex"
// ]
// }
loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")
loo_Json.UpdateInt("id",123)
loo_Json.UpdateInt("start",0)
loo_Json.UpdateInt("end",-14940119)
loo_Json.UpdateInt("limit",100)
loo_Json.UpdateString("cursor","laborum")
loo_Json.UpdateString("columns[0]","voluptate esse dolor")
loo_Json.UpdateString("columns[1]","ex")
loo_Http.SetRequestHeader("content-type","application/json")
loo_Http.SetRequestHeader("api-key","{{api-key}}")
loo_Resp = loo_Http.PostJson3("https://domain.com/api/v1/projects/{{project}}/sequences/data/list","application/json",loo_Json)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Json
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_Json
Curl Command
curl -X POST
-H "api-key: {{api-key}}"
-H "content-type: application/json"
-d '{
"id": 1844083276579324,
"start": 0,
"end": -14940119,
"limit": 100,
"cursor": "laborum",
"columns": [
"voluptate esse dolor",
"ex"
]
}'
https://domain.com/api/v1/projects/{{project}}/sequences/data/list
Postman Collection Item JSON
{
"id": "getSequenceData",
"name": "Retrieve rows",
"request": {
"url": {
"host": "{{baseUrl}}",
"path": [
"api",
"v1",
"projects",
"{{project}}",
"sequences",
"data",
"list"
],
"query": [
],
"variable": [
]
},
"method": "POST",
"header": [
{
"key": "api-key",
"value": "{{api-key}}",
"description": "An admin can create API keys in the Cognite console."
},
{
"key": "content-type",
"value": "application/json"
}
],
"description": "Processes data requests, and returns the result. NB - This operation uses a dynamic limit on the number of rows returned based on the number and type of columns, use the provided cursor to paginate and retrieve all data.",
"body": {
"mode": "raw",
"raw": "{\n \"id\": 1844083276579324,\n \"start\": 0,\n \"end\": -14940119,\n \"limit\": 100,\n \"cursor\": \"laborum\",\n \"columns\": [\n \"voluptate esse dolor\",\n \"ex\"\n ]\n}"
}
}
}