API

Comments

Overview

Comments can be added to individual items.

  1. List comments
  2. Create a comment
  3. Update a comment
  4. Delete a comment

List comments

Endpoint

GET https://api.dropmark.com/v1/items/:item_id/comments

Response

Status: 200 OK
[
  {
    "id": 100,
    "user_id": 1,
    "username": "demo",
    "avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "body": "@john That's dope",
    "annotation": null,
    "created_at": "2016-08-16T17:00:05Z",
    "updated_at": "2016-08-16T17:00:05Z"
  }
]

Create a comment

Endpoint

POST https://api.dropmark.com/v1/items/:item_id/comments

Input

Name Type Desc
body String Comment body, with support for @username mentions. (required)
notify Boolean Set to true to send a “New Comment” notification to all collaborators (if opted-in)

Example

{
  "body": "@john That's dope"
}

Response

Status: 201 Created
{
  "id": 100,
  "user_id": 1,
  "username": "demo",
  "avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
  "name": "Jane Doe",
  "email": "jane@example.com",
  "body": "@john That's dope",
  "annotation": null,
  "created_at": "2016-08-16T17:00:05Z",
  "updated_at": "2016-08-16T17:00:05Z"
}

Update a comment

Endpoint

PUT https://api.dropmark.com/v1/comments/:comment_id

Input

Name Type Desc
body String The comment (required)

Example

{
  "body": "@john That's dope"
}

Response

Status: 200 OK
{
  "id": 100,
  "user_id": 1,
  "username": "demo",
  "avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
  "name": "Jane Doe",
  "email": "jane@example.com",
  "body": "@john That's dope",
  "annotation": null,
  "created_at": "2016-08-16T17:00:05Z",
  "updated_at": "2016-08-16T17:00:05Z"
}

Delete a comment

Endpoint

DELETE https://api.dropmark.com/v1/comments/:comment_id

Response

Status: 200 OK
{
  "code": "deleted",
  "message": "Comment deleted"
}