Microsoft Graph API reports : error 404 UnknownTenantId - microsoft-graph-api

When trying to retrieve data from a v1.0 report endpoint on a demo tenant, for example:
https://graph.microsoft.com/v1.0/reports/getOffice365ActiveUserCounts(period='D7')
I get this strange result:
{
"error": {
"code": "UnknownTenantId",
"message": "We do not recognize this tenant ID 3d64a....7279c0. Please double-check the tenant ID and try again.",
"innerError": {
"request-id": "7b7b8....8029b",
"date": "2018-04-30T09:32:46"
}
}
}
Instead of an HTTP 302 redirection to get the CSV report results (according to the doc).
I'm trying from Graph API Explorer, authenticated as tenant admin account, this has worked as expected before tenant expiration + extension (a few hours ago)
I will try in a few hours again, tomorrow etc. (I'll write the results here) because this error looks to be related to tenant expiration (or else, what is happening?)...

Related

"Unknown Error" in Microsoft Graph API Get Staff Availability in MS Bookings

When trying to make a request to the graph API endpoint for getting staff availability info on MS Bookings I keep receiving the below error which returns status code 500. I had followed the guide here and also decoded my access token and verified I had the right permissions.
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2022-07-25T08:21:46",
"request-id": "aa302590-9a6e-47a4-a5ac-51a12ef5e72e",
"client-request-id": "aa302590-9a6e-47a4-a5ac-51a12ef5e72e"
}
}
}
I also encountered the same error in graph explorer.
Well this seemed to work for me when I changed the timeZone value on the request payload from my local time zone to 'UTC'. So my request payload was changed as below
However same error persists on graph explorer - guessing its because application permissions are not currently supported on graph explorer

Solved: No results for /sites?search= using Microsoft Graph

Using Microsoft Graph, I want to search for SharePoint sites containing specific names and moreover I want to get a list of all SharePoint sites.
I am using the following URL in the Graph Explorer:
https://graph.microsoft.com/v1.0/sites?search=test
or
https://graph.microsoft.com/v1.0/sites?search=*
When using an account from Company A everything works. I receive a list of all results.
But when using an account from Company B, I get a 404 NOT FOUND response for all queries (although there should be multiple results):
{
"error": {
"code": "itemNotFound",
"message": "Item not found",
"innerError": {
"date": "2022-01-01T14:59:35",
"request-id": "xxxxxx",
"client-request-id": "xxxxxx"
}
}
}
Maybe it has something to do with the rights of the users?
I tested with "normal" users at both companies.
Edit:
I also get an error (403 Access denied) using the following url:
https://graph.microsoft.com/v1.0/sites/root
But when accessing a specific site by it's id, everything works.
Edit 2
I noticed a relationship with the permissions of the root SharePoint site. If the user has no permission for that site, the mentioned queries are not working. I need to contact the admin of the system to check my suspicion.

Getting Unknown error while accessing MS Graph API

I'm trying to get the chat messages from MS team channel using API.
https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages
It works in graph explorer and returns the list of all chat messages. But when I hit the same API within Postman it return the following error:
I have consented all the required permission in azure app. What else am I missing here. Has anyone faced similar issues?
Please let me know.
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2021-04-20T04:01:46",
"request-id": "e32d3a2e-001c-4478-8c9c-8d5ff0c5e125",
"client-request-id": "e32d3a2e-001c-4478-8c9c-8d5ff0c5e125"
}
}
}
list channel messages is under protected API in MS teams. Before calling this API with application permissions, you must request access. To get the access you have to apply request access form

Microsoft Graph API: UnknownError when i am trying to get a call

I am trying to get the subject (ex. Maths 1) of an online TEAMS meeting via Microsoft Graph API.
When i send a request to https://graph.microsoft.com/v1.0/communications/callRecords/8f4477a7-f5b2-40ed-a165-95519825c9cg in the response there is no value for the subject of the meeting.
So my next move is to send a request to https://graph.microsoft.com/v1.0/communications/calls/8f4477a7-f5b2-40ed-a165-95519825c9cg because the Graph API documentation has the property 'subject' in the response. When i send this request i get this response:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2021-02-10T12:32:19",
"request-id": "9a81a114-8a58-457b-929v-390bda79669g",
"client-request-id": "9a81a114-8a58-457b-929a-490bda79669g"
}
}
}
with a response status code : 500 Interval Server Error from the Graph API.
I have tried this request with different meeting ids but the result is the same.
My API permissions are these:
API Permissions
I would appreciate it if I had a solution to my problem or some other way to find the subject of the meeting.
The reason why you are getting that error is because you are querying the teams meeting as a resource of type 'call' instead of 'event'.
Please use GET https://graph.microsoft.com/v1.0/users/{id |userPrincipalName}/events/{id} using Calendars.Read Application permission when querying as an application or GET https://graph.microsoft.com/v1.0/me/calendar/events/{id} with the Calendars.Read delegated permissions when querying as a signed-in user.
For further reference, have a look at https://learn.microsoft.com/en-us/graph/api/event-get?view=graph-rest-1.0&tabs=http

Get Tasks lists from Microsoft beta Graph API

I cannot GET data about the tasks when I use a personal account to login.
GET https://graph.microsoft.com/beta/me/outlook/tasks
When I use my company account to login the REST request works fine,
but when I use personal accounts ( ...#outlook.com, ...#hotmail.com, ...#live.com )the request return the error response:
{
"error": {
"code": "RequestBroker-ParseUri",
"message": "Resource not found for the segment 'Outlook'.",
"innerError": {
"request-id": "d7a97e67-358a-41fa-b70b-81a2096cb4cb",
"date": "2018-01-08T13:30:39"
}
}
}
Any suggestions?
The beta release of Graph's Outlook Tasks API doesn't support Personal/Outlook.com accounts at the moment. It is planned but there isn't an ETA available just yet.
Try: GET https://graph.microsoft.com/beta/me/planner/tasks
I'm not certain, but I think that may be what you're looking for

Resources