Skip to main content
Skip table of contents

API - Correct syntax for calling reporting endpoints

The hardest part of running reports is getting the parameters correct for the PUT request.

Correct process is to first call to the Report Parameters endpoint:
https://developer.myob.com/api/exo/endpoints/report/reportparameters/
GET: {URI}/report/{reportname}

And then run the PUT request:

https://developer.myob.com/api/exo/endpoints/report/runreport/

PUT: {URI}/report/run/{reportname}

Consider the following PUT request to: {URI}/report/run/DRLStkGroupSales.CLR

CODE
Request Body: {
"id": "RunReportID123",
"notificationid": null,
"parameters": [
{
"name": "FromPeriod",
"value": "0"
},
{
"name": "ToPeriod",
"value": "0"
},
{
"name": "ToSecondary",
"value": "3"
}
]
}

And the response received

CODE
Response Error: {
"message": "Unknown parameter FromPeriod"
}
Error: Error: Error running report: Bad Request

There are 3 options that might cause the above problem

  1. If the “id” of the request is missing.
    The first parameter will show an Unknown parameter if the id value is missing.

  2. If the “id” of the request is invalid.
    The id value must be the Report name to ensure this works correctly. In the above example it should be

    CODE
    "id": "DRLStkGroupSales.CLR",
  3. If the parameter name isn’t correct.
    The “Unknown parameter” error can also appear if you aren’t using the correct parameters, as specified from the get call to the Report Parameters endpoint:
    https://developer.myob.com/api/exo/endpoints/report/reportparameters/
    GET: {URI}/report/{reportname}

Full documentation for Running Reports in Exo Business is in the Developer centre.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.