Best ways to fetch files/folders that shared by different people with same name using 'SharedWithMe' Microsoft Graph API - microsoft-graph-api

I can fetch all the Shared Items by making a GET request.
Get https://graph.microsoft.com/v1.0/me/drive/sharedWithMe
However, if two different people shared two items with the same name I'm just getting one item.
I can modify the names of the items using C# before fetching them but I want to know if there's a better way to get the duplicated items using Microsoft Graph API.

Related

Graph API for accessing teams and team's groups to pull documents

I am working on asset management system in which my application needs to pull specific documents of all the employees being stored by them on teams or any teams group.
Using graph API or any other medium, how can I achieve the same. Any suggestions or pointers will be helpful to start with.
Teams has a associated Group.
So you need to get the list of all the Teams first through (reference):
GET https://graph.microsoft.com/beta/groups?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')
Then you can traverse this list to get the Group (Teams) id.
Get the channels in an Teams like this (reference):
GET https://graph.microsoft.com/v1.0/teams/{Group id}/channels
Record the channels' name.
Now use this call to get the files stored in a Teams channel (reference):
GET https://graph.microsoft.com/v1.0/groups/{Group id}/drive/root:/{channel name}:/children
You need to implement multiple loops to get all the files stored in Teams.
UPDATE:
Using the following request to list the items in the Teams:
GET https://graph.microsoft.com/v1.0/groups/{Group id}/drive/root/children
You can get the item id of General folder from the response.
Then you can get the files under General folder through:
GET https://graph.microsoft.com/v1.0/groups/{Group id}/drive/items/{item id}/children

How to make a request to get all information of a tenant like microsoft teams does?

I was reading the Microsoft Graph API Documentation to batch queries right here and did not find what I need.
Basically I need to combine two or more requests but one depends to another value. I know there is a "dependsOn" feature to wait the other request, it is not what I am looking for.
Request one: GET '/me/joinedTeams';
Request two: GET 'teams/{groupId}/channels';
The "Request one" returns an array of groups and inside these array values there's an id property. Can I batch these two requests using the value of ther first one to get the second?
I am searching a way to do a GET and return all values of one teant like the Microsoft Teams Application does, returning all teams, all chats, etc. Batching requests is the more closer we can get it I think.
Or there is another way to generate the token to https://chatsvcagg.teams.microsoft.com/api/v1/teams/users/me url like Microsoft does?
#Gaspar, multiple api calls can be batched using json batching but any interdependent calls batch can not handle.
If you have any dependency, you have to make separate calls.

How to list the deleted contacts by Microsoft Graph API

I want to do a sync action in my client side, so need to know how to get all deleted contact list.
By the api (GET /me/contacts), I could get all contact list
But it wastes much time when the user has large contacts.
This api (GET /me/contacts/{id}) tell us the contact is exist or not.
it is inefficient to check every contacts are deleted or not for me.
Which apis do I use? thanks for your help.
Why not use the delta query preview in the /beta endpoint? That should do what you want.
More efficient way for you to check which contacts were removed is getting just the list of contact ID's and then doing the diff between list of ID's returned by graph, and local list.
You can use query parameters to retrieve just the ID's of the contacts, instead of getting the whole objects.
Method url:
https://graph.microsoft.com/v1.0/me/contacts?$select=id

Access Inbox items from the API?

Is there a way to access the items in a workspace's inbox via the API? I'm primarily interested in the unread count, but could make good use out of any unhidden items as well.
At the moment you can't do this with a simple API call.
You might be able to do it by pulling down all projects, and then pulling down all the tasks for each project, storing that in a local database, and then search for tasks with assignee_status set to "inbox" (https://asana.com/developers/api-reference/tasks). But that is probably not the answer you want!

Query for open tasks in Asana

We're looking at using Asana to combine CRM, administration and issue tracking in a web dev firm. The key feature we need is a view of the "next actions" or "top [1|2|3] priorities" across all projects in a workspace, irrespective of who they are assigned to. It seems Asana does not provide this out of the box (is that right?) so I am looking into writing API queries to pull this out into a dashboard of our own.
I understand you don't want to let people pull ALL tasks in one workspace, as it may grow, but is there a way to pull out the top few open tasks in each project, without having to specify the assignee?
(I work for Asana)
Currently, the API allows you to grab all tasks in a project, see https://asana.com/developers/api-reference/projects. It will return them in ranked order (the same as they would show up in the Asana UI), however it won't limit them to some number; you'll have to get them all. Limits and pagination are on our roadmap to enable developers to work more efficiently with larger projects and workspaces.
So, it seems like you'd want to grab all projects, then iterate through them and query all tasks - this will give you their name and ID by default. If you want more detail for the ones you're going to show, then I recommend querying the details on each of those tasks individually.

Resources