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://tasks.teams.microsoft.com/teamsui/personalApp/alltasklists&context={"subEntityId":"/board/task/{task id}","channelId":"{channel id}"}
The string 1660906395123 after h_ looks like some timestamp. Does anyone know what this timestamp is?
CodePudding user response:
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).