I am integrating an application with the MS Graph API. The application will create Teams with files and folders, and also create events on users' calendars. Everything was working fine in our commercial Graph environment, but when we tried all the same requests against our US National Cloud environment (graph.microsoft.us) we ran into problems.
Posting to /teams/{team id}/members returns a 404 every time. The request is formatted exactly like the example: https://learn.microsoft.com/en-us/graph/api/team-post-members?view=graph-rest-1.0&tabs=http
Posting to me/events or /users/{userPrincipalName}/events returns a 400 every time. I even tried manually formatting the request exactly like the example with changed dates and addresses to no avail: https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http
I can post various other requests. For example: the app creates a Team, adds folders to the default channel, and modifies permissions on those folders before trying to execute the requests that fail.
I receive the errors using the v1.0 or beta versions of the API.
I'm not sure that it matters, but I'm using the WebClient class in .NET 4.7.2 with C#.
Failed Event Request:
POST https://graph.microsoft.us/beta/users/<my email>/calendar/events
{
"subject": "Some - Meeting - Name",
"body": {
"contentType": "HTML",
"content": ""
},
"start": {
"dateTime": "2021-07-08T21:00:00",
"timeZone": "UTC"
},
"end": {
"dateTime": "2021-07-08T22:00:00",
"timeZone": "UTC"
},
"location": {
"displayName": "Virtual"
},
"attendees": [
{
"emailAddress": {
"address": "<My email>",
"name": "<My name>"
},
"type": "required"
},
{
"emailAddress": {
"address": "<colleague email>",
"name": "<colleague name>"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness",
"transactionId": "fa3b8eb3-02b0-435a-ab29-5019cab134eb"
}
Response
request-id: 51351ca3-9354-4eae-8d8c-d09f168594ab
client-request-id: 51351ca3-9354-4eae-8d8c-d09f168594ab
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"USGov Arizona","Slice":"SliceC","Ring":"4","ScaleUnit":"000","RoleInstance":"AGSFE_IN_0"}}
Strict-Transport-Security: max-age=31536000
Content-Length: 243
Cache-Control: private
Content-Type: application/json
Date: Thu, 08 Jul 2021 00:05:47 GMT
Body:
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize ",
"innerError": {
"date": "2021-07-08T00:05:48",
"request-id": "51351ca3-9354-4eae-8d8c-d09f168594ab",
"client-request-id": "51351ca3-9354-4eae-8d8c-d09f168594ab"
}
}
}
Failed Add Member Request
POST https://graph.microsoft.us/beta/teams/<team-id>/members
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": [],
[email protected]: https://graph.microsoft.us/beta/users('<user guid>')
}
Response
{
"error": {
"code": "NotFound",
"message": "Not Found",
"innerError": {
"date": "2021-07-08T00:35:13",
"request-id": "b488d292-2733-4512-a759-507a3a58bdbb",
"client-request-id": "b488d292-2733-4512-a759-507a3a58bdbb"
}
}
}