I am trying to create an MS Planner Plan, using a Post call to MS Graph, as described under https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/planner_post_plans
The sequence I follow is:
As a first step I create a new Office 365 group. This process completes successfully, using a post call to: .api("https://graph.microsoft.com/v1.0/groups/")
Then I add the currently logged user, who is executing the operation, as a group member (since by default he becomes a group owner only, and a member permission is required to perform further operations with the group), using a post call to:
"https://graph.microsoft.com/v1.0/groups/" + o365GroupId + "/members/$ref"
If at this point I decide to perform .get calls to the URLs, quoted above and console.log the responses, is obvious that the group has been created successfully, and the currently logged user has been added as a member.
If then I try to create a plan for this group, using a .Post call to: "https://graph.microsoft.com/v1.0/planner/plans", I get a 403 (Forbidden) response and a "You do not have the required permissions to access this item, or the item may not exist." error message.
That means, from Planner point of view either the group still doesn't exist, or my permission to it hasn't been recognized.
However I don't quite get it why there is an issue with this at all, since the whole function is from 'async' type, and all my Graph calls begin with 'await' in order to ensure synchronous code execution.