Forum Discussion
API Call - Help with "Add Cache Refresh Plan"
- 1 year ago
I'm not sure why they moved away from using SwaggerHub for documentation, but the docs there still have an example of how to call this api https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/CacheRefreshPlans/AddCacheRefreshPlan And when I use the browser tools in Edge it captures the POST call to create a cache refresh plan.
Below is an example I captured when creating a scheduled refresh for my Power BI report called "local Adv Works"{ "Owner": null, "Description": "test2", "CatalogItemPath": "/local Adv Wrks", "EventType": "DataModelRefresh", "Schedule": { "ScheduleID": null, "Definition": { "StartDateTime": "2025-07-01T04:00:00+10:00", "EndDateSpecified": false, "EndDate": "1901-02-01T00:00:00+10:00", "Recurrence": { "DailyRecurrence": { "DaysInterval": 1 } } } }, "ScheduleDescription": "", "ParameterValues": [] }
I'm not sure why they moved away from using SwaggerHub for documentation, but the docs there still have an example of how to call this api https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/CacheRefreshPlans/AddCacheRefreshPlan And when I use the browser tools in Edge it captures the POST call to create a cache refresh plan.
Below is an example I captured when creating a scheduled refresh for my Power BI report called "local Adv Works"
{
"Owner": null,
"Description": "test2",
"CatalogItemPath": "/local Adv Wrks",
"EventType": "DataModelRefresh",
"Schedule": {
"ScheduleID": null,
"Definition": {
"StartDateTime": "2025-07-01T04:00:00+10:00",
"EndDateSpecified": false,
"EndDate": "1901-02-01T00:00:00+10:00",
"Recurrence": {
"DailyRecurrence": {
"DaysInterval": 1
}
}
}
},
"ScheduleDescription": "",
"ParameterValues": []
}
Thank you for the Swagger link and the message body example! The Swagger will be a useful resource going forward--until Microsoft releases a new version of the API, I suppose.
Turns out that I was close, having modeled a JSON object from a GET response. However, I was providing a null "ID" value which was not wanted by the server for the POST.