Skip to main content

I’m using n8n AI agent builder to query CDF via an http request. The body of the request is:

The request URL is https://westeurope-1.cognitedata.com/api/v1/projects/essc-sandbox-44/events

{
"filter": {
"startTime": {
"min": 1751070336000,
"max": 1751588736000
},
"dataSetIds": "7726848970162689]
},
"limit": 1000
}

CDF seems to recognize the datasetid filter but not other filters like starttime as shown or others like Types.

 

The result set returned is all events in that datasetid.

I’ve also tried minstarttime and maxstarttime.

ideas?

 

 

@Chris Selph the request URL that you should use in this case is,

https://westeurope-1.cognitedata.com/api/v1/projects/essc-sandbox-44/events/list

You can find more infomation in the API documentation here.

The request body should look like this,

{
"filter": {
"startTime": {
"min": 1751070336000,
"max": 1751588736000
},
"dataSetIds": "
{
"id": "7726848970162689"
}
]
},
"limit": 1000
}

Please let me know whether this work as expected.


@Mithila Jayalath  thanks for your response. My trial of the new body you sent shows the returned data outside of the min and max time stamps which are june 28 to july 4 2025. Here is example returned record from 2009 which is at least from the correct dataset. Any ideas are welcome, there must be something missing.

 

Note i get the same response using postman.

 

{

"dataSetId": 7726848970162689,

"startTime": 1231041134000,

"endTime": 1231045051000,

"type": "Strand Event",

"subtype": "Heat",

"description": "Strand Heat Event 2009-01-04 03:52:14 Shift 7-3",

"metadata": {

"iShroud_mi": "0",

"fAverage_Speed": "16.09",

"fChromium": "0.10776",

"fIron": "0.0",

"iPLC_Heat_Number": "142532",

"fCalcium": "0.0",

"fNickel": "0.138",

"cMold_No": "7.000000",


sorry i submitted too soon, let me work this out…

 


ok, using your url and body from above, neither n8n nor postman like it. Postman says: 

{
    "error": {
        "code": 400,
        "message": "Could not parse parameters (id). Please check the API documentation: https://doc.cognitedata.com/."
    }
}

 

as if it is expecting query params to be sent?


@Chris Selph it looks like something is wrong in your setup. It is working as expected when I check from my end.


Thanks, will keep digging. 


If you need further help, I can hop into a meeting and check on this.


@Mithila Jayalath I really appreciate the offer to help. 

thanks for your correct suggestion. In my trial I was using a GET, not the required POST method. It is functioning well now!

Chris

 


Great! I’m happy to hear it works.


Reply