Labels

activeCollab ships with a couple of predefined project labels:

Response: HTTP 200, application/json (Hide)
GET /labels/project-labels

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[
    {
        "id": 1,
        "class": "ProjectLabel",
        "url_path": "\/labels\/1",
        "name": "NEW",
        "updated_on": null,
        "color": "#FFFF00",
        "is_default": false,
        "position": 1
    },
    {
        "id": 2,
        "class": "ProjectLabel",
        "url_path": "\/labels\/2",
        "name": "INPROGRESS",
        "updated_on": null,
        "color": "#00A651",
        "is_default": false,
        "position": 2
    },
    {
        "id": 3,
        "class": "ProjectLabel",
        "url_path": "\/labels\/3",
        "name": "CANCELED",
        "updated_on": null,
        "color": "#FF0000",
        "is_default": false,
        "position": 3
    },
    {
        "id": 4,
        "class": "ProjectLabel",
        "url_path": "\/labels\/4",
        "name": "PAUSED",
        "updated_on": null,
        "color": "#0000FF",
        "is_default": false,
        "position": 4
    }
]

For the sake of this test, lets assume that company who is useding the system does not find these defaults good for their workflow, and that they would like to implement something like this for their projects:

IDEA -> CONFIRMED or CANCELED -> INPROGRESS or PAUSED -> DONE or CANCELED

What we need to do is:

  1. Rename a NEW label to IDEA
  2. Add CONFRIEMD and DONE labels
  3. Reorder labels so they are in the sequence that works for the proposed workflow:
  • IDEA (1)
  • CONFIRMED (will be 16)
  • INPROGRESS (2)
  • PAUSED (4)
  • DONE (will be 17)
  • CANCELED (3)

Lets start by renaming an existing label:

Response: HTTP 200, application/json (Hide)
PUT /labels/1

Payload:

1
2
3
{
    "name": "Idea"
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
{
    "single": {
        "id": 1,
        "class": "ProjectLabel",
        "url_path": "\/labels\/1",
        "name": "IDEA",
        "updated_on": 1430164484,
        "color": "#FFFF00",
        "is_default": false,
        "position": 1
    }
}

Now, we need to add the new labels:

Response: HTTP 200, application/json (Hide)
POST /labels

Payload:

1
2
3
4
{
    "type": "ProjectLabel",
    "name": "Confirmed"
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
{
    "single": {
        "id": 16,
        "class": "ProjectLabel",
        "url_path": "\/labels\/16",
        "name": "CONFIRMED",
        "updated_on": 1430164484,
        "color": null,
        "is_default": false,
        "position": 5
    }
}
Response: HTTP 200, application/json (Hide)
POST /labels

Payload:

1
2
3
4
{
    "type": "ProjectLabel",
    "name": "Done"
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
{
    "single": {
        "id": 17,
        "class": "ProjectLabel",
        "url_path": "\/labels\/17",
        "name": "DONE",
        "updated_on": 1430164484,
        "color": null,
        "is_default": false,
        "position": 6
    }
}

Finally, lets reorder the labels:

Response: HTTP 200, application/json (Hide)
PUT /labels/reorder

Payload:

1
2
3
4
5
6
7
8
[
    1,
    16,
    2,
    3,
    17,
    3
]

Response:

1
2
3
4
5
6
7
8
[
    1,
    16,
    2,
    3,
    17,
    3
]
Response: HTTP 200, application/json (Hide)
GET /labels/project-labels

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
[
    {
        "id": 1,
        "class": "ProjectLabel",
        "url_path": "\/labels\/1",
        "name": "IDEA",
        "updated_on": 1430164484,
        "color": "#FFFF00",
        "is_default": false,
        "position": 1
    },
    {
        "id": 16,
        "class": "ProjectLabel",
        "url_path": "\/labels\/16",
        "name": "CONFIRMED",
        "updated_on": 1430164484,
        "color": null,
        "is_default": false,
        "position": 2
    },
    {
        "id": 2,
        "class": "ProjectLabel",
        "url_path": "\/labels\/2",
        "name": "INPROGRESS",
        "updated_on": 1430164484,
        "color": "#00A651",
        "is_default": false,
        "position": 3
    },
    {
        "id": 4,
        "class": "ProjectLabel",
        "url_path": "\/labels\/4",
        "name": "PAUSED",
        "updated_on": null,
        "color": "#0000FF",
        "is_default": false,
        "position": 4
    },
    {
        "id": 17,
        "class": "ProjectLabel",
        "url_path": "\/labels\/17",
        "name": "DONE",
        "updated_on": 1430164484,
        "color": null,
        "is_default": false,
        "position": 5
    },
    {
        "id": 3,
        "class": "ProjectLabel",
        "url_path": "\/labels\/3",
        "name": "CANCELED",
        "updated_on": 1430164484,
        "color": "#FF0000",
        "is_default": false,
        "position": 6
    }
]

If we ever wish to drop a label, we can simply send a DELETE request to labels URL:

Response: HTTP 200, text/html
DELETE /labels/3