MS Graph: Get all users by manager id - microsoft-graph-api

I'm trying to gather all users with a given manager's id.
It seems that MS graph has a bug here.
My query:
https://graph.microsoft.com/v1.0/users?$filter=manager/id eq '0f3b8a2f-8bec-4694-8021-dbfc55eed287'
I expect this query to return all the users that belong to the manager with the given id.
However, this query returns the manager and not the users. But I clearly filter the id of the manager related property and not the user's id.

There's an API specifically for this, List directReports.
You can get the users assigned to the manager with id 0f3b8a2f-8bec-4694-8021-dbfc55eed287 like:
GET /users/0f3b8a2f-8bec-4694-8021-dbfc55eed287/directReports

Another way would be
GET /users/0f3b8a2f-8bec-4694-8021-dbfa55eed297?$expand=directReports

Related

MS Graph API - how to retrieve declined events?

Let's say person B sends a calendar event invite to person A. When we then run the following query for person A, we can see the event in the response with responseStatus.response="notResponded", which is fine:
https://graph.microsoft.com/v1.0/me/events?startDateTime=2023-01-11T23%3A00%3A01.000Z&endDateTime=2023-01-12T23%3A00%3A00.000Z
However, when person A declines the invitation, then the event disappears from the response.
Is there a way to modify the query or use a different endpoint to still have access to the declined events?
I tried to look for the solution in the MS Graph API docs, but couldn't find any hints.
responseStatus property doesn't support filtering but as an alternative you can use extended property PidLidResponseStatus and filter those events with PidLidResponseStatus equals to respDeclined int value 4.
https://graph.microsoft.com/v1.0/me/events?startDateTime=2023-01-11T23%3A00%3A01.000Z&endDateTime=2023-01-12T23%3A00%3A00.000Z&$filter=singleValueExtendedProperties/any(ep:ep/id eq 'Integer {00062002-0000-0000-C000-000000000046} Id 0x8218' and cast(ep/value, Edm.Int32) eq 4)
But if declined event is remove from the calendar then it cannot be listed.
Documentation:
PidLidResponseStatus

Microsoft Graph API: How to use Get Call Method?

I'm using the Microsoft Graph API to retrieve information about Microsoft Teams.
Now i want to retrieve information about the call using the method in the documentation below:
https://learn.microsoft.com/en-us/graph/api/call-get?view=graph-rest-1.0&tabs=http
Here is written that i have to use the following url:
GET /communications/calls/{id}
The thing is that i don't know what is the id i need to use because in the documentation is not specified.
I try to use the group id, channel id and personal id of Teams but none of them works. Somebody knows how to use this method?
Thanks
See Properties of call resource type, id is the call id. Read-only.
When you create a call, you will get an id in the response. see the response sample.
When you need to get the call, just put this id value into GET https://graph.microsoft.com/v1.0/communications/calls/{id}.

How to query/filter from Microsoft Graph all groups where a user is owner

I would like to query from Microsoft Graph all groups where a specific user is owner.
I tried the following query:
https://graph.microsoft.com/v1.0/groups?$filter=owners/any(owner: owner/id eq '4dc60fe7-8009-4131-a4e9-80dc5e86f98f')
Unfortunately this returns a 400.
Does anyone know the correct OData query? Or is this not even supported by MS Graph?
It's not possible to filter on owners. The documentation states which properties can be $filter'ed.
Look for
Supports $filter
in the description of each property.
You are going to have to read all groups, pull out their owners, and do the filtering client side.
The memberOf endpoint returns all the groups of a given user:
https://graph.microsoft.com/v1.0/users/{ID or email}/memberOf
Will return:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"value": [
{
"id": "XXXX-XXXX-XXXX-XXXX",
"displayName": "The group name",
"...":"...",
}
]
}
It is possible to get all groups with owners using single API call like this:
https://graph.microsoft.com/v1.0/groups?$expand=owners
and then select groups which have current user in owners collection.
You could use List ownedObjects graph API to do that where it gets the list of directory objects that are owned by the user.
But as the question is specifically about getting the list of groups that a user is owner of, you can use the below graph API where it gets the list of directory objects with odata.type as microsoft.graph.group:
GET https://graph.microsoft.com/beta/users/{User Object ID}/ownedObjects/microsoft.graph.group
And if you just want to get the group name and group ID, you can use $select,
GET https://graph.microsoft.com/beta/users/{User Object ID}/ownedObjects/microsoft.graph.group?$select=displayName,id

Eventbrite VenueID is missing

I am making a call to;
https://www.eventbrite.com/xml/organizer_list_events?id=MYID
and getting a collection of event returned. I am integrating this data into an internal event system.
However, periodically I will get a venue without an ID. This means I cant add the venue into the system as I have no way of checking for duplicates before it is imported.
Show the VenueID always be returned? If not, under what circumstances would it not be returned?
The venue Id will not be returned if there is no venue, e.g. if the event is a webinar / online only event or the venue is not yet chosen

How can I get a list of all the venues that are "Managed" from Foursquare API

I am currently using Foursquare API to query out a list of venues.
However, I need to query out some specific venue that are "managed". (Managed means the venues whose owners have a Foursquare account and use Foursquare for the business)
However, I can't use the way in "https://developer.foursquare.com/docs/venues/managed" to get the result because it is only for the current user.
I check the venue search response and found that there is a value called "verified"(https://developer.foursquare.com/docs/responses/venue). Is that means "managed"?
The "verified" attribute indicates that the venue has been claimed by its owner. See https://developer.foursquare.com/docs/responses/venue for more information.

Resources