Microsoft Graph API - Unknown Error when querying Shifts - microsoft-graph-api

When we query the shifts endpoint (in beta ver 0.7.0) with the following code:
var shifts = await graphClient.Teams[$"{this.teamId}"].Schedule.Shifts.Request().GetAsync();
We get the following exception
This was working ~40 days ago with the beta but now we get this error. We can query teams fine so we know the team ID is working but whenever we try to access shifts we get the above error.

Your client code is correct.
I was able to reproduce your error with Graph Explorer by trying to make the call with a user who hadn't consented to the Group.Read.All or Group.ReadWrite.All scopes.
Take a look at your access token using jwt.ms. Please add the missing scope to your application registration.

Related

Get List of Teams from Graph API now returning Auth Error. Was working 2 weeks ago, what changed?

We have built a feature on our project that utilizes the Graph API to retrieve all of the user's joined teams. The last time I know that this feature was working flawlessly was on Nov 3. Now I'm getting the following error when I tried to perform the query:
Code: AuthenticationError
Message: Error authenticating with resource.
The query is:
var teams = await _graphClient.Me.JoinedTeams
.Request()
.GetAsync();
We have other queries that utilize this graphClient and they work just fine, so I don't think there are any issues with my bearer token.
var user = await _graphClient.Users[userEmail]
.Request()
.GetAsync();
var userDetails = await graphClient.Me.Request().GetAsync();
We're getting close to deployment so I'm getting a bit nervous. Does anyone have any ideas?
Edit: We still have User.Read.All in our permissions.
The error is not a regular API response/error that returned for the above API call. So its tricky!!
Above error is telling that its failing due to authentication and it's related to compliant policies related to device, enrolled part of an organization.
Based on the suggestion, you validated, confirmed that the issue is
not happening with domain joined machine, but with the personal device which is not enrolled in the domain, nor it has the compliant policies.

Graph API /me/joinedTeams unexpected result

I'm having some issues with the List joinedTeams graph api endpoint.
I was expecting that me/joinedTeams would give the same result as users/my-user-id/joinedTeams, however the first one only returns one team and the second returns multiple (haven't checked if it's complete).
So the question is, did I find a bug in the Graph API or is there something else going on?
I'm using delegated permissions
I've checked the token at jwt.ms, the aud is 00000003-0000-0000-c000-000000000000 and it includes the following scopes:
Directory.Read.All
Group.Read.All
Member.Read.Hidden
Team.ReadBasic.All
User.Read
Update: It seems I can no longer reproduce the issue, so I'm concluding that there was some short issue with syncing between the Azure AD and the responding Graph API server.
My idea is the same as #Ergec, you need to make sure you are using the same user id.
I just tested these two APIs with graph-explorer and they did return the same result to me.
I suggest you first request the /me endpoint to get the id, then paste it to the /users endpoint, making sure they use the same id.
1.
2.

Unable to get channels using graph api

while fetching channels from the team using graph API is not working. It is not working from today. I am getting the following exception.
https://i.stack.imgur.com/tA1Qv.png
I tried the same with code that worked just fine 3h ago to get channels from a specific team. Now I'm getting the same exception. Same Exception when using Graph-Tester.
Coworker tried it aswell with Graph-Tester, apparently it works just fine for her. Seems like its user related. Propably a bug on Microsofts side.
It seems that it could be a bug. I'm confirming that right now GET /teams/[-groupid-]/channels fails for Delegated permission type requests, both for v1.0 & beta with a 400 Bad Request "Failed to execute Skype backend request GetThreadS2SRequest."
However, it's working for me (200) when I use Application permission type in Postman.
It was fixed by the Microsoft Graph team. Now it's working fine. It's not the only problem with channels. It's a problem with team endpoint API. The graph team is fixed the API related issue.

Online meeting using Microsoft Graph API

I am working on an Angular 7 application that uses GraphAPI. I am trying to create an online meeting from this application.
Each time I send a POST request I get 'Forbidden' as response. I have used apis's with Delegated permission before and it works.
Since online meeting requires 'Application Permission' I am not sure where to specify it. Could anyone help me with this?
You specify the permissions in App Registration > your app > settings.
You have a problem with the way you are trying to access the token. I used to get the same error however, got resolved by passing userName and Password as well in the auth request and using grant_type as password.

Facebook API App Access Token

I've been using for many years my FACEBOOK_APP_ID|FACEBOOK_APP_SECRET as an app access token for accessing the facebook API, but lately it seems to be giving me not up to date data.
For example, on this page:
https://www.facebook.com/pg/Vallagruppen/posts
If I just view in the graph explorer with the default access tokens, I get the correct results:
https://developers.facebook.com/tools/explorer/?method=GET&path=Vallagruppen%2Fposts&version=v2.11
But if I change the access token in the explorer to one like above, with an APP_ID|APP_SECRET I am suddenly not getting all the posts, the newest few are not showing up.
Additionally it will say: "Access Token Info Warning Failed to debug token"
Any idea why?

Resources