Forum Discussion
How can i add a comment using GRAPH API in Planner
Hello,
Sorry "A year later", I was looking to do the same thing and find this post.
I used https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/conversationthread_reply to understand how to publish a new comment from Graph
with POST https://graph.microsoft.com/v1.0/groups/[GroupID]/threads/[ConversationID]/reply
And body content like
{
"post": {
"body": {
"contentType": "1",
"content": "Hello from Graph"
}
}
}
To find the conversationID i use:
https://graph.microsoft.com/v1.0/groups/[GroupID]/threads
or
https://graph.microsoft.com/v1.0/Planner/Plans/[PlanId]/tasks
or
https://graph.microsoft.com/v1.0/Planner/tasks/[TaskID]
To find PlanID or GroupId, just browse to you planner, it's in the URL
Let's play with this :)
/Christophe
- _1asok-12220Sep 04, 2019Copper Contributor
I tried with graph explorer it shows success but it doesnot post the comment in the planner taskChristophe DION What am I missing here. Problem is I can get conversation thread id once the first comment is posted but to post the first comment your way is not working
- stevenbruceDec 15, 2020Copper ContributorChristophe's method works great for tasks that already have a conversationId, but can't be used to post the first comment on a new task.
- mikavonessenJun 21, 2022Copper ContributorIf there is no conversationId you can create a new conversation thread for the group corresponding to the plan. Afterwards update the conversationId of the task.
Keep in mind - This requires Group scopes which require an admin consent. So if you are building an app which should not use admin consent, sending comments is currently not possible.