• Register

Comments API

The Comments API allows you to create a comment, list all comments for a file, and list the details for a specific comment. Comments can also be referred to as notes.

Add a Comment

This endpoint is used to create a new comment on a file or folder.

POST/pubapi/v1/notes

Request Parameters

Parameter Description Required
path Path to the file or folder where the comment should be added. Yes
body The text of the comment. Yes

Method-specific Response Codes

Error Code Error Message HTTP Code Troubleshooting
Bad Request Unparsable JSON. 400 Make sure your JSON syntax is correct.
Bad Request JSON property [property_name] not supported by the endpoint. 400 The request can only contain a path and body.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User does not have sufficient privileges on the file or the file does not exist. 403 Make sure you have the proper permissions for this file.
Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. 500 Try again later.

Request Examples

POST /pubapi/v1/notes HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
Content-Type: application/json
{
  "path": "/Shared/Documents/form.docx",
  "body": "Test comment"
}
curl -v --request POST -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" -H "Content-Type: application/json" --data '{"path":"/Shared/Documents/form.docx", "body":"Test comment 2"}' https://apidemo.egnyte.com/pubapi/v1/notes

Sample Response

{
  "id": "4fbba2ef-fb2f-4c54-9392-116f07e39b97",
  "message": "Test comment",
  "username": "asmith",
  "can_delete": true,
  "creation_time": "2016-05-18T17:56:39.975+0000",
  "formatted_name": "Anna Smith",
  "file_path":"/Shared/Documents/testdoc.docx",
  "group_id": "628ceb16-b9a0-49f8-a0e4-72b729708f71"
}

List Comments

This endpoint is used to list all comments for a given file or folder. Administrators can also send a request with no parameters to list all of the comments for that domain.

GET/pubapi/v1/notes/?file={URL encoded path to file}

Request Parameters

Parameter Description Required
file Url encoded path to the item for which you want to see the comments. If not included, the response will return all of the comments for that domain. No
start_time Get all comments before this time. If both start_time and end_time are included, start_time must be less than end_time. No
end_time Get all comments before this time. No
count The number of results to return. Count defaults to 25 and has a maximum value of 100. No
offset A zero-based index which can be used with count to paginate the list of comments. Offset defaults to 0. No
Dates and Times Format

Dates and times are in ISO 8601 format. For example, May 27, 2012 is represented as “2012-05-27”. Similarly 10:27:01pm on May 27, 2012 is represented as “2012-05-27T22:27:01Z”.

Method-specific Response Codes

Error Code Error Message HTTP Code Troubleshooting
OK The request was fulfilled. 200 The request was valid and the response will be returned.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. 500 Try again later.

Request Examples

GET /pubapi/v1/notes HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v --request GET -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" https://apidemo.egnyte.com/pubapi/v1/notes

Sample Response

{
  "count": 2,
  "offset": 0,
  "notes":[{
    "id": "4fbba2ef-fb2f-4c54-9392-116f07e39b97",
    "message": "Test comment",
    "username": asmith,
    "can_delete": true,
    "creation_time": "2016-05-18T17:56:39.975+0000",
    "formatted_name": "Anna Smith",
    "file_path":"/Shared/Documents/testdoc.docx",
    "group_id": "628ceb16-b9a0-49f8-a0e4-72b729708f71"
    },{
    "id": "a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8",
    "message": "Test comment 2",
    "username": asmith,
    "can_delete": true,
    "creation_time": "2016-05-18T18:06:26.000+0000",
    "formatted_name": "Anna Smith",
    "file_path":"/Shared/Documents/testdoc.docx",
    "group_id": "628ceb16-b9a0-49f8-a0e4-72b729708f71"
    }
  ],
  "total_results": 2
}

Show Comment

This endpoint is used to the details for a specific comment.

GET/pubapi/v1/notes/{UUID}

Request Parameters

Parameter Description Required
UUID The id for the desired comment. Yes

Method-specific Response Codes

Error Code Error Message HTTP Code Troubleshooting
OK The request was fulfilled. 200 The request was valid and the response will be returned.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User does not have sufficient privleges on the file or the comment does not exist. 403 Check your permissions for the file.
Not Found Note does not exist. 404 Ensure that the file exists.
Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. 500 Try again later.

Request Examples

GET /pubapi/v1/notes/ HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
Content-Type: application/json
{
  "UUID": "a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8"
}
curl -v --request GET -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" https://apidemo.egnyte.com/pubapi/v1/notes/a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8

Sample Response

{
    "id": "a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8",
    "message": "Test comment 2",
    "username": "asmith",
    "can_delete": true,
    "creation_time": "2016-05-18T18:06:26.000+0000",
    "formatted_name": "Anna Smith",
    "file_path":"/Shared/Documents/testdoc.docx",
    "group_id": "628ceb16-b9a0-49f8-a0e4-72b729708f71"
}

Delete Comment

This endpoint is used to delete a specific comment.

DELETE/pubapi/v1/notes/{UUID}

Request Parameters

Parameter Description Required
UUID The idenitification tag for the comment that should be deleted. Yes

Method-specific Response Codes

Error Code Error Message HTTP Code Troubleshooting
OK The request was fulfilled. 200 The comment was deleted.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User does not have sufficient privleges on the file or the comment does not exist. 403 Check your permissions for the file.
Not Found Note does not exist. 404 Ensure that the file exists.
Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. 500 Try again later.

Request Examples

DELETE /pubapi/v1/notes/ HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
Content-Type: application/json
{
  "UUID": "a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8"
}
curl -v --request DELETE -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" https://apidemo.egnyte.com/pubapi/v1/notes/a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8