Notebook Categories API Calls

Information on categories, from creation to destruction

Creating Categories

POST /projects/{project_id}/notebookCategories.json

A new category will be created and attached to your specified project ID.

Request

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

Response

Returns HTTP status code 201 (“Created”) on success, with the Location header set to the “Get category” URL for the new category. The new category ID can be extracted from that URL. On failure, a non-200 status code will be returned, possibly with error information in json format as the response’s content.


Retrieve a Single Category

GET /notebookCategories/{id}.json

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

Response

{
    "category": {
        "project-id": "999",
        "parent-id": "",
        "name": "Demo Notebooks",
        "count": "1",
        "id": "999",
        "elements_count": "1",
        "type": "NotebookCategory"
    },
    "STATUS": "OK"
}
See Categories in Data Reference Section


Retrieving all of a Projects Categories

GET /projects/{project_id}/notebookCategories.json

All the notebook categories for your project will be returned.

Response

{
    "categories": [
        {
            "project-id": "999",
            "parent-id": "",
            "name": "Demo Notebooks",
            "count": "1",
            "description": "",
            "id": "999",
            "elements_count": "1",
            "type": "NotebookCategory"
        }
    ],
    "STATUS": "OK"
}
See Categories in Data Reference Section


Updating a Category

PUT /notebookCategories/{id}.json

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

Request

{
  "category": 
 	{
      "name": "Demo Notebooks 2",
      "parent-id": "0"
    }
}
See 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 Category

DELETE /notebookCategories/{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.