Posting report parameters via REST post not working

Refer to attached image.

The reporting module’s REST API is not accepting report parameters using the JSON format as per documentation. I am testing the API using Advanced rest Client Chrome plugin. Below is my request body json:

{
  "parameters": [
    {
      "facility_code": "xxxxxx",
      "month": "12",
      "year": "2019",
      "user": "User1"
    }
  ]
}

I get the error message below, yet the parameter is specified in the json.

{
"error": "Run report error",
"details": "Required report parameter "facility_code" not found"
}

cuba_reports_rest_api

Hi,

I’m sorry but reporting manual suggests different syntax to pass parameters:
https://doc.cuba-platform.com/reporting-7.2/rest_reports.html#rest_reports_run

The report parameters are passed in the request body:
{parameters: [{name: ‘author’,value: ‘4b3a21b0-d6b7-4161-b0b6-55f118fbaac5’}]}

So in your case it should be:

{
  "parameters": [
    {name: "facility_code", value: "xxxxxx"},
    {name: "month", value: "12"},
    ...
    }
  ]
}

It worked. Thank you very much.