Unable to update organization properties - microsoft-graph-api

I've encountered a problem while trying to update organization's properties using Microsoft Graph API. I've followed these docs and tried it in graph explorer.
My request looks like this:
{ "displayName": "My Company Name" }
Whatever I do I always get the following error:
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"request-id": "dfd9ae19-2774-4b10-8d74-f6f6cd21f712",
"date": "2016-05-16T14:48:02"
}
}
What am I doing wrong?

I have tried in my test tenant and results in the same error.
https://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/organization
In the above document it is mentioned that we can update "marketingNotificationMails" and "technicalNotificationMails" properties alone through Update API. So I think you can't update the organization display name.

It does appear as though updates are limited on the organization entity. Please file a request to Uservoice to ask for this feature.

Related

List events API call on Microsoft Graph Java SDK doesn't work for #outlook.com domain

When I tried the following GET request using Microsoft Graph explorer:
https://graph.microsoft.com/beta//me/calendars/joseph.baker.doodle#outlook.com/calendarView?startDateTime=2019-10-24T07:40:43.133Z
I got this response:
{
"error": {
"code": "ErrorInvalidIdMalformed",
"message": "Id is malformed.",
"innerError": {
"request-id": "7ffa9b3c-b5bf-4171-b5ad-242dd831b629",
"date": "2019-11-21T06:30:12"
}
}
}
When I try it with user's calendar ID:
https://graph.microsoft.com/beta//me/calendars/AQMkADAwATM3ZmYAZS0yNDI1LTEwMmMtMDACLTAwCgBGAAADWt9re56XX0ay-rq-yg7yKwcA94f8IFhbyEuRrCHknQvqSwAAAgEGAAAA94f8IFhbyEuRrCHknQvqSwAAADW523EAAAA=/calendarView?startDateTime=2019-10-24T07:40:43.133Z&endDateTime=2019-10-31T07:40:43.133Z
Also for an account with #onmicrosoft.com:
https://graph.microsoft.com/beta//me/calendars/joseph.baker.doodle#onmicrosoft.com/calendarView?startDateTime=2019-10-24T07:40:43.133Z
It works as expected.
Can somebody help me with this? Is the issue domain-related?
Calendars are always referenced by id instead of name. Also, since Outlook.com is a single-user platform, it simply isn't possible to reference another user's resources.
I'm frankly surprised /me/calendars/joseph.baker.doodle#onmicrosoft.com/ since this is not a supported/documented address scheme.

Unable to delete AppRoleAssignment using Beta Graph API

I'm using the Graph API beta endpoint to try and delete an AppRoleAssigmnet:
https://graph.microsoft.com/beta/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM
I am using the DELETE verb and below is the response I get back:
109
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Direct queries to this resource type are not supported.",
"innerError": {
"request-id": "aa7c14a3-f700-4368-898e-009f1608ade1",
"date": "2019-04-30T00:29:50"
}
}
}
0
According to the beta documentation, this is allowed:
https://learn.microsoft.com/en-us/graph/api/approleassignment-delete?view=graph-rest-beta
I also verified the correct permissions according to the documentation as well.
I know this is a beta endpoint but any chance this will be fixed soon or do I need to use the Azure AD API instead?
UPDATE
I tried going through the users collection and it also fails:
https://graph.microsoft.com/beta/users/7e73da23-31d7-4eff-9a0b-05fcb15f5c9b/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM
I am using the DELETE verb and below is the response I get back:
fb
{
"error": {
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
"innerError": {
"request-id": "b6db0eee-dc45-4e10-a56c-9a870fb7315c",
"date": "2019-04-30T23:49:24"
}
}
}
0
I tried going through the service principal collection and it also fails:
https://graph.microsoft.com/beta/servicePrincipals/27e0a182-2008-4b4e-b998-731e0d111041/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM
I am using the DELETE verb and below is the response I get back:
18b
{
"error": {
"code": "BadRequest",
"message": "The type 'microsoft.graph.appRoleAssignment' does not inherit from and is not a base type of 'microsoft.graph.directoryObject'. The type of 'KeySegments' must be related to the Type of the EntitySet.",
"innerError": {
"request-id": "8c981e82-755e-4c25-b448-58d2b71e12c7",
"date": "2019-04-30T23:46:20"
}
}
}
0
I'm afraid this service bug has existed for a very long time. The only thing I can say is to try this with AAD Graph until this is fixed in Microsoft Graph. The schema unfortunately models appRoleAssignments as a standard relationship, whereas in fact it is implemented as a contained entity (i.e. you can only operate on the app role assignment when it is contained as part of another entity - like users, groups or servicePrincipals). The schema definition needs to be updated. The documentation is accurate IMHO.
Hope this helps

"UnknownError" when trying to GET https://graph.microsoft.com/beta/teams/{id}/channels/{id}/messages

When trying to get messages as Admin (with Group.Read.All scope) I am getting following error:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "fc234750-dd35-4748-a1b3-baf4a7c5267c",
"date": "2018-11-14T09:16:55"
}
}
}
Getting teams and channels works.
I tried the same using my user (not an admin, just regular user that created the conversation) in graph explorer and everything works ok.
Is this a bug or a feature (only user giving his permission explicitly allows the app to read conversations) ?
Are you a member of the team? Admins don't get special privileges when working with messages – in order to read a message, they have to be a member of the team like anyone else.

Microsoft Graph SharePoint access items (read/write)

I am attempting to create a new list item in SharePoint Online using the [beta] Microsoft Graph endpoint. The goal is to call Microsoft Graph from an Outlook Add-in but the problem persists on Postman.
When I call the endpoint as per the documentation I get the following error message:
{
"error": {
"code": "unauthenticated",
"message": "The caller is not authenticated.",
"innerError": {
"request-id": "bb094f39-71c9-4c7d-9d9b-913cc9622baf",
"date": "2017-08-08T11:32:02"
}
}
}
I'm using ADAL JS to fetch the authentication token and I initialized my AuthenticationContext with my tenantID. My app has the following permissions: offline_access, Sites.Read.All, Sites.ReadWrite.All, User.Read
2nd Edit - more details on readItem
I use the https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items endpoint with the {site-id} of my desired site from /sites and the {list-id} of the list from /sites/{site-id}/lists but this is the empty response I get:
{
"#odata.context": "https://graph.microsoft.com/...",
"value": []
}
If I try to to add /{item-id} to my original call to access specific item I receive this response:
{
"error": {
"code": "itemNotFound",
"message": "The specified list was not found",
"innerError": {
"request-id": "6e7ccae3-3aee-4dbb-ae3e-de61250478e0",
"date": "2017-08-09T13:13:33"
}
}
}
Which doesn't make sense because I can retrieve valid information about the list if i make the call without /items/..
Any and all input appreciated :) I'll gladly provide more code, this is all I deemed relevant and didn't want to overcrowd the post.
might be that you actually don't have an item with that id, since https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items/1 works for me.
test the id's you really have by just https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items and each item returns it's id.

Micorsoft Graph API Responsibilites Update

I am attempting to update the responsibilities field on a user account through the Graph API.
I am attempting to do this using the following request:
PATCH https://graph.microsoft.com/v1.0/users/<upn>
{
"responsibilities":[
"ApprovalLimit:0"
]
}
When i make this request, I get the response:
{
"error": {
"code": "-2147024809, System.ArgumentException",
"message": "Invalid attribute update\r\nParameter name: attributeUpdates",
"innerError": {
"request-id": "1be313f3-880b-47de-858d-1bea74951715",
"date": "2017-03-06T09:29:21"
}
}
}
However, when I attempt to update the schools collection, which is also a String collection, this works without issue.
This is the same with both beta and v1.0 and also with the /me endpoint rather than /users/<upn>.
Is this a bug within the API?
Any ideas about how to set this?
Thanks in advance.
I am also able to reproduce this issue too. Based on the error message, it seems this attribute is not support update at current version of Microsoft Graph.
If you want to this attribute is update-able, I suggest that you submit the feedback from here.

Resources