Open App

Comments

API endpoints for comments

List comments for an entity

GET /api/v1/comments

Parameters

NameInTypeRequiredDescription
entityTypequerystring (project, space, asset, scout)Yes
entityIdquerystringYes
limitqueryintegerNoMaximum number of items to return.
offsetqueryintegerNoNumber of items to skip.
searchquerystringNoCase-insensitive search across scalar fields.
filterquerystringNoServer-side exact filters as comma-separated field=value pairs.
sortquerystringNoComma-separated sort fields. Prefix with - or suffix :desc for descending order.
cursorquerystringNoCursor returned by a previous cursor-mode list response.
pageModequerystring (offset, cursor)NoSet to cursor to return {items,nextCursor,hasMore} inside the response data.

Example request

curl -X GET \
"https://api.getpilfer.com/api/v1/comments?entityType=<entityType>&entityId=<entityId>&limit=<limit>&offset=<offset>&search=<search>&filter=<filter>&sort=<sort>&cursor=<cursor>&pageMode=<pageMode>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": [
    {
      "_id": "string",
      "entityType": "string",
      "entityId": "string",
      "body": "string",
      "parentCommentId": "string"
    }
  ]
}

Other statuses: 400, 401, 403, 404.

Response body type

{ data: Comment[] }


Create comment

POST /api/v1/comments

Example request

curl -X POST \
"https://api.getpilfer.com/api/v1/comments" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"entityType":"project","entityId":"string","body":"string","parentCommentId":"string"}'

Example response

Status: 201

{
  "data": {
    "_id": "string",
    "entityType": "string",
    "entityId": "string",
    "body": "string",
    "parentCommentId": "string"
  }
}

Other statuses: 400, 401, 403, 404.

Response body type

{ data: Comment }