Sample - Box Platform API
GET/files/{file_id}/comments

List file comments

Lists the comments associated with a file. Use limit and offset to control pagination, and use fields to request specific comment attributes. An empty collection is returned when the file has no comments.

4 parameters
file_idstringrequired
The unique identifier of the file whose comments to retrieve.
fieldsarray<string>optional
A comma-separated list of comment attributes to include in the response. When supplied, request the standard attributes you need explicitly.
limitintegeroptional
The maximum number of comments to return per page. Must not exceed 1000.
offsetintegeroptional
The zero-based position of the first comment to return. Defaults to 0 when omitted and must not exceed 10000.
Default:0

2 status codes
200Returns a collection of comment objects with pagination information. Returns an empty collection when the file has no comments.
total_countintegeroptional
One greater than the offset of the last entry in the entire collection. The total number of entries in the collection may be less than `total_count`. This field is only returned for calls that use offset-based pagination. For marker-based paginated APIs, this field will be omitted.
limitintegeroptional
The limit that was used for these entries. This will be the same as the `limit` query parameter unless that value exceeded the maximum value allowed. The maximum value varies by API.
offsetintegeroptional
The 0-based offset of the first entry in this set. This will be the same as the `offset` query parameter. This field is only returned for calls that use offset-based pagination. For marker-based paginated APIs, this field will be omitted.
orderarray<object>optional
The order by which items are returned. This field is only returned for calls that use offset-based pagination. For marker-based paginated APIs, this field will be omitted.
entriesarray<CommentFull>optional
A list of comments.
defaultReturned when an unexpected client error occurs.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.

Error handling

file_id must identify the file whose comments you want to retrieve. limit must not exceed 1000, and offset must not exceed 10000; offset defaults to 0 when omitted. Use fields to explicitly request attributes that are not included in the standard comment representation.