GithubHelp home page GithubHelp logo

bookings-samples's Introduction

Microsoft Bookings API Samples

This project contains a set of samples that demonstrate how to work with the Microsoft Bookings API to manage Bookings data in Office 365. Follow this guide to get started.

For more information, see the Microsoft Bookings API in Microsoft Graph documentation.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

bookings-samples's People

Contributors

fpintos avatar kpantos avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bookings-samples's Issues

_ServiceNotes Empty

I was wondering why serviceNotes comes back empty when there is data on bookings.

image

Problems providing Duration values for creating virtual appointments

I am trying to create virtual appointments programmatically in our .net Maui app.

First of all, I am having the following issue:

A null value was found for the property named 'duration', which has the expected type 'Edm.Duration[Nullable=False]'. The expected type 'Edm.Duration[Nullable=False]' does not allow null values.

Duration is not required for the request, rather, it is returned in the response. Therefore, I don't provide it. But when my BookingAppointment object is converted to json, the json contains
"Duration":null
And I don't know how to prevent my json from having it. Of course, I can edit json programmatically, but it seems to be weird that I would have to do it.

The second problem is with postBuffer and preBuffer. In C#, I set them like this:

               PostBuffer = new Duration(TimeSpan.FromMinutes(10)),
               PreBuffer = new Duration(TimeSpan.FromMinutes(5)),

But after it is converted to Json, it becomes "PostBuffer":{},"PreBuffer":{}

Thus I get the following errors:

An unexpected 'StartObject' node was found for property named 'postBuffer' when reading from the JSON reader. A 'PrimitiveValue' node was expected.

In the documentation, it is written:

   PostBuffer = TimeSpan.Parse("PT10M"), 
   PreBuffer = TimeSpan.Parse("PT5M"),

but that would not compile:

Cannot implicitly convert type 'System.TimeSpan' to 'Microsoft.Graph.Duration'

So how can I get rid of the duration in my request, and how can I set preBuffer and postBuffer properly? Though it seems to be a bug either in the api, or in the documentation.

Services are sorted by create date

Hello,

Today I discovered that services are sorted by create date:
image
The same on a booking page. Should it be that way? I think sorting by name is more intuitive.

(Sorry if I posted it in a wrong issue tracker)

Greetings

Adding a Group Bookings Service at the Calendar Level

I'm trying to build a training schedule for our business services company. We have the Services (course) built out and are able to only use the group scheduling one way. Each course has to be given a 'Not Bookable' as a general distinction then the individual dates and times for the allowed class time has to be entered as an additional time.

We have been able to add classes under the Calendar view which is preferable but the class is not able to add attendees from the client side.
Screenshot 2020-10-26 154152

Is there a workaround for situations like this that could also make it a bit easier to manage?

authorization

So i created the app on azure, and place the ID in the program, i then use the localhost as the Uri, but i keep getting this error after I enter the uri in the console. I also turn some other feature on azure client type on. What it my missing in the error?

System.AggregateException: One or more errors occurred. ---> Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

Customer notes from appointment

Hello,

How can I access field 'customerNotes' from appointment? I tried using graph API (/bookingBusinesses/{id}/appointments) but it always returns null for customerNotes.

Thanks
Jakub

Custom Fields

Bookings supports defining custom fields for different services.

Is this supported by the API currently?

Event's on 0365 calendar affect availability not working via api

Hello.

I am implementing the bookings app through the api. When calling all staff members schedules.
https://graph.microsoft.com/beta/bookingBusinesses/[email protected]/staffMembers

I receive only the schedules of staff members that have been manually inputted into the bookings ui under 'staff'. Meaning if you scheduled a staff for working 0800-1700 that staff is available the entire time. The staff's personal 365 calendar isn't affecting availability. The Event's on 0365 calendar affect availability box is checked true.

The response doesn't relate to the staff's calendar at all.
If I go to the Bookings ui page. That is created from the bookings app. It accurately removes timeslots not available based on the staff's 365 calendar.

How can One Get the Self Service Page Link

I see theselfServiceId return from the Bookings API, but the self service page link id is different. Is there a way to extract the self service page link ID from either the bookings API or event API using singleValueExtendedProperties.

This would be extremely useful, as customers may lose this or the company may wish to rebook on their behalf. If we could extract this ID we reference direct links to this page.

Native Azure AD application registration fails

Hello,

One of the steps for setting this thing up doesn't work for me. Am I doing anything wrong here?

Edit the application manifest in Azure, and include this under requiredResourceAccess, so the application will require access to the Bookings API*:
{
    "resourceAppId": "a6f98bd3-1059-4225-8f94-fce712c45742",
    "resourceAccess": [{ "id": "994019ca-1a02-4fd8-9fd6-987c7c09c426", "type": "Scope" }]
}

This results in a screenshot below:
screenshot_1

And, ultimately, InitializeTenant.ps1 fails because of the below:

AADSTS65005: The app needs access to a service ("https://microsoft.onmicrosoft.com/bookingsodataapi") that your organization "e354aff0-3c35-435d-b168-ac0bf6b5fc3b" has not subscribed to or enabled. Contact your IT Admin to review the configuration of your service subscriptions.

create a self service appointment via the api

Is there a way to create an appointment for a client via the api, but still allow the user to manage it, in an ideal world the system would send the email as 'normal' but it would still be ok if we had to send the email - The question is how to get the manage link

Bookings customer phone breaking change

Hi, it appears that a change has occurred in the graph api for the bookings customer phone. For the past year the following returned a valid phone number.

id eq 'String {ccb88e73-951a-4b10-bb49-e6628b8d8494} Name BookingItemCustomerPhone')

I am now seeing the result returned with "undefined" preceding the phone number. I believe this is due to the country code being added in the Bookings UI. Now I see this returned (see the value):

            {
                "id": "String {ccb88e73-951a-4b10-bb49-e6628b8d8494} Name BookingItemCustomerPhone",
                "value": "undefined3146318700"
            }

Can you please advise on how to properly request/process the phone number now?

Thanks,
Jerry

Originally posted by @jcfetzer in #7 (comment)

Webhooks for Appoinment Created / Updated / Deleted

Hi,

Is it possible to setup somethign like a webhook to trigger on new appoinments being Added / Updated / Deleted?

I'm looking to integrate Microsoft bookings with a lead automation system and will need that sort of functionality for it to work.

Thanks,
Nick

Create a group appointment

Hi There,

I am looking at options to create a group appointment via API. I want 3 people of family members who can input one profile on the website reserve (bookings) for 3 people. The recently released added two properties on booking appointment API "maximumAttendeesCount" and "filledAttendeesCount". If I set 3 instead of 1 on filledAttendeesCount, but provide only one customer profile information. Can MS Bookings count 3 appointments instead of 1?

Any suggestion?

With Much Metta!

Application permissions

I'm building a homepage that is essentially a reskin of the hosted bookings page. #7 references application permissions for unattended access, but It wasn't clear how @jcfetzer was able to work around this.

Without application permissions, I don't see any way that I can replicate the hosted page's experience, as an administrator of the bookings business needs to be logged in.

Is it possible to create a long-lived access token or certificate or something for a web service?

Daemon process with Bookings API

Hi, I’m able to get the sample code to work and Postman requests when authenticating with the Native app registration and using the Auth Code flow (where I’m prompted to login to AAD before getting a token). All is good.

However, I’m trying to setup a daemon (no user interaction or login) process to retrieve bookings appointments nightly. I’ve added an app registration of type Web app / API and authenticating by retrieving the token with the Client Credentials flow. I can get a token, but when making the Bookings API Appointments request with the token, I receive a 401 unauthorized. I see that there are no Application Permissions for the Bookings OData API in Azure, only Delegated Permissions. Is what I’m trying to do possible with the current Bookings API and related permissions? Is seems it will only work when logging in as a user and the delegated permissions are honored.

I have also tried making a Graph API request for Events (per the Webhooks question here). I can retrieve some Event data but the subject, bodyPreview and body values appear to strip out Customer data (see below). And the Events do not list Customer data that was entered for the Bookings appointment, only the Staff data is listed under the Attendees key. Are there any other Graph API categories that might provide this customer information? I’ve checked with the Graph Explorer and haven’t been able to find the customer data.

Interestingly, when using the Graph Explorer while logged in with my user account, the subject, bodyPreview and body of the Event response ARE populated with the Customer data. If I can retrieve this from a request made in code with Client Credentials, I could parse out the Customer info and be good to go. But as noted above, the Customer data gets stripped out. Any ideas on this?

Per Postman call using Client Credentials token:

image

Per Graph Explorer call (logged in with my user credentials):

image

Thank you,
Jerry

API Rate Limits

What is the rate limit for use of the Bookings API?

I read through this article but it doesn't reference Bookings specifically and only talks about service accounts which Bookings does not use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.