Unable to get call details using MS graph API? - microsoft-graph-api

I am unable to get call details or call records using graph api.It's saying forbidden in response although I am using application token.In the docs I don't see any extra permission required for this.
Below are the details:
Method : GET
API CALL : https://graph.microsoft.com/beta/communications/callRecords/ce4e4e99-be1b-4c6e-8c43-22308f968d3e
Response :
{
"error": {
"code": "Forbidden",
"message": "",
"innerError": {
"request-id": "4e603f5c-3ac8-466c-acde-24e40f1d6309",
"date": "2021-06-17T13:51:08",
"client-request-id": "4e603f5c-3ac8-466c-acde-24e40f1d6309"
}
}
}
What is the basic requirement for this do I need to set some permission while call in order to get the call record as I am able to call user through graph API.Call.Records.All permission has been set for record and get data.
Please help.
Thanks in Advance.

The API works as it is with the same request but the only issue is that it will return response after certain cases.
The cases are :
1.The call must has ended.
2.Record has been created in the log of Microsoft which usually takes time.
3.Try running the same API with the same configuration but after around 10-15 minutes you will surely get the response.
Follow the document from MS docs for /communincation/calls. The only etxra thing which is not mentioned is that it return after 15min(approx.) call has ended.
This will help others not to get panic as I was.
Thanks

Related

issue with Microsoft graph api with forward slashes "/" in /me/events/{id}

I am having a similar issue to the post described here.
How to get an event ID from the HitID returned by a Microsoft Graph search query?
In my case I am not trying to do a patch, but just a lookup via the v1.0/me/events/{id} get request. I am using the search API of Microsoft graph API. It returns me a HitId with forward slashes in it. I tried to resolve it in the exact same way as the post describes, but cant seem to get it to work. My id parameter is:
AAMkADgwZjlhNmJjLWNiMGQtNGE5MS1hMDVkLTNkNTU2ZWE5ZmM5ZgBGAAAAAAAjq0f6CrWJSoJ6oKcYbrJfBwAyr2CWzX9CSrX7fgfr1AFOAAAAAAENAAAyr2CWzX9CSrX7fgfr1AFOAAV/rENQAAA=
I replaced the / with %252F and the call still fails. The new request id is:
AAMkADgwZjlhNmJjLWNiMGQtNGE5MS1hMDVkLTNkNTU2ZWE5ZmM5ZgBGAAAAAAAjq0f6CrWJSoJ6oKcYbrJfBwAyr2CWzX9CSrX7fgfr1AFOAAAAAAENAAAyr2CWzX9CSrX7fgfr1AFOAAV%252FrENQAAA=
which still fails in exactly the same way. To isolate the problem I used Microsoft Graph API explorer to test the request, which returns the following error message
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Resource not found for the segment 'rENQAAA='.",
"innerError": {
"date": "2021-03-18T07:48:24",
"request-id": "83cecc8b-f510-4cf0-b5f1-e4cd5f09e223",
"client-request-id": "530677e9-fa2d-a842-149e-a8db4939f3b8"
}
}
}
I cant seem to find any suitable documentation on how to resolve the issue.
Thanks in advance for any help.
Where ever you get / simply replace it with -. This will resolve your issue.

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

Calls to /events/ returning error: "This operation does not support binding to a non-calendar folder."

When making this GET request:
https://graph.microsoft.com/v1.0/me/events/{EVENT_ID}?%24select=id%2Csubject%2Ccategories%2CseriesMasterId",
The Graph API is returning HTTP 400 with the details below. I am unable to find documentation explaining this error. Any help would be greatly appreciated.
{
"code": "ErrorInvalidRequest",
"message": "Your request can't be completed. This operation does not support binding to a non-calendar folder.",
"innerError": {
"request-id": "8b92c8b2-3b52-4640-998f-cc07e56bdc27",
"date": "2019-04-26T21:17:18"
}
}
Update: This behavior seems to happen when querying for the status of an event that has been deleted by a user. Would be great for Microsoft to document this behavior -- assuming this is in fact intended.

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.

GraphApi API error codes

I am attempting to create a interface between our web application and the GraphApi.
I am currently struggling to handle error correctly as the documentation for graph API seems to be at best incomplete. Is there a reference to full list of errors one should expect.
An example of the issue is where I make a request after my access token has expired. The error code is not on the list (graph.microsoft.io docs/overview/errors page) and in a different format (capitalization). It also seems to vary drastically from the azure error codes such as "Request_BadRequest". This was found in an MSDN article titled "Error codes and error handling | Graph API concepts".
The document states "You may use the information returned here instead of, or in addition to the HTTP status code returned.". However, this is really hard if they are changing despite being out of beta.
example of an error response body:
{ "error": {
"code": "InvalidAuthenticationToken",
"message": "Access token has expired.",
"innerError": {
"request-id": "267438d2-4cc5-4621-9307-2af26d2f5b49",
"date": "2016-02-16T13:30:24"
}
}
}

Resources