Project Categories

Information on project categories, from creation to destruction

Creating Project Categories

POST /projectcategories.json

A new project category will be created

Request

{
  "category": 
 	{
      "name": "Demo Project Category", 
      "parent-id": "0"
    }
}
See Project Categories in Data Reference Section

Response

Returns HTTP status code 201 (“Created”) on success with the new category id.


Retrieve a single Project Category

GET /projectCategories/{id}.json

Will return a category on its own; this is identified by its integer ID.

Response

{
    "category": {
        "parent-id": "",
        "name": "Demo Project Category",
        "count": "0",
        "id": "999",
        "elements_count": "0",
        "type": "ProjectCategory"
    },
    "STATUS": "OK"
}
See Project Categories in Data Reference Section


Retrieve all Project Categories

GET /projectCategories.json

Will return all project categories

Response

{
    "categories": [
        {
            "parent-id": "",
            "name": "Demo Project Category",
            "count": "0",
            "elements-count": "0",
            "id": "999",
            "type": "ProjectCategory"
        }
    ],
    "STATUS": "OK"
}
See Project Categories in Data Reference Section


Updating a Project Category

PUT /projectCategories/{id}.json

Using the integer ID given, it will update an already existing category.

Request

{
  "category": 
 	{
      "name": "Demo Project Category 2", 
      "parent-id": "0"
    }
}
See Project Categories in Data Reference Section

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in json format) on error.


Destroying a Project Category

DELETE /projectCategories/{id}.json

Again using the specified integer ID, this will delete the appropriate category. However, categories can only be deleted when they contain no elements..

Response

Returns HTTP status code 200 on success. If the category contains elements a 409 status code (conflict) will be returned.