Home

How can i add a comment using GRAPH API in Planner

%3CLINGO-SUB%20id%3D%22lingo-sub-9286%22%20slang%3D%22en-US%22%3EHow%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-9286%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20having%20issues%20adding%20comments%20to%20tasks%20in%20planner%20using%20the%20graph%20api.%20I%20tried%20looking%20at%20the%20conversation%20id%20and%20tried%20posting%20to%20corresponding%20O365%20but%20had%20no%20succes%20on%20adding%20comments%20to%20tasks.%20Can%20anybody%20help%20me%20out%20with%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ERobin%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-132687%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-132687%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3ESorry%20%22A%20year%20later%22%2C%20I%20was%20looking%20to%20do%20the%20same%20thing%20and%20find%20this%20post.%3CBR%20%2F%3EI%20used%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fconversationthread_reply%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fconversationthread_reply%3C%2FA%3E%20to%20understand%20how%20to%20publish%20a%20new%20comment%20from%20Graph%3C%2FP%3E%0A%3CP%3Ewith%20POST%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%5BGroupID%5D%2Fthreads%2F%5BConversationID%5D%2Freply%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%5BGroupID%5D%2Fthreads%2F%5BConversationID%5D%2Freply%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20body%20content%20like%3C%2FP%3E%0A%3CPRE%3E%7B%0A%20%20%22post%22%3A%20%7B%0A%20%20%20%20%22body%22%3A%20%7B%0A%20%20%20%20%20%20%22contentType%22%3A%20%221%22%2C%0A%20%20%20%20%20%20%22content%22%3A%20%22Hello%20from%20Graph%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%3C%2FPRE%3E%0A%3CP%3ETo%20find%20the%20conversationID%20i%20use%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%5BGroupID%5D%2Fthreads%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%5BGroupID%5D%2Fthreads%3C%2FA%3E%3C%2FP%3E%0A%3CP%3Eor%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FPlanner%2FPlans%2F%5BPlanId%5D%2Ftasks%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FPlanner%2FPlans%2F%5BPlanId%5D%2Ftasks%3C%2FA%3E%3CBR%20%2F%3Eor%20%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FPlanner%2Ftasks%2F%5BTaskID%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FPlanner%2Ftasks%2F%5BTaskID%3C%2FA%3E%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20find%20PlanID%20or%20GroupId%2C%20just%20browse%20to%20you%20planner%2C%20it's%20in%20the%20URL%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20play%20with%20this%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%2FChristophe%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23318%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23318%22%20slang%3D%22en-US%22%3EUnfortunately%20getting%20them%20works%2C%20but%20the%20post%20doe%20not.%20It%20adds%20them%20to%20the%20office%20365%20group%20but%20they%20are%20not%20visible%20in%20the%20planner%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23258%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23258%22%20slang%3D%22en-US%22%3EYou%20need%20to%20use%20POST%20%2Fgroups%2F%3CID%3E%2Fthreads%20to%20post%20the%20conversation%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.io%2Fen-us%2Fdocs%2Fapi-reference%2Fv1.0%2Fapi%2Fgroup_post_threads%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.io%2Fen-us%2Fdocs%2Fapi-reference%2Fv1.0%2Fapi%2Fgroup_post_threads%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20update%20that%20conversation%20to%20task%20use%20conversationThreadId%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.io%2Fen-us%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Ftask_update%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.io%2Fen-us%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Ftask_update%3C%2FA%3E%3C%2FID%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23202%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23202%22%20slang%3D%22en-US%22%3E%3CP%3EMaybe%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1547%22%20target%3D%22_blank%22%3E%40Santhosh%20Balakrishnan%3C%2FA%3E%26nbsp%3Bcould%20help%20here%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23173%22%20slang%3D%22en-US%22%3ERE%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23173%22%20slang%3D%22en-US%22%3EYes%20I%20would%20like%20this%20answer%20too.%20It's%20not%20clear%20from%20the%20MetaData%20in%20Graph%20where%20the%20description%20field%20resides.%20Doesn't%20seem%20to%20be%20part%20of%20the%20Task%20but%20there%20is%20a%20%22hasDescription%22%20field%20set%20to%20true%20when%20a%20description%20is%20added%20through%20the%20UI.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-10061%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-10061%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6006%22%20target%3D%22_blank%22%3E%40Eray%20Chou%3C%2FA%3E%2C%20do%20you%20know%20who%20might%20be%20able%20to%20help%20answer%20this%20question%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-837085%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20can%20i%20add%20a%20comment%20using%20GRAPH%20API%20in%20Planner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-837085%22%20slang%3D%22en-US%22%3E%3CP%3EI%20tried%20with%20graph%20explorer%20it%20shows%20success%20but%20it%20doesnot%20post%20the%20comment%20in%20the%20planner%20task%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2072%22%20target%3D%22_blank%22%3E%40Christophe%20DION%3C%2FA%3E%26nbsp%3BWhat%20am%20I%20missing%20here.%20Problem%20is%20I%20can%20get%20conversation%20thread%20id%20once%20the%20first%20comment%20is%20posted%20but%20to%20post%20the%20first%20comment%20your%20way%20is%20not%20working%3C%2FP%3E%3C%2FLINGO-BODY%3E
Robin Vermeirsch
Occasional Contributor

Hi,

 

I'm having issues adding comments to tasks in planner using the graph api. I tried looking at the conversation id and tried posting to corresponding O365 but had no succes on adding comments to tasks. Can anybody help me out with this?

 

Regards,

Robin

7 Replies

@Eray Chou, do you know who might be able to help answer this question?

Yes I would like this answer too. It's not clear from the MetaData in Graph where the description field resides. Doesn't seem to be part of the Task but there is a "hasDescription" field set to true when a description is added through the UI.
You need to use POST /groups/<id>/threads to post the conversation
https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/group_post_threads

To update that conversation to task use conversationThreadId
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/task_update
Unfortunately getting them works, but the post doe not. It adds them to the office 365 group but they are not visible in the 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

I tried with graph explorer it shows success but it doesnot post the comment in the planner task@Christophe 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

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies