Symptoms


Generate a “.json” file as per the example:

# cat ardocm.json
{
"type": http://www.odin.com/rde/report-template/1.5
},
"commonName": "NEW_Col_AR_2023_04",
"parameters": {
"startDate":"2023-04-01T00:00:00Z",
"endDate":"2023-05-01T23:59:59Z"
},
"format": "CSV",
"notifyByEmail": false,
"eventType": "ONETIME",
"dataSet": {
"aps": {
"modified": "2022-09-13T12:12:42Z",
"id": "c081adb0-1bdd-417f-b17f-43414e2929a5",
"type": http://www.odin.com/rde/global-data-set/1.0,
"status": "aps:ready",
"revision": 3
}
}
}

Then execute the API call:

curl --location --request POST 'https://localhost:6308/aps/2/resources/' --header 'APS-token: ' --header 'Content-Type: application/json' --data @ardocm.json

You will face the result: 

{"error":"APS::Util::APSInvalidRequestException","message":"No 'aps' node found in request."}

Cause


Malformed json based on documentation https://docs.cloudblue.com/cbc/20.5/premium/content/Reporting-and-Data-Export/How-to-Create-a-Report.htm# 

Resolution


The complete json could be:

{
"aps":{
"type": http://www.odin.com/rde/report-template/1.5
},
"commonName": "NEW_Col_AR_2023_04",
"parameters": {
"startDate":"2023-04-01T00:00:00Z",
"endDate":"2023-05-01T23:59:59Z"
},
"format": "CSV",
"notifyByEmail": false,
"eventType": "ONETIME",
"dataSet": {
"aps": {
"modified": "2022-09-13T12:12:42Z",
"id": "c081adb0-1bdd-417f-b17f-43414e2929a5",
"type": http://www.odin.com/rde/global-data-set/1.0,
"status": "aps:ready",
"revision": 3
}
}
}