restmicrosoft-graph-apimicrosoft-graph-plannertasks

Microsoft Graph API: How to get url for Task in Planner?


I am using planner task API from Microsoft Graph APIs to get details of a task created in planner. Is there any way to Teams client URL for task from Graph APIs? In the API response I don't see any property like webUrl which can be seen for other resources. Does Microsoft provide URLs for planner tasks in Graph API? If it is not supported, can I build URL programmatically?

The task URL copied from Teams client appears to have below format:

https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.planner/tt.c_{channel id}p{planner id}_h_1660906395123?tenantId={tenant id}&webUrl=https%3A%2F%2Ftasks.teams.microsoft.com%2Fteamsui%2FpersonalApp%2Falltasklists&context=%7B%22subEntityId%22%3A%22%2Fboard%2Ftask%2F{task id}%22%2C%22channelId%22%3A%22{channel id}%22%7D

The string 1660906395123 after h_ looks like some timestamp. Does anyone know what this timestamp is?


Solution

  • There is no supported way of programmatically getting the task url to the UI right now. Any method you find to be working can (and likely will) break without notice.

    The value you are asking for is obtainable for a tab in the channel if you look inside the entityId of the configuration property of the tab (teams/{teamId}/channels/{channelId}/tabs).

    If you copy the link to the task from the task app (instead of the channel tab) you get a different URL which seems to be easier to work with (still needs the channel id, but not the tab information).