Get modified teams and team channels - microsoft-graph-api

I'm trying to sync teams and channels between Microsoft Teams and some internal database.
I noticed that:
Neither groups, nor teams, nor channels have a concept of "last modified time". The documentation suggests to use delta queries instead.
It seems that among these three resources, only groups support delta queries. When I try to use delta queries for teams or channels, I get an error.
Groups are not considered modified if a channel is added to (or removed from) a corresponding team. Also, if a channel is renamed, the teams' group is not considered modified either.
So questions:
Is it really not supported to get modified teams and/or channels? Or am I missing something?
Is it planned to add such a functionality to Microsoft Teams Graph API?
The situation is even worse than it seems on the first look, because even if I enumerate ALL the teams and ALL the channels, I cannot say which ones have been modified since last time I enumerated them, because they don't have anything like "last modified time", "version" etc. For instance, if I rename a channel (or edit its description), I won't be able to figure that out during subsequent sync.

At the moment the only Microsoft Teams entity that supports delta queries are Chat Messages in channels. See the documentation for supported entities across the Graph.
To request additional entities support, please go to uservoice and upvote existing ideas or create new ones.

Related

Is there feature of retrieve group member history (when created or deleted) in microsoft graph api?

As the title says, I'm curious.
I know that graph api has a function to look up group members, but it seems impossible to track the addition or deletion of members between those requests.
Plus, the exact dateTime that was added or deleted as additional members.
Thanks for your help.
Check the concept of using delta to tracking changes in groups.
Documentation
delta query overview
get incremental changes for groups
group: delta

How to get total workspace (team) user count via Slack API?

I am trying to get the total number of users within a Slack workspace. Just the count.
Things I've considered:
Iterating over the users.list
Unnecessarily heavy on the API and gets me waaaay more data than I need (the less I know about the users, the better imo)
Includes inactive users (so cannot get a proper indication without iterating over everything)
Using conversations.info
Requires a scope that I currently don't use (channels:read). Getting read access to channels seems like a very intrusive permission (even though my app doesn't use it and I don't want to scare off users by requesting this sort of information).
Is there an easier way to getting this information or any ideas I have not considered yet? Let me know!
You could make a call to [conversations.members][1] for the #general channel. It won't return a total number of users but it will return a list of all user ids pertaining to members of that channel, you'd just need count the ids on your end. Every user on a workspace is automatically added to the #general channel. No one can leave that channel nor can it be deleted or archived so it's sure to have the most accurate count of total workspace users. The conversations.members method does require the channels:read scope though so that's something to keep in mind.

MS Graph API endpoint /v1.0/me/planner/plans doesn't return all my plans

In the past I was reading a list of plans of current user with this REST call of the beta-API:
https://graph.microsoft.com/beta/me/plans
In July 2017 the planner API was released and there are also some minor changes to the endpoints, so the REST call in the V1.0-API now is:
https://graph.microsoft.com/v1.0/me/planner/plans
Unfortunately I do not receive all my plans with that endpoint. Apparently I only get plans that exist for a long time, but any newly created plans are not visible. I tried a lot of actions on my plans like subscribing to, assigning tasks to me, favorize the plan in planner hub, making a plan public or private, but nothing helps, new plans remain invisible in the API.
Can anybody explain what the new endpoint exactly does? The documentation for List plans is not very helpfull.
Can anybody explain how I can a list of all plans (title and id) that I am owner or member of?
The only work-around I have found so far is:
1) Read all unified groups
https://graph.microsoft.com/v1.0/me/memberOf/$/microsoft.graph.group?$filter=groupTypes/any(a:a eq 'unified')
2) for each group: read the planner plan for that group
https://graph.microsoft.com/v1.0/groups/<id>/planner/plans
But that would require one request per group, makeing performance horrible on tenants with dozens of groups.
This API returns plans that have been shared with the current user. Plans can be shared with a user by adding the user's id to sharedWith property of planDetails (Edit: currently users do not have permissions to add or remove others from this list). This is a separate set of users from group membership and does not allow access to data for shared users. Instead, the users will have access if they are group members, and lose access if they are removed from the group.
More information and a sample for updating plan details can be found here.
Additionally, you can submit feedback about the API (and other Planner functionality) here.

Get new emails with microsoft graph

I am trying to get only new emails with microsoft graph.
Iam doing this by checking date like
GET https://graph.microsoft.com/v1.0/me/messages?$filter=receivedDateTime+gt+2016-06-06T08:08:08Z
Is there any possibility to build query to get new messages but base on id instead of receivedDateTime? Something like: get messeges until you find id=....?
I think the delta query solution is pretty good (as suggested in a different answer). However, for my purposes, there were two major drawbacks: 1) it's in preview (beta) right now, so it makes it less than ideal for production code and 2) it doesn't seem to support the monitoring of all messages, just those in a particular folder.
I actually prefer the solution you're working with. The timestamp in the header of the response can be used to reset the time field in you query, so that if you have "receivedDateTime gt 12:00:00" and get back the server time of 12:01:00 for your request, you can use "receivedDateTime gt 12:01:00" next time.
The scenario you're looking for is specifically what the new Delta query is designed to support. Deltas allow you to retrieve changes to a given folder (i.e. Inbox) since you last polled that folder. Message IDs not static or consecutive so they're not a suitable property for determining new vs. old messages.

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