Do the Calendar endpoints work for US Gov cloud

Ian Simpson 21 Reputation points
2021-07-05T21:04:14.517+00:00

I have an app that I need to integrate with both the commercial, and US National Graph environments. I have everything working on the commercial side, but when switching over to the National endpoints (graph.microsoft.us). I am receiving Bad Request responses. I have switched over all the URLs to the US National versions, am able to log in, and perform some simple GETs, but the app is receiving a 400 response when I try to create an event using Graph.

I was using a request format like this and hitting the POST /users/{userPrincipalName}/events endpoint:

{  
    "subject": "Test Subject",  
    "body": {  
        "contentType": "HTML",  
        "content": "some test stuff"  
    }  
    "start": {  
        "dateTime": "2021-07-06:21:00:00",  
        "timeZone": "UTC"  
    },  
    "end": {  
        "dateTime": "2021-07-06:22:00:00",  
        "timeZone": "UTC"  
    },  
    "location": {  
        "displayName": "Virtual"  
    },  
    "attendees": [  
        "emailAddress": {  
            "address": "myemail@mydomain.com",  
            "name": "my name"  
        },  
        "type": "required"  
    ],  
    "allowNewTimeProposals": true,  
    "isOnlineMeeting": true,  
    "onlineMeetingProvider": "teamsForBusiness"  
}  

I tried just using the me/events endpoint and using a request body exactly like the doc's: https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http, but I received another 400 response. If it makes any difference, I am using the WebClient class in .NET 4.7.2.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,049 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.