restapimicrosoft-graph-apimicrosoft-teamsmicrosoft-planner

Microsoft Graph: Is it safe to assume that plannerTask.id and plannerTaskDetails.id are always the same?


In reading the Microsoft Graph documentation, we come across two related resource types:

  1. plannerTask
  2. plannerTaskDetails

Both plannerTask and plannerTaskDetails have an id attribute, which in both cases is 28 characters long and case-sensitive, with validation taken care of Microsoft.

In working with Microsoft Graph, I have noticed that for a given task, plannerTask.id === plannerTaskDetails.id. This makes sense, as there would be no need to define a new id for the details resource type, since this is a one-one relationship and MS may simply re-use the plannerTask id.

However in the documentation, the id's seem to refer to different things. I quote:

This seems to leave the possibility of plannerTask.id !== plannerTaskDetails.id.

I was simply wondering if, in people's experience, if it is safe to assume what I noticed above, i.e. that the two id's are always the same, as it is unclear from working with MS Graph and reading the documentation. Perhaps someone working on MS Planner itself could elucidate.


Solution

  • You should not make this assumption. From the API perspective, they are different keys. Using Graph API, you don't really need to use the Task details id anywhere, and you can always refer to it as task abc's details.

    The id values currently are coincidentally the same, but we are actively investigating some features which would require them to be different. If you take dependency on this, your app will break.