Forum Discussion

z-rmo's avatar
z-rmo
New Member
1 year ago
Solved

API Call - Help with "Add Cache Refresh Plan"

I'd like to be able to programmatically create a Cache Refresh Plan attached to a particular report hosted on our Report Server.   I can manually create a plan under "Scheduled refresh" when I mana...
  • d_gosbell's avatar
    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": []
    }