How to add comment programmatically using granite.comments API?

Question

How to add comment programmatically using granite.comments API?

Answer

Post the comment to the asset path. For instance, to post a comment to the mountain picture that is part of the Geometrixx samples, POST to: http://localhost:4502/content/dam/geometrixx-outdoors/activities/snowboarding/PDP_1_c05.jpg.

Use the following request attributes:
1. :operation:granite:comment
2. path: /content/dam/geometrixx-outdoors/activities/snowboarding/PDP_1_c05.jpg
3. message: Posting a comment programmatically....

This results in a new Granite comment on the asset

 Adobe

Dapatkan bantuan lebih cepat dan lebih mudah

Pengguna baru?

Adobe MAX 2024

Adobe MAX
Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX

Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX 2024

Adobe MAX
Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX

Konferensi Kreativitas

14–16 Oktober Miami Beach dan online