Skip to content

WorkspaceCalendar

Daniel Stockhammer edited this page Aug 1, 2016 · 10 revisions

Summary

Workspace calendars represent a collection of tasks for a workspace.

Beta warning

The calendar APIs are in Beta and differ in format to the other APIs documented here, documentation about how to use the calendar APIs can be found at the CalendarApi page.

Operations

Retrieving a calendar

Each workspace includes a calendar that contains all the Tasks for that workspace.

Example

Request

GET /v2/calendar/workspaces/123 HTTP/1.1
Content-Type: application/xml
Accept: application/xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/xml
<WorkspaceCalendar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Uri="...">
  <Workspace
    Id="..."
    Uri="...">
    <DisplayName>My workspace</DisplayName>
  </Workspace>
  <Events>
    <Task ... />
  </Events>
</WorkspaceCalendar>

Retrieving a calendar (paged)

The paged calendar endpoint is the preferred way of retrieving tasks. It returns the same data as the non-paged endpoint. In addition to URI parameters controlling paging and ordering, all filters from the non-paged endpoint are available.

Parameter Default value Additional notes
pagesize 50 Minimum value: 0; Maximum value: 500
skipitems 0
ordering duedate,desc Avalable fields: duedate, status; Available directions: asc, desc

If there are more tasks than the current page size, the link collection will contain a next link. If there is a previous page, the link collection will return a prev link. Use these links to navigate between pages.

Link relations

Name Description Methods
next The URI of the next page, using sort order specified. GET
prev The URI of the previous page, using sort order specified. GET

Example

Request

GET /tasks/workspaces/123/paged?pagesize=10&skipitems=100 HTTP/1.1
Content-Type: application/xml
Accept: application/xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/xml
<WorkspaceCalendar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Uri="...">
  <links>
    <link rel="self" href=".../tasks/workspaces/123/paged?pagesize=10&skipitems=100" />
    <link rel="prev" href=".../tasks/workspaces/123/paged?pagesize=10&skipitems=90" />
    <link rel="next" href=".../tasks/workspaces/123/paged?pagesize=10&skipitems=110" />    
  <links>
  <Workspace
    Id="..."
    Uri="...">
    <DisplayName>My workspace</DisplayName>
  </Workspace>
  <Events>
    <Task ... />
  </Events>
</WorkspaceCalendar>

Creating a task

This resource supports creating a new Task.

When retrieving a workspace calendar the resource representation in the response will include a Uri attribute. To create a task a POST request should be made to the URI of the workspace calendar with a representation of the task resource to be created.

Example

Request

POST /v2/calendar/workspaces/123 HTTP/1.1
Content-Type: application/xml
Accept: application/xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<?xml version="1.0" encoding="utf-8"?>
<Task xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="0">
    <Status>NotStarted</Status>
    <DueDate>2011-05-11T00:00:00Z</DueDate>
    <PlannedStartDate>2011-05-10T00:00:00Z</PlannedStartDate>
    <CompletedDate xsi:nil="true" />
    <CompletedBy xsi:nil="true" />
    <CreatedDate xsi:nil="true" />
    <UpdatedDate xsi:nil="true" />
    <Title>A new test task</Title>
    <Description>Test description</Description>
</Task>

Response

If successful, this operation will return a 201 Created with a Location header pointing to your new task, and a representation of your new task in the response body.


Syntax

Examples

A workspace calendar

IN PROGRESS

Properties

Name Description
Classic
Clone this wiki locally