web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Query calendar rules

(0) ShareShare
ReportReport
Posted on by 12

Need to know if: given a time T0, T0 is a valid Operating Hour (our users are at work) or not (holiday, time off, break) based on a Calendar queue and its related calendar rules.

Is there a way to query odata the calendar rules?

Based on this article

   

I tried to query odata as:

https://[...]/api/data/v9.2/calendars(07d4aaa7-9453-ed11-bba2-000d3adf73bc)$expand=calendar_calendar_rules

but it results in bad request

{"error":{"code":"0x8006088a","message":"Bad Request - Error in query syntax."}}

In particular I need to figure out if there's a way to now if my Queue users are online (working) /offline (break,holidays,service is closed) within a Power Automate]
I have the same question (0)
  • Suggested answer
    ___Pool___ Profile Picture
    12 on at

    For those of you looking at the same information, rhis is what I was looking for, and it works:

    https://[...].crm4.dynamics.com/api/data/v9.0/calendars([yourcalendarid])/Microsoft.Dynamics.CRM.ExpandCalendar(Start=@d1,End=@d2)?@d1=2022-11-03T00:00:00.000Z&@d2=2022-11-03T23:59:59.999Z

    it returns the list of availability and breaks for a given time range [d1,d2].

    Substitute [yourcalendarid] 

  • Iuliia Sh. Profile Picture
    15 on at

    Hi,

    Thanks a lot for sharing, it actually works and returns a list of time slots.

    Anyway, did you have a chance to get deeper into this HTTP request?

    https://[organisation].crm3.dynamics.com/api/data/v9.1/calendars([GUID])?$expand=calendar_calendar_rules

    It works well for me and returns a lot of useful properties according to the spec:

    learn.microsoft.com/.../calendarrule

    The only issue is the wrong value of "starttime" response parameter. This parameter has a DateTime structure but always returns zeroes in a TIME part.

    Like this: "starttime": "2022-11-14T00:00:00Z".

    I got these zero-time values for any rule in responses when all the rules have different start times in CRM UI.

    Have you ever succeeded in requesting expand=calendar_calendar_rules? And have you ever faced this issue?

    I would appreciate it a lot if you could check that -)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans