I am trying to export a dashboard to an image via the rest API.
Of course, snooping what happens when I do it via the web interface is the way to go, but I am a bit stumped here (3k+ lines in the json payload and an unholy amount of GUID do not help).
In short:
- my dashboard has 8 metric sets, and the json seems to set parameters for each of them. This seems very brittle to me
- my dashboard has one view parameter, bound to the proper slicers on metric sets. That is the one I want to set once and for all, as can be done via the url https://www.dundas.com/Support/developer/samples/integration/pass-parameter-values-via-query-string In my example below, with the viewparameter
lname
I can add$lname=bdu
to the URL to filter the dashboard automatically.
I know the GUID of the image provider (variable provider_id), of my dashboard (variable dash_id) and of the view parameter (param_id). I thought that the following payload would be enough:
"__classType": "dundas.export.ExportRequest",
"isLegacyExport": True,
"providerId": provider_id,
"viewId": dash_id,
"ViewParameters": [{
"__classType": "dundas.view.ViewParameter",
"id": param_id,
"parameterValue": {
"__classType": "dundas.data.CollectionMemberValue",
"isInverted": false,
"parameterId": "0c84d309-6704-4798-a6a5-9a40cdd0bc8c", # I have no clue where this one comes from, cut & paste from the payload
"parameterValueType": "CollectionMember",
"values": [{
"__classType": "dundas.data.MemberValue",
"hierarchyUniqueName": "lname",
"levelDepth": 0,
"levelUniqueName": "lname",
"memberKind": "Regular",
"uniqueName": "bdu.lname"
}]
}
}],
But well, of course it isn’t enough otherwise I wouldn’t ask here
There is a as well a filter element, with yet another id, bound to the view parameter but I don’t think this one is relevant.
What could I be missing?
Thanks,