Tasks API

The Tasks API allows you to create a task, list all tasks for a file or for a user, and list the details for a specific task. Tasks API can also be referred to as "Workflow API".

Create Task

This endpoint is used to create a new file-related task for a user.

POST/pubapi/v1/tasks

Request Parameters in the Request Body

Parameter Description Required Possible Values
task The text of the task. Yes A non-empty string
file Persistent ID of a file for which you want to create the task. Yes {"groupId": GROUP_ID}
E.g. {"groupId":"4ffd13e7-bb21-4fb8-845b-4b9f0689882c"}
assignees ID of an assignee of the task. Only one assignee is allowed now, although technically, it is placed in the array structure. The reason is that in the future, more than one assignee might be allowed for a task. Yes An array of only one element is allowed: "id" and then the numerical value of the user id, e.g. [{"id":6}]
dueDate Due date of the task. No Date in the format: YYYY-MM-DD, e.g. 2018-08-29

Method-specific Response Codes

Response Code Response Message HTTP Code Troubleshooting
Created The request has been fulfilled and resulted in a new resource being created. 201 Success. The task has been created
Bad Request Unparsable JSON. 400 Make sure your JSON syntax is correct.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User does not have sufficient privileges on the file. 403 Make sure you have the proper permissions to access this file.
Not Found File does not exist. 404 Make sure you have the proper {GROUP_ID} for the 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/tasks HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
Content-Type: application/json
{
   "task":"Check if we need to update the website",
   "assignees":[{"id":6}],
   "dueDate":"2018-08-29",
   "file":{"groupId":"4ffd13e7-bb21-4fb8-845b-4b9f0689882c"}
}
curl -v --request POST -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" -H "Content-Type: application/json" --data '{"task":"Check if we need to update the website","assignees":[{"id":6}],"dueDate":"2018-08-29","file":{"groupId":"4ffd13e7-bb21-4fb8-845b-4b9f0689882c"}}' https://apidemo.egnyte.com/pubapi/v1/tasks

Sample Response

{
  "id" : "e53ea032-f859-4e4b-94e2-43131fcf7243",
  "task" : "Check if we need to update the website",
  "creationDate" : 1534460249892,
  "completionDate" : null,
  "dueDate" : "2018-08-29",
  "dueDateTimestamp" : 1535612399999,
  "assignor" : {
    "id" : 1,
    "username" : "jdoerr",
    "firstName" : "John",
    "lastName" : "Doerr",
    "email" : "jdoerr@acme.com",
    "status" : "ACTIVE",
    "typeName" : "admin"
  },
  "assignees" : [ {
    "id" : 6,
    "username" : "ssmith",
    "firstName" : "Sean",
    "lastName" : "Smith",
    "email" : "ssmith@acme.com",
    "status" : "ACTIVE",
    "typeName" : "user"
  } ],
  "status" : "OPEN",
  "file" : {
    "path" : "/Shared/Projects/Project1/Private/strategy_slides9_05c.pdf",
    "name" : "strategy_slides9_05c.pdf",
    "parentPath" : "/Shared/Projects/Project1/Private",
    "entryId" : "b6cf1f9d-d413-4122-9af3-ba421233cf2b",
    "groupId" : "4ffd13e7-bb21-4fb8-845b-4b9f0689882c",
    "folderId" : "29a6d842-3485-45a5-99ed-d714f33e752c",
    "size" : 75130
  }
}

List Tasks

This endpoint is used to list all tasks for a given file, or all tasks created by (or assigned to) the user issuing the API request. Currently, even Administrators can not list all of the tasks for the domain or tasks "created by" or "assigned to" other users.

My Tasks - "list the tasks I have created"

GET/pubapi/v1/tasks/?assignorId={ASSIGNOR_ID}

My Tasks - "list the tasks assigned to me"

GET/pubapi/v1/tasks/?assigneeId={ASSIGNEE_ID}

List tasks for a specific file

GET/pubapi/v1/tasks/?groupId={GROUP_ID}

Request Parameters in the URI

Parameter Description RequiredPossible Values
groupId Persistent ID of a file for which you want to see the tasks. One (or more) of the three parameters has to be provided: groupId, assigneeId or assignorId. No Persistent ID, e.g. bbde8e1c-511c-44c0-866b-71e7b38c8acb
assigneeId ID of a user the tasks are assigned to. Only ID of the user issuing the API request is currently permitted. One (or more) of the three parameters has to be provided: groupId, assigneeId or assignorId. No Numerical ID of the user.
assignorId ID of a user who created the tasks you want to see. Only ID of the user issuing the API request is currently permitted. One (or more) of the three parameters has to be provided: groupId, assigneeId or assignorId. No Numerical ID of the user.
limit Maximum number of results to return. When the limit is set to 0, the request can be used to receive the total number of available results (based on the totalCount parameter). The maximum value of the limit is 50. The default value for the limit is 50 as well. No Non-negative integers between 0 and 50
offset A zero-based index which can be used with the limit to paginate the list of tasks. Offset defaults to 0. No Non-negative integers between 0 and totalCount
sortBy Specifies how to sort the results. No creationDate, dueDate
sortDirection Specifies how the results should be sorted. No ASC, DESC

Method-specific Response Codes

Response Code Response 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.
Unauthorized Access Forbidden. 403 Make sure that you have access for the file in case you are requesting all the tasks for the file. In case you specify assigneeID or assignorID, make sure it is the ID of the user issuing the API request.
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/tasks?assignorId=1&sortBy=dueDate&sortDirection=ASC  HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v --request GET -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" https://apidemo.egnyte.com/pubapi/v1/tasks?assignorId=1&sortBy=dueDate&sortDirection=ASC

Sample Response

{
  "results" : [ {
    "id" : "0dc9d9c5-e3fc-43ea-a475-50a1731fa2f2",
    "task" : "Update the footer",
    "creationDate" : 1534454517000,
    "completionDate" : null,
    "dueDate" : "2018-08-16",
    "dueDateTimestamp" : 1534489199999,
    "assignor" : {
      "id" : 1,
      "username" : "jdoerr",
      "firstName" : "John",
      "lastName" : "Doerr",
      "email" : "jdoerr@acme.com",
      "status" : "ACTIVE",
      "typeName" : "admin"
    },
    "assignees" : [ {
      "id" : 6,
      "username" : "ssmith",
      "firstName" : "Sean",
      "lastName" : "Smith",
      "email" : "ssmith@acme.com",
      "status" : "ACTIVE",
      "typeName" : "user"
    } ],
    "status" : "OPEN",
    "file" : {
      "path" : "/Shared/Projects/Project1/Private/strategy_slides9_05c.pdf",
      "name" : "strategy_slides9_05c.pdf",
      "parentPath" : "/Shared/Projects/Project1/Private",
      "entryId" : "b6cf1f9d-d413-4122-9af3-ba421233cf2b",
      "groupId" : "4ffd13e7-bb21-4fb8-845b-4b9f0689882c",
      "folderId" : "29a6d842-3485-45a5-99ed-d714f33e752c",
      "size" : 75130
    }
  }, {
    "id" : "5c48aebc-abce-44a7-afa1-a4b30c28ab4d",
    "task" : "Confirm with Marketing",
    "creationDate" : 1534454547000,
    "completionDate" : null,
    "dueDate" : "2018-08-23",
    "dueDateTimestamp" : 1535093999999,
    "assignor" : {
      "id" : 1,
      "username" : "jdoerr",
      "firstName" : "John",
      "lastName" : "Doerr",
      "email" : "jdoerr@acme.com",
      "status" : "ACTIVE",
      "typeName" : "admin"
    },
    "assignees" : [ {
      "id" : 4,
      "username" : "abourne",
      "firstName" : "Alice",
      "lastName" : "Bourne",
      "email" : "abourne@acme.com",
      "status" : "ACTIVE",
      "typeName" : "user"
    } ],
    "status" : "OPEN",
    "file" : {
      "path" : "/Shared/Projects/Project1/Private/strategy_slides9_05c.pdf",
      "name" : "strategy_slides9_05c.pdf",
      "parentPath" : "/Shared/Projects/Project1/Private",
      "entryId" : "b6cf1f9d-d413-4122-9af3-ba421233cf2b",
      "groupId" : "4ffd13e7-bb21-4fb8-845b-4b9f0689882c",
      "folderId" : "29a6d842-3485-45a5-99ed-d714f33e752c",
      "size" : 75130
    }
  } ],
  "totalCount" : 2
}

Show Task

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

GET/pubapi/v1/tasks/{TASK_ID}

Request Parameters in the URI

Parameter Description RequiredPossible Values
TASK_ID The id of the task. Yes E.g. d2c3872c-c399-458b-bf19-b3792cbd37c7

Method-specific Response Codes

Response Code Response 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 has no permission to get the task. 403 Make sure you are either assignee or assignor of the task.
Not Found Task not found. 404 Ensure that the ID of the task is correct.
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/tasks/d2c3872c-c399-458b-bf19-b3792cbd37c7  HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v --request GET -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" https://apidemo.egnyte.com/pubapi/v1/tasks/d2c3872c-c399-458b-bf19-b3792cbd37c7

Sample Response

{
  "id" : "d2c3872c-c399-458b-bf19-b3792cbd37c7",
  "task" : "Fix footers for the file",
  "creationDate" : 1534372332000,
  "completionDate" : null,
  "dueDate" : "2018-08-31",
  "dueDateTimestamp" : 1535785199999,
  "assignor" : {
    "id" : 1,
    "username" : "jdoerr",
    "firstName" : "John",
    "lastName" : "Doerr",
    "email" : "jdoerr@acme.com",
    "status" : "ACTIVE",
    "typeName" : "admin"
  },
  "assignees" : [ {
    "id" : 6,
    "username" : "ssmith",
    "firstName" : "Sean",
    "lastName" : "Smith",
    "email" : "ssmith@egnyte.com",
    "status" : "ACTIVE",
    "typeName" : "guest"
  } ],
  "status" : "OPEN",
  "file" : {
    "path" : "/Shared/Projects/Project1/Public/P1-Est/strategy_slides9_05b.pdf",
    "name" : "strategy_slides9_05b.pdf",
    "parentPath" : "/Shared/Projects/Project1/Public/P1-Est",
    "entryId" : "642593bc-6e3e-4661-9bee-51cfe84b2207",
    "groupId" : "bbde8e1c-511c-44c0-866b-71e7b38c8acb",
    "folderId" : "e03e9416-bd34-4002-a5d3-c696a17085ac",
    "size" : 75130
  }
}

Change Task Status

This endpoint is used to change status of a specific task.

PATCH/pubapi/v1/tasks/{TASK_ID}

Request Parameters in the URI

Parameter Description RequiredPossible Values
TASK_ID The id of the task. Yes E.g. d2c3872c-c399-458b-bf19-b3792cbd37c7

Request Parameters in the Request Body

Parameter Description Required Possible Values
status New status of the task. Yes COMPLETED or OPEN, case-sensitive.

Method-specific Response Codes

Response Code Response Message HTTP Code Troubleshooting
OK 204 The request was fulfilled.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User has no permission to get the task. 403 Make sure you are either assignee or assignor of the task.
Not Found Task not found. 404 Ensure that the ID of the task is correct.
Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. 500 Try again later.

Request Examples

PATCH /pubapi/v1/tasks/d2c3872c-c399-458b-bf19-b3792cbd37c7  HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q

{
   "status":"COMPLETED"
}
curl -v --request PATCH -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" -H "Content-Type: application/json" --data '{"status":"COMPLETED"}' https://apidemo.egnyte.com/pubapi/v1/tasks/d2c3872c-c399-458b-bf19-b3792cbd37c7

No Response Body

Edit Task

This endpoint is used to edit a specific task.

PUT/pubapi/v1/tasks/{TASK_ID}

Request Parameters in the URI

Parameter Description Required Possible Values
TASK_ID The id of the task. Yes E.g. d2c3872c-c399-458b-bf19-b3792cbd37c7

Request Parameters in the Request Body

Parameter Description Required Possible Values
task The text of the task. Yes A non-empty string
assignees ID of an assignee of the task. Only one assignee is allowed now, although technically, it is placed in the array structure. The reason is that in the future, more than one assignee might be allowed for a task. Yes An array of only one element is allowed: "id" and then the numerical value of the user id, e.g. [{"id":6}]
dueDate Due date of the task. In case the dueDate is not specified in this PUT call, it will be set to null. No Date in the format: YYYY-MM-DD, e.g. 2018-08-29

Method-specific Response Codes

Response Code Response Message HTTP Code Troubleshooting
OK 200 The request was fulfilled.
Bad Request Unparsable JSON. 400 Make sure your JSON syntax is correct.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User has no permission to edit the task. 403 Make sure you are either assignee or assignor of the task.
Not Found Task not found. 404 Ensure that the ID of the task is correct.
Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. 500 Try again later.

Request Examples

PUT /pubapi/v1/tasks/d2c3872c-c399-458b-bf19-b3792cbd37c7  HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
Content-Type: application/json
{
   "task":"Archive the file",
   "assignees":[{"id":4}],
   "dueDate":"2022-08-29"
}
curl -v --request PUT -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" -H "Content-Type: application/json" --data '{"task":"Archive the file","assignees":[{"id":4}],"dueDate":"2022-08-29"}' https://apidemo.egnyte.com/pubapi/v1/tasks/d2c3872c-c399-458b-bf19-b3792cbd37c7

Sample Response

{
  "id" : "26e763e4-ee2c-4875-8223-9f3b214e6b5a",
  "task" : "Archive the file",
  "creationDate" : 1534497039000,
  "completionDate" : null,
  "dueDate" : "2022-08-29",
  "dueDateTimestamp" : 1661842799999,
  "assignor" : {
    "id" : 1,
    "username" : "jdoerr",
    "firstName" : "John",
    "lastName" : "Doerr",
    "email" : "jdoerr@acme.com",
    "status" : "ACTIVE",
    "typeName" : "admin"
  },
   "assignees" : [ {
      "id" : 4,
      "username" : "abourne",
      "firstName" : "Alice",
      "lastName" : "Bourne",
      "email" : "abourne@acme.com",
      "status" : "ACTIVE",
      "typeName" : "user"
    } ],
  "status" : "OPEN",
  "file" : {
    "path" : "/Shared/Projects/Project1/Public/P1-Est/strategy_slides9_05b.pdf",
    "name" : "strategy_slides9_05b.pdf",
    "parentPath" : "/Shared/Projects/Project1/Public/P1-Est",
    "entryId" : "642593bc-6e3e-4661-9bee-51cfe84b2207",
    "groupId" : "bbde8e1c-511c-44c0-866b-71e7b38c8acb",
    "folderId" : "e03e9416-bd34-4002-a5d3-c696a17085ac",
    "size" : 75130
  }
}

Delete Task

This endpoint is used to delete a specific task.

DELETE/pubapi/v1/tasks/{TASK_ID}

Request Parameters in the URI

Parameter Description Required
TASK_ID The id of the task to be deleted. Yes

Method-specific Response Codes

Response Code Response Message HTTP Code Troubleshooting
OK No content. 204 The task has been deleted.
Unauthorized Developer inactive. 401 Make sure you are logged in.
Forbidden User has no permission to delete the task. 403 Make sure your are either assignee or assignor of the task.
Not Found Task not found. 404 Ensure that the task with the {TASK_ID} 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/tasks/a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8 HTTP/1.1
Host: apidemo.egnyte.com
Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v --request DELETE -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" https://apidemo.egnyte.com/pubapi/v1/tasks/a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8