Areas

Manage areas in TeamPulse.

GET /areas/{id} - Get area by ID

GET /areas - Get all areas for the projects to which user has access to.

GET /projects/{projectId}/areas - Get all areas for a specific project

POST /areas - Create an area

PUT /areas/{id} - Update an area

DELETE /areas/{id} - Delete an area

Area Model

The object representing an area has the following properties:

id: integer (Read-only) - ID of the area.

projectId: integer (Required, Read-only) - ID of the project to which the area belongs to.

parentId: integer (Required) - ID of the parent. The value is -1 in case of a root area.

NOTE: The parentId of the root area cannot be changed.

name: string (Required) - Name of the area.

path: string (Read-only) - Path to the area.

sequence: integer - Sequence order of the area in the list of areas. If the sequence of 0 is supplied, the area will be ordered on top. If a sequence of some big number (i.e. 1000) is supplied, the area will be ordered at the bottom.

createdBy: string - The name of the user who created the area

createdAt: DateTime - The date when the area is created

lastModifiedBy: string - The name of the user who last modified the area

lastModifiedAt: DateTime - The date when the area is last modified

Resource Url

To make API requests use the URL [teampulse]/api/v1 where [teampulse] is the URL to the TeamPulse instance which you want to manage via the API.

Example:
[teampulse]/api/v1/areas

Get area

GET /areas/{id}

Response

HTTP/1.1 200

{
  "id": 1,
  "name": "Sample name 1",
  "path": "Project name\\Sample name 1",
  "parentId": 1,
  "sequence": 1,
  "projectId": 1,
  "createdBy": "Paul Smith",
  "createdAt": "2013-06-20T10:10:00",
  "lastModifiedBy": "Paul Smith",
  "lastModifiedAt": "2013-06-20T11:45:00"
}

Get areas

GET /areas : Get all areas for the projects to which user has access to.

GET /projects/{projectId}/areas : Get all areas for a specific project

OData $filter and $orderby options can be supplied to filter and order the results. $top and $skip to get top N items and skip the top M. Read more how to use the OData options

Response

HTTP/1.1 200

{
  "totalResults": 3,
  "top": 3,
  "results": [
    {
      "id": 1,
      "name": "Sample name 1",
      "path": "Project name\\Sample name 1",
      "parentId": 1,
      "sequence": 1,
      "projectId": 1,
      "createdBy": "Paul Smith",
      "createdAt": "2013-06-20T10:10:00",
      "lastModifiedBy": "Paul Smith",
      "lastModifiedAt": "2013-06-20T11:45:00"

    },
    {
      "id": 2,
      "name": "Sample name 2",
      "path": "Project name\\Sample name 2",
      "parentId": 1,
      "sequence": 2,
      "projectId": 1,
      "createdBy": "Paul Smith",
      "createdAt": "2013-06-20T10:10:00",
      "lastModifiedBy": "Paul Smith",
      "lastModifiedAt": "2013-06-20T11:45:00"
    },
    {
      "id": 3,
      "name": "Sample name 3",
      "path": "Project name\\Sample name 3",
      "parentId": 1,
      "sequence": 3,
      "projectId": 1,
      "createdBy": "Paul Smith",
      "createdAt": "2013-06-20T10:10:00",
      "lastModifiedBy": "Paul Smith",
      "lastModifiedAt": "2013-06-20T11:45:00"
    }
  ]
}

Create an area

POST /areas

Request

{
  "name": "Sample name 1",
  "path": "Project name\\Sample name 1",
  "parentId": 1,
  "sequence": 1,
  "projectId": 1
}

Response

HTTP/1.1 201

{
  "id": 1,
  "name": "Sample name 1",
  "path": "Project name\\Sample name 1",
  "parentId": 1,
  "sequence": 1,
  "projectId": 1,
  "createdBy": "Paul Smith",
  "createdAt": "2013-06-20T10:10:00",
  "lastModifiedBy": "Paul Smith",
  "lastModifiedAt": "2013-06-20T10:10:00"
}

Update an area

PUT /areas/{id}

Request

{
  "name": "Sample name 1",
  "sequence": 1
}

Response

HTTP/1.1 200

{
  "id": 1,
  "name": "Sample name 1",
  "path": "Project name\\Sample name 1",
  "parentId": 1,
  "sequence": 1,
  "projectId": 1,
  "createdBy": "Paul Smith",
  "createdAt": "2013-06-20T10:10:00",
  "lastModifiedBy": "Paul Smith",
  "lastModifiedAt": "2013-06-20T11:45:00"
}

Delete an area

DELETE /areas/{id}?reassignmentId={reassignmentId}

reassignmentId - The ID of the area to which the items under the deleted one to be reassigned. Default value is the root area.

Response

HTTP/1.1 200