Graph API Beta - LearningProviders 401 - microsoft-graph-api

I'm trying to use the beta api of LearningProviders described here: https://learn.microsoft.com/it-it/graph/api/employeeexperience-list-learningproviders?view=graph-rest-beta
I'm in a tenant with the new viva integration activeted and in teams i can see correctly all the feature.
With an admin account i'm trying to use the API but I only recive 401 Error with the following body when I try to call the api /employeeExperience/learningProviders
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2022-07-29T12:50:14",
"request-id": "b985f230-5e34-4e95-9c03-4a192b9cd2e2",
"client-request-id": "b985f230-5e34-4e95-9c03-4a192b9cd2e2"
}
}
}
I tried both to call the API from the graph explorer (And i've added the correct permission to the Graph Explorer app registration) and also with a new app registration with the correct delegated permission.
I'm not able anyway to get any response.
Anyone facing the issue?
Thanks

thanks for reaching out to us .
Could you please decode your access token in http://jwt.ms/ and make sure you have LearningProvider.Read delegated permission added in your scopes .
please let us know if you have any query,
thanks
permissions - https://learn.microsoft.com/en-us/graph/permissions-reference#delegated-permissions-27

Related

MS Graph permission required to read group[id]/planner/plans, but all requested permissions are granted

I'm trying to use MS Graph to work with Planner tasks, and am currently investigating the API with Graph Explorerprior to writing any code. I'm at the point where I'm trying to list all Planner plans for a given group, using the query https://graph.microsoft.com/v1.0/groups/{c6a12d05-ac5d-4e84-a924-f8be570d75d4}/planner/plans. I'm getting a 403, but when I look under the Modify Permissions tab I already have all four of the suggested permissions:
Am I missing something?
EDIT
This is the error response:
{
"error": {
"code": "",
"message": "You do not have the required permissions to access this item.",
"innerError": {
"date": "2023-01-13T14:48:07",
"request-id": "61a39484-fd91-47da-be0f-7e6d5e6e9955",
"client-request-id": "d912b37f-b872-3753-e7f6-f4000d8e7998"
}
}
}
As I can see from the screenshot in the permissions page, the following permissions Group.Read.All and Group.ReadWrite.All are not admin consented as seen in the screenshot below
Please ask your admin to grant you those permissions.

Microsoft exchange graph API Unable to delete Conversation

I am invoking Micosoft graph API's to integrate its functionality in my custom application.
When I go to invoke API to delete conversation using group id and conversation ID, I get below response . I am looking at API as mentioned in official Graph API docs. Any idea what is wrong ? I have Group.ReadWriteAll permission for User
{
"error": {
"code": "ErrorInvalidOperation",
"message": "ConversationId isn't supported in the context of this operation.",
"innerError": {
"request-id": "d90689bb-6a3d-4e51-b538-58ecaafaa626",
"date": "2020-05-04T11:02:27"
}
}
}
Conjecture since I don't have enough information:
Currently, DELETE conversation is only supported for delegated access for organizational or school accounts. You cannot use DELETE conversation for application access (when there is not interactive login). You also can't use it with delegated access for personal accounts (outlook.com).
Please provide a sanitized URL and request body as that will make it easier to answer this question.

Microsoft Graph API - Get Groups - Permission Error

I am trying to get a list of groups from https://graph.microsoft.com/v1.0/groups with the correct application permissions. I created an application in portal.azure.com and added application permissions (generated client secret etc). This seemed to be working but after adding and removing other permissions the application stopped working so I set up a new application (new client id and secret) with the same permissions when it was working and all expected calls are working expect https://graph.microsoft.com/v1.0/groups for which I get this error:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"request-id": "adad2794-0000-43f6-812c-091acec39f7c",
"date": "2020-03-06T12:18:58"
}
}
}
I know the GUID for one of the groups and I can call the APIs for listing group files without and problems but just can't list groups!
Is there a permission I need to add that I'm missing? I'm sure I've added the required permissions, see screenshot.
Thanks.
try Directory.Read.All
Group.Read.All means that you can read everything about a group.

How to create an event into a group

I'm using Microsoft Graph API v1 with Administrator credentials via my software to create Events in a Group. However the response I get is a 403 with the following:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "c4754c79-5e3a-4f63-9f88-404100513796",
"date": "2018-07-11T10:11:27"
}
}
}
on a POST request to https://graph.microsoft.com/v1.0/groups/{idGroup}/events/
I have checked all rights provided to the app via Azure AD and everything is fine (tokens, code and scope with Group.Read.All Group.ReadWrite.All). The Group is also created, the users are added to it and the owner is the admin I use for the create request.
I have also tried on the Microsoft Graph API Explorer but i have the same error.
Yesterday morning the creation was possible but I think some rights were corrupted. Is anybody has got this problem before? How to fix it?
After a few days without any changes in the code the problem dissapeared.
I am still not sure of what happened, anyway thanks guys !

Could not obtain WAC Access Token

I am trying to create a worksheet using the Graph API and getting the below error. Everything on the URL seems right and I am unable to figure out what is causing the error. There is little help on the Graph API documentation also!
URL:
https://graph.microsoft.com/v1.0/me/drive/items/01FUAEYJMWQZF5VGFFL5G27P5AGS5M2FXD/workbook/worksheets
Error:
{
"error": {
"code": "AccessDenied",
"message": "Could not obtain a WAC access token.",
"innerError": {
"request-id": "44990b81-a8ee-489f-9fd8-d5f7c9a31bf1",
"date": "2018-05-07T14:02:08"
}
}
}
Microsoft documentation:
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/worksheetcollection_add
Any pointers to the solution or what I might be doing wrong is appreciated. Thanks.
According to this post, "WAC is basically a designation for the Office web apps".
So this error probably means that something is tripping up the Graph server (in the file access authentication logic?), but the reported error is not specific enough, hence the generic "WAC Access Token" error.
This worked for me:
Make sure the file is in Sharepoint, not OneDrive (Microsoft Graph doesn't seem to play well with Excel files stored in OneDrive - I think I saw this on Reddit)
Is the file extension .xlsx? (According to this answer, .xltm can cause this error)
Does your user have the Files.Read permission?
Make sure you're using Delegated User permissions from and not Application permissions (GitHub issue)

Resources