Returns a list of departments of a logged user.
Use this operation to get information about the departments the current user belongs to.
To get information on a specific department, use the /depts/{DeptId} (GET)
operation.
Authentication
Basic authentication using a user’s login and password. See Authentication for details.
Security Rights
The authenticating user must have access to departments you want to get. For more information, see Authentication.
Request Format
To get information on departments, send a GET request to the following URL:
offset : integer, default: 0
The number of departments to skip before counting the returned departments. The default value is 0, which is the offset of the first item. For details, see Paging Through Results Using Offset and Limit.
limit : integer, default: 25
The maximum number of departments to return in the response.
filter : string
The filter expression to apply to the returned list. See Search Filters.
A sample request:
GET http://yourserver.com/rest-api/service/api/v1/depts HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
A sample request made by using cURL:
curl -u [email protected]:p@ssword -H "Accept: application/json" http://yourserver.com/service/api/v1/depts
Response Format
If successful, the operation responds with HTTP status code 200 and returns a JSON object with departments information.
If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 317
{
"metadata": {
"result_set": {
"count": 1,
"offset": 0,
"limit": 25,
"total": 1
},
"permissions": {
"acl": 1
}
},
"results": [
{
"id": 8162,
"company_id": 8426,
"dept_name": "Your Company Name",
"update_user_id": 1234,
"date_created": "2015-03-10T13:25:55.1500000",
"date_updated": "2015-03-10T13:25:55.1500000",
"page_size": 25
}
]
}
Metadata about the departments.
Pagination information about the departments. (See Paging Through Results Using Offset and Limit.)
The number of returned departments.
The offset of the first department requested.
The maximum number of departments requested.
The total number of departments.
The authenticating user’s rights to access departments.
Access rights:
- 0 - None
- 1 - Read
- 2 - Update
- 3 - Read and update
- 4 - Delete
- 5 - Read and delete
- 7 - Full access
An array of available departments.
The department ID.
The company ID.
The department name.
The project name.
The unique identifier of the project.
The ID of the last user who updated the project.
The date and time when the department was created.
The date and time when the department was last updated.
The scheduled date and time when work on the project started.
The actual date and time when work on the project started.
The scheduled date and time when work on the project will complete.
The actual date and time when work on the project completed.
The estimated hours required to complete the project.
The actual hours spent working on the project.
The estimated cost of working on the project.
The actual cost of working on the project.
True if the project cost is estimated automatically.
True if the project is active and False if the project is hidden (archived).
The name of the last user, who updated the project, in the Lastname, Firstname format.
The number of notes attached to the project.
The number of calendar events attached to the project.
The number of files attached to the project.
The current page size.