Forum Discussion
The correct json body for updating Refresh Schedule with REST API.
When I using the REST API to update the Refresh Schedule:
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/update-refresh-schedule
I need the specify settings for the schedule like below:
But when I using below json body:
{'value': {'notifyOption':'NoNotification', 'enabled': true, 'isDaily':true,'times': ['07:00'],'localTimeZoneId': 'UTC','refreshNotificationEnabled':false,'refreshContacts':[{'displayName':'Liu, Leo-SG','objectId':'06211a47-86a2-48e7-8840-1984efbfb0d5','userPrincipalName':'My E-mail.com','isSecurityGroup':false,'objectType':1,'groupType':0,'aadAppId':null,'emailAddress':'My E-mail.com','relevanceScore':null,'creatorObjectId':null}]}}
It always prompts me that the json is not correct.
According to my understanding of the contact, it seems that it needs to display the name and object ID after verification during the input process, which seems to be impossible to obtain in advance? Or the objectId is bound to my personal account and will not be regenerated due to different deployment targets.
Anyway, I would like to have a correct json body. Please give me a json body that exactly matches my screenshot settings and verifies that it works, it has been driving me crazy for a day. thank you very much
4 Replies
- ibarrauSuper User
Hi. The json for the body would be something like this:
{ "value": { "notifyOption": "NoNotification", "days": [ "Sunday", "Tuesday", "Friday", "Saturday" ], "times": [ "07:00", "11:30", "16:00", "23:30" ], "localTimeZoneId": "UTC" } }That would be using all body possibilities. With days and time it's enough
Also consider that depends on the code you are using if it needs some trick parsing, dumping, etc.
I hope that helps,
- YULIU11Regular Visitor
Obviously it's not what I want, you just moved the sample body in the rest api, and didn't really check my problem. I have posted the link, so I must have checked it.
What I really want is that you can actually start from my problem. My requirement is Daily instead of certain days, and I also need include the contact person who will send the notification when it fails.
- ibarrauSuper User
Well. The body is the example you need. If you want daily, just add all week days from monday to friday in case of working days. The example if more than enough to fullfill your scenario. You can't add a contact person. If you read the docs, you will see the only options for the body are
I hope that make sense