diff --git a/14_Comments.md b/14_Comments.md index fc12232..5870e63 100644 --- a/14_Comments.md +++ b/14_Comments.md @@ -25,3 +25,25 @@ DELETE /api/v2/comments/:id - `parent_comment`: {Comment} The comment this comment is attach to. Either this or `story` will be present. - `story`: {Story} The story this comment is attached to. - `user`: {User} The user that left this comment + +### Posting a comment + +Here's how we would post a comment for a story with ID `101` as a user with ID `1` + +``` +curl -X POST \ +-H "Authorization: Bearer " \ +-H "Content-Type: application/vnd.api+json" \ +-d '{"comments":{"comment":{"body": "First story message"},"links":{"story":"101","user":"1"}}}'\ +https://www.designernews.co/api/v2/comments/ +``` + +Here's how we would post a reply for a comment with ID `123` as a user with ID `1` + +``` +curl -X POST \ +-H "Authorization: Bearer " \ +-H "Content-Type: application/vnd.api+json" \ +-d '{"comments":{"comment":{"body": "First message"},"links":{"parent_comment":"123","user":"1"}}}' \ +https://www.designernews.co/api/v2/comments/ +```