0

I want to create a spfx webpart to create a tasks in the teams channel

IS there any API for creating tasks in teams channel

Below is the image of my channel Task tab

enter image description here

I am new to Graph API Thanks in advance

2
  • Do you want to create planner tasks or to-do tasks? Check this & let me know if this works for you. Commented Sep 16, 2021 at 6:19
  • Please check the updated question with image teams channel task where i want to create task using Graph APII Commented Sep 16, 2021 at 7:13

1 Answer 1

1

You can use below endpoint to create new task inside any planner.

https://graph.microsoft.com/v1.0/planner/tasks

Request body

    {
  "planId": "xqQg5FS2LkCp935s-FIFm2QAFkHM",
  "bucketId": "hsOf2dhOJkqyYYZEtdzDe2QAIUCR",
  "title": "Update client list",
  "assignments": {
    "fbab97d0-4932-4511-b675-204639209557": {
      "@odata.type": "#microsoft.graph.plannerAssignment",
      "orderHint": " !"
    }
  }
}

Now if you noticed what you need is to find a plan Id for that particular channel's planner and its bucket id

Below are the steps you can follow to get

To get Plan Id - Open the planner in a particular channel and click on the website icon, this will open the planner in the browser and in the end, you will find the plan id

enter image description here

To get bucket ID

We would have to make the below API call

/planner/plans/{plan-id}/buckets

This will list down all the buckets inside the plan and you can find bucket id.

Use both above information to make actual create task call as mentioned in above step.

Hope this helps..

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.