Bookmarks

The Bookmarks API lets you create, list, retrieve, and delete bookmarks for folders in an Egnyte domain. Bookmarks help users quickly locate frequently accessed folders in the Web UI.

Base URL

https://{domain}.egnyte.com/pubapi/v1/bookmarks

Authentication

All requests require an OAuth 2.0 Bearer token in the Authorization header:

Authorization: Bearer {access_token}

See Authentication for details on obtaining a token.


Create a Bookmark

Create a new bookmark on a folder.

Request

POST /pubapi/v1/bookmarks

Request Body

Note: Provide either path or folder_id, not both.

FieldTypeRequiredDescription
pathstringNo*Path to the folder to bookmark (e.g., /Shared/Documents/MyPictures)
folder_idstringNo*UUID of the folder to bookmark

*One of path or folder_id is required.

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/bookmarks" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "path": "/Shared/Documents/MyPictures"
}'

Response

200 OK

FieldTypeDescription
idintegerUnique identifier for the bookmark
pathstringPath to the bookmarked folder
folder_idstringUUID of the bookmarked folder
creation_datestringISO 8601 timestamp of bookmark creation

Example Response

{
  "id": 5468,
  "path": "/Shared/Documents/MyPictures",
  "folder_id": "e3dcb54a-93d4-4cb1-9f39-4607721d0e12",
  "creation_date": "2016-06-02T11:36:01.000+0000"
}

List Bookmarks

List all bookmarks for the authenticated user.

Request

GET /pubapi/v1/bookmarks

Query Parameters

ParameterTypeRequiredDefaultDescription
offsetintegerNo0Start listing from the nth bookmark (zero-indexed)
countintegerNo—Maximum number of bookmarks to return

Example Request

curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/bookmarks?offset=2&count=10" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

200 OK

FieldTypeDescription
offsetintegerStarting position of the returned results
countintegerNumber of bookmarks returned
bookmarksarrayArray of bookmark objects
bookmarks[].idintegerUnique identifier for the bookmark
bookmarks[].pathstringPath to the bookmarked folder
bookmarks[].folder_idstringUUID of the bookmarked folder
bookmarks[].creation_datestringISO 8601 timestamp of bookmark creation

Example Response

{
  "offset": 0,
  "count": 2,
  "bookmarks": [
    {
      "id": 14455,
      "path": "/Shared/My Folder/Pictures",
      "folder_id": "0344c35b-1341-4b78-8b85-6007397dba78",
      "creation_date": "2016-06-06T17:47:30.000+0000"
    },
    {
      "id": 14453,
      "path": "/Shared/MyDocuments",
      "folder_id": "ff00a4fe-f861-419d-a283-97e6d3b5dab9",
      "creation_date": "2016-06-06T17:45:59.000+0000"
    }
  ]
}

Get Bookmark by ID

Retrieve details for a specific bookmark.

Request

GET /pubapi/v1/bookmarks/{id}

Path Parameters

ParameterTypeRequiredDescription
idintegerYesUnique identifier of the bookmark

Example Request

curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/bookmarks/5468" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

200 OK

FieldTypeDescription
idintegerUnique identifier for the bookmark
pathstringPath to the bookmarked folder
folder_idstringUUID of the bookmarked folder
creation_datestringISO 8601 timestamp of bookmark creation

Example Response

{
  "id": 14455,
  "path": "/Shared/My Folder/Pictures",
  "folder_id": "0344c35b-1341-4b78-8b85-6007397dba78",
  "creation_date": "2016-06-06T17:47:30.000+0000"
}

Delete Bookmark

Delete a specific bookmark.

Request

DELETE /pubapi/v1/bookmarks/{id}

Path Parameters

ParameterTypeRequiredDescription
idintegerYesUnique identifier of the bookmark to delete

Example Request

curl -i -X DELETE "https://{domain}.egnyte.com/pubapi/v1/bookmarks/5468" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

204 No Content

The bookmark was successfully deleted. No response body is returned.


Error Codes

StatusErrorDescriptionResolution
400BOOKMARK_PATH_AND_ID_CONFLICTBoth path and folder_id were providedProvide only one of path or folder_id in the request body
401UnauthorizedInvalid or expired tokenRefresh your OAuth token
404FOLDER_DOES_NOT_EXISTThe specified folder does not existVerify the folder path or UUID is correct
404Not FoundBookmark with the specified ID does not existVerify the bookmark ID is correct

Code Examples

Create a Bookmark

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/bookmarks" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "path": "/Shared/Documents/MyPictures"
}'

List All Bookmarks

curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/bookmarks" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"