Creating a Personal Plan in Microsoft Planner Graph API

Eugéne van Rooyen 25 Reputation points
2023-11-21T17:03:53.0433333+00:00

The Microsoft Planner Graph API documentation describes how to create a "personal" plan (not linked to a group), which can only be achieved via Graph. However, the documentation does not mention how the container URL value should be defined. The following request body did not work ("Unknown Error").

Any ideas?

{
    "container": {
        "url": "https://graph.microsoft.com/beta/users/00000000-0000-0000-0000-000000000000"
    },
    "title": "TestPlanner123"
}
Microsoft Security | Microsoft Graph
{count} vote

Accepted answer
  1. Hunter Parker 100 Reputation points
    2023-12-01T21:10:23.5966667+00:00

    This worked for me but it's in Powershell.

    Connect-MgGraph 
    Import-Module Microsoft.Graph.Beta.Planner 
    	$params = @{ 
    		container = @{
    			#beta graph url of the user to associate the plan to 	
    			url = "https://graph.microsoft.com/beta/users/12345678-abcd-1234-abcd-abcd1234efg" 	
    		}
    		title = "titleOfPlan" 	
    	}  
    New-MgBetaPlannerPlan -BodyParameter $params 
    Disconnect-MgGraph 
    

    If I gave it a container type as Simon did, I got the same error. My guess is that the container is already defined with a type for users though the container type for my user container is "unknownFutureValue".

    I'd say to Eugéne, make sure you're posting to the graph beta (https://graph.microsoft.com/beta/planner/plans) API endpoint as well as using the beta user url in the JSON.

    I'd say to Simon, drop the

    ,
        "type": "user"
    

    of yours.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2023-12-06T08:33:06.98+00:00

    Hey guys.

    I have a similar error, but on the groups endpoint. Do you have experience with it?

    I'm authenticated with active directory auth with azure app and have all permissions to create a new plan in a group.

    {
      "container": {
        "url": "https://graph.microsoft.com/beta/groups/2975f5b7-2422-4b09-b6bd-d878639ca7a2"
      },
      "title": "planner123"
    }
    
    //Also tested this body:
    {  "owner": "2975f5b7-2422-4b09-b6bd-d878639ca7a2",  "title": "planner123"}
    

    Within the second body i get following error:

    {  "error": {    "code": "",    "message": "You do not have the required permissions to access this item, or the item may not exist.",
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.