File Comments

A FileComment is a comment attached to a file by a user.

List File Comments by Path

Endpoint

GET/file_comments/files/{path}

Return Object

FileComment[]

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
path
string
Required
Path to operate on.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/file_comments/files/{path} \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "body": "What a great file!",
    "reactions": [
      {
        "id": 1,
        "emoji": "👍"
      }
    ]
  }
]

Create File Comment

Endpoint

POST/file_comments

Return Object

FileComment

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
body
string
Required
Comment body.
path
string
Required
File path.

Example Request

curl https://app.files.com/api/rest/v1/file_comments.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"body":"What a great file!","path":"path"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "body": "What a great file!",
  "reactions": [
    {
      "id": 1,
      "emoji": "👍"
    }
  ]
}

Update File Comment

Endpoint

PATCH/file_comments/{id}

Return Object

FileComment

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
File Comment ID.
body
string
Required
Comment body.

Example Request

curl https://app.files.com/api/rest/v1/file_comments/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"body":"What a great file!"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "body": "What a great file!",
  "reactions": [
    {
      "id": 1,
      "emoji": "👍"
    }
  ]
}

Delete File Comment

Endpoint

DELETE/file_comments/{id}

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
File Comment ID.

Example Request

curl https://app.files.com/api/rest/v1/file_comments/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The FileComment Object

Some of the endpoints above return a FileComment object. The attributes of this object are listed below.

AttributeDescription
id
int64
File Comment ID
body
string
Comment body.
reactions
array(object)
Reactions to this comment.

Example FileComment Object

{
  "id": 1,
  "body": "What a great file!",
  "reactions": [
    {
      "id": 1,
      "emoji": "👍"
    }
  ]
}