Version: 1.0.0

Comments

A comment is an answer to a content created by a determined user. It's a piece of text or a picture. Statuses, Articles and even Comments can be commented.


Add a comment to a content

To create a comment related to a specific content, make an HTTP POST request with an URL that match your content's type and with the content's unique id.

https://YOUR_PROJECT_DOMAIN.potion.social/public-api/v1/CONTENT_TYPE/CONTENT_ID/comment

CONTENT_TYPE could be either:

  • statuses
  • posts
  • comments

Add a reference to the user who comment and a message and/or a picture (a file with media parameter, an URL that links to an image with media_url parameter) to your query to finalize the comment creation

curl -X POST \
https://YOUR_PROJECT_DOMAIN.potion.social/public-api/v1/CONTENT_TYPE/CONTENT_ID/comment \
-H 'Api-Key: YOUR_API_KEY' \
-H 'Api-Secret: YOUR_API_SECRET' \
-H 'Content-Type: application/json' \
-d '{
"message": "I can comment this !",
"user_id": "YOUR_USER_ID"
}'

Get comments of a specific content

Following the same logic, you can access a content's comments with an HTTP GET call.

https://YOUR_PROJECT_DOMAIN.potion.social/public-api/v1/CONTENT_TYPE/CONTENT_ID/comments

CONTENT_TYPE could be either:

  • statuses
  • posts
  • comments

The result is an array containing a JSON representation of the 20 last posted comments linked to your content. You can get more by using the page and per_page parameters.