Sunday, June 27, 2021

Graph API News: Tag support in Microsoft Graph APIs

The Microsoft Graph Teams team has just released new API support for interacting with tags in a team. Developers can now list, create, get, update, and delete tags. Additionally, support for listing, getting, and deleting members from tags in a team is also available.

Tags in Microsoft Teams provide a simple way for user categorization based on common attributes. For example, I’ve created tags in my development teams to reach Designers, Developers, Testers etc. After a tag is created, users can @mention it in a channel. For example, a chat message that contains @Designers reaches the group of users specified in the @Designers tag. For more information about tag management in Microsoft Teams, see Manage Tag in Microsoft Teams.

The APIs support application permissions and currently they’re only available as BETA endpoints. Keep in mind that BETA APIs in Microsoft Graph are subject to change and production usage isn’t supported.

The following examples show the HTTP requests for listing, creating, getting, updating, and deleting tags associated to a team.

Get a list of the tags:

GET https://graph.microsoft.com/beta/teams/{teamId}/tags

Create a tag in a team:

POST https://graph.microsoft.com/beta/teams/{teamId}/tags

Read a tag:

GET https://graph.microsoft.com/beta/teams/{teamId}/tags/{tagId}

Update a tag:

PATCH https://graph.microsoft.com/beta/teams/{teamId}/tags/{tagId}

Delete a tag:

DELETE https://graph.microsoft.com/beta/teams/{teamId}/tags/{tagId}

The following examples show the HTTP requests for listing, getting, and deleting members from a tag in a team.

Get a list of tag members in a team:

GET https://graph.microsoft.com/beta/teams/{teamId}/tags/{tagId}/members

Get details of a tag member in a team:

GET https://graph.microsoft.com/beta/teams/{teamId}/tags/{tagId}/members/{tagMemberId}

Delete a member from a tag in a team:

GET https://graph.microsoft.com/beta/teams/{teamId}/tags/{tagId}/members/{tagMemberId}

I assume the roll out for these new APIs is still taking place. So, no worries if you can’t use them yet in your environments! I’m eager to learn more about it and consider possible implementation scenarios for the products I manage.

Thanks for reading,
Jarbas