List Channel Messages using Application Permissions - microsoft-graph-api

I have an Application which accesses channel messages in Microsoft Teams. We have been using the "Group.Read.All" permission for the last few months to access these messages, but just today we have started getting 403 for these requests? Has something changed?
I appreciate the docs flag this as "Not supported" but it has been working with no issue until today.
We are trying to use the following request;
https://graph.microsoft.com/beta/teams/{id}/channels/{id}/messages
However we are now getting a 403 Forbidden response;
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "xxx",
"date": "xxx"
}
}
}

It looks as though Microsoft has locked down these particular permissions and you'll need to request access to them for your particular app. See their documentation here: https://learn.microsoft.com/en-us/graph/teams-protected-apis

Related

HTTP 400 for graph /sites endpoint - Error authenticating with resource

I'm getting an HTTP 400 on a request for https://graph.microsoft.com/v1.0/sites?search=* but expected response is an HTTP 200 w/ data.
It works successfully in multiple client environments (i.e. 100s of environments), but it doesn't work for one of our clients.
The application does successfully return calls for /groups, /domains, and other endpoints prior to hitting this HTTP 400.
The error is:
Error authenticating with resource
Response from remote side is:
{
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"request-id": "1d68c066-dba8-487e-b3a8-bd77f517d394",
"date": "2019-06-25T18:50:31"
}
}
I'm not sure the next steps from here. HTTP 400 suggests a malformed request, but I'm guessing this should actually be an HTTP 403 or 401 response instead of a 400?
Not sure how to resolve, please let me know, thanks!
edit: request-id added back in
If you're able to call other resources the same way (i.e. /groups), it would suggest a lack of permissions. Be sure the app or user authenticating has the required permissions:
Delegated (work or school account): Sites.Read.All, Sites.ReadWrite.All
Delegated (personal Microsoft account): Not supported.
Application: Sites.Read.All, Sites.ReadWrite.All
Documentation here

how to get the permission of the youtube analytics api for a channel

my fellow created a project at google console, and he can always use the youtube analytics api to query a specific channel through oauth. Then he appointed me as an owner of the project, but when i used the same parameter to query the analytics api, it said i had not permission, as follow:
403
- Show headers -
{
"error": {
"code": 403,
"message": "Forbidden",
"errors": [
{
"message": "Forbidden",
"domain": "global",
"reason": "forbidden"
}
]
}
}
I think it's because i have no relative permission for these channel. but i have no idea how to get the permission of the youtube analytics api for a specific channel.
And i am confused that how is the project which is created in the google console associated to a youtube channel? Is't by the account who creates them?

Microsoft Graph API - Read and write user's outlook tasks

I am developing an application which can read and write user's outlook tasks. I'm able to read the tasks assigned to my user id with the below API.
https://graph.microsoft.com/beta/users/me/outlook/tasks
When I try to read other user's tasks by providing the userPrincipalName I'm getting 403 error.
Request: https://graph.microsoft.com/beta/users/support#foobar.com/outlook/tasks
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "05fab540-3638-4b61-95ef-f2470539f385",
"date": "2018-04-07T07:25:06"
}
}
}
I thought it is an application/delegated permission assigned to the application I have registered in Azure portal. But I doubt whether Microsoft allows us to read and write other user's task.
Please let me know whether it is possible to read other user's tasks.

Youtube API, key not working

I'm using Google API to develop a web app, to do this I need to interact with youtube and get the channel ID. According to google documentation I use this request
https://www.googleapis.com/youtube/v3/search?part=snippet&q=LorenzoSchaeffer&type=channel&key={YOUR_API_KEY}
where in "YOUR_API_KEY" I copy and paste my API Key found in the google developer console. but I get this response
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
while from google API explorer I get the correct output.
I don't know how to proceed, any solution?
This means either you're using the wrong API key or the API project that "owns" the API key you are using doesn't have the YouTube Data v3 API hasn't been activated for use with the project.
Go here for information on how to get started, get and API key (make sure to get an API key and not OAuth credentials): https://developers.google.com/youtube/v3/getting-started

Invalid Credentials for OAUTH from Youtube API

I am getting 401 Invalid Credentials error trying to use the Youtube API in the OAuth 2.0 Playground.
Response is:
{
"error": {
"code": 401,
"message": "Invalid Credentials",
"errors": [
{
"locationType": "header",
"domain": "global",
"message": "Invalid Credentials",
"reason": "authError",
"location": "Authorization"
}
]
}
}
Steps can be reproduced here.
Select Manage Youtube account API
Authorize
Get access token
Attempt to call any Youtube API (you may need to plug your own API key in as well)
The access token is valid (non-Youtube API calls work fine) and I have tried this with a number of different accounts which have Youtube accounts and channels set up (so the reply here is not what's happening).
The API works fine in the Try it Now section here so this is quite strange.
Maybe somebody can try these steps with their account and verify if the outcome is the same or not?
You have to choose the "Use your own OAuth credentials" option in the settings of the OAuth Playground (link at the top right corner).
You also need to add the following URL to the list of Redirect URIs of you project in the Developers Console:
https://developers.google.com/oauthplayground
If you do that, you don't need to pass the API key.

Resources