I can successfully create a comment (as seen in Workfront UI Updates section) of an Issue with this REST API call using v20
```
curl --location 'https://SUBDOMAIN.workfront.com/attask/api/v20.0/note' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"objID": "68d2c7fe00911872fc05f2e559650090",
"objCode": "NOTE",
"html": "Hello <b>World</b> from Postman JSON 1",
"noteText": "Hello Plain from Postman JSON 1",
"noteObjCode": "OPTASK",
"json": "{}"
}'
```
The problem is updating a comment (with or without a nested comment). I can only update the plain text noteText, the HTML is not overwritten. Since Adobe Workfront UI only displays the HTML comment this update is not displaying!!
```
curl --location --request PUT 'https://SUBDOMAIN.workfront.com/attask/api/v20.0/note/68d43bd6004d01abe8f85c5726e94108' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"objID": "68d2c7fe00911872fc05f2e559650090",
"objCode": "NOTE",
"html": "Hello <b>World</b> from Postman JSON 2",
"noteText": "Hello Plain from Postman JSON 2",
"noteObjCode": "OPTASK",
"json": "{}"
}'
```
I also tried sending the rich text format in Draft.js JSON
```
curl --location --request PUT 'https://SUBDOMAIN.workfront.com/attask/api/v20.0/note/68d43bd6004d01abe8f85c5726e94108' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"objID": "68d2c7fe00911872fc05f2e559650090",
"objCode": "NOTE",
"noteObjCode": "OPTASK",
"noteText": "Update 3",
"json": "{\"blocks\":[{\"key\":\"some_random_key\",\"text\":\"Update 3\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}"
}'
```
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
I got this to work by reverse engineering the Workfront UI using their GraphQL endpoint
curl --location 'https://SUBDOMAIN.workfront.com/comments/api/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{"variables":{"data":{"commentID":"68d5855900024794261c45be7626bf51","contentHTML":"<p class=\"react-spectrum-RichTextEditor-paragraph\" dir=\"ltr\" style=\"margin: 0px; padding: 0px;\"><span style=\"white-space: pre-wrap;\">Hello 11:13</span></p>","content":"Hello 11:13","tags":[],"attachments":[]}},"query":"mutation ($data: InputEditData) {\n editComment(data: $data) {\n attachments {\n id\n name\n type\n __typename\n }\n contentHTML\n content\n tags {\n id\n objCode\n __typename\n }\n metadata\n modified\n modifiedBy\n lastModifiedAt\n __typename\n }\n}"}'
Views
Replies
Total Likes
@lgaertner I see you and @ignatius_dilip discussed a similar issue https://experienceleaguecommunities.adobe.com/t5/workfront-questions/add-task-comments-via-rest-api/... .
Views
Replies
Total Likes
This guide is also helpful for Draft.js JSON format of HTML https://experienceleague.adobe.com/en/docs/workfront/using/adobe-workfront-api/api-general-informati...
Views
Replies
Total Likes
We used Draft.js to HTML and fixed the text patterns which has paragraph breaks accordingly.
Views
Replies
Total Likes
I got this to work by reverse engineering the Workfront UI using their GraphQL endpoint
curl --location 'https://SUBDOMAIN.workfront.com/comments/api/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{"variables":{"data":{"commentID":"68d5855900024794261c45be7626bf51","contentHTML":"<p class=\"react-spectrum-RichTextEditor-paragraph\" dir=\"ltr\" style=\"margin: 0px; padding: 0px;\"><span style=\"white-space: pre-wrap;\">Hello 11:13</span></p>","content":"Hello 11:13","tags":[],"attachments":[]}},"query":"mutation ($data: InputEditData) {\n editComment(data: $data) {\n attachments {\n id\n name\n type\n __typename\n }\n contentHTML\n content\n tags {\n id\n objCode\n __typename\n }\n metadata\n modified\n modifiedBy\n lastModifiedAt\n __typename\n }\n}"}'
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies