Working with Notebooks
The commands listed in this article are used for managing Notebooks via the activeCollab API.
Notebook related API commands were introduced with activeCollab 3.3.9. These commands are not available in earlier releases.
About Notebooks #
The following Notebook fields can be used:
- name (string) - The Notebook name is a required field when a creating a Notebook.
- body (text) - The Notebook description.
- visibility (integer) - Object visibility. 0 marks private visibility and 1 is for normal visibility.
- milestone_id (integer) - The ID of the parent Milestone.
This is the list of resources used by Notebooks:
Additional commands are described in following articles:
projects/:project_id/notebooks #
This command lists all active Notebooks in a selected project.
Method: GET
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<notebooks> <notebook> <id>12</id> <name> <![CDATA[First Notebook]]> </name> <subpages> <subpage> <name> <![CDATA[First Subpage]]> </name> <permalink>...</permalink> <subpages> ... </subpages> </subpage> </subpages> ... </notebook> ... </notebooks>
projects/:project_id/notebooks/archive #
This command displays all archived Notebooks in a project.
Method: GET
Example response:
1 2 3 4 5 6 7 8 9
<notebooks> <notebooks> <id>12</id> <name> <![CDATA[Notebook example]]> </name> ... </notebooks> </notebooks>
projects/:project_id/notebooks/add #
This command creates a new Notebook in a project.
Method: POST
Request example:
1 2
notebook[name]=New Notebook submitted=submitted
Response:
1 2 3 4 5 6 7
<notebook> <id>17</id> <name> <![CDATA[New Notebook]]> </name> ... </notebook>
projects/:project_id/notebooks/:notebook_id #
This command displays the details of the specified Notebook.
Method: GET
Example response:
1 2 3 4 5 6 7 8 9 10
<notebook> <id>17</id> <name> <![CDATA[Notebook Name]]> </name> <subpages> ... </subpages> ... </notebook>
projects/project_id/notebooks/:notebook_id/edit #
This command updates the properties of the Notebook.
Method: POST
Request example:
1 2
notebook[name]=Updated Notebook Name submitted=submitted
Response:
1 2 3 4 5 6 7
<notebook> <id>17</id> <name> <![CDATA[Updated Notebook Name]]> </name> ... </notebook>
About Notebook Pages #
The Notebook Page fields that can be used are:
- name (string) - The Notebook Page title is a required value.
- body (text) - The Notebook Page description.
- parent_id (integer) - The ID of the parent Page. Leave blank to add the page at the first level of page hierarchy.
A list of resources used by Notebooks can be found here:
Additional commands are available on the following pages:
projects/:project_id/notebooks/:notebook_id/pages/add #
This command creates a new Page within the specified Notebook.
Method: POST
Request example:
1 2 3
notebook_page[name]=New Notebook Page notebook_page[body]=Text of the New Notebook Page submitted=submitted
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<notebook_page> <id>3</id> <name> <![CDATA[New Notebook Page]]> </name> ... <body> <![CDATA[Text of the New Notebook Page]]> </body> <body_formatted> <![CDATA[Text of the New Notebook Page]]> </body_formatted> ... </notebook_page>
projects/:project_id/notebooks/:notebook_id/pages/:page_id #
This command displays the Page details within the specified Notebook.
Method: GET
Example response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<notebook_page> <id>1</id> <name> <![CDATA[New Notebook Page]]> </name> ... <body> <![CDATA[Text of the New Notebook Page]]> </body> <body_formatted> <![CDATA[Text of the New Notebook Page]]> </body_formatted> ... <subpages> ... </subpages> </notebook_page>
projects/:project_id/notebooks/:notebook_id/pages/:page_id/edit #
This command updates the properties and the content of the Page. You can use is_minor_revision to tell activeCollab that the update is a minor revision and that a new version should not be created in the revision history.
Method: POST
Request example:
1 2 3
notebook_page[name]=Updated Notebook Page Name notebook_page[is_minor_revision]=0 submitted=submitted
Response:
1 2 3 4 5 6 7
<notebook_page> <id>1</id> <name> <![CDATA[Updated Notebook Page Name]]> </name> ... </notebook_page>
projects/:project_id/notebooks/:notebook_id/pages/page_id/revert/:version_number #
This command reverts to an earlier version of the Page.
Method: POST
Request example:
1
submitted = submitted
Response:
1 2 3 4 5 6 7 8 9
<notebook_page> <id>1</id> <name> <![CDATA[Notebook Page Name]]> </name> ... <version>1</version> ... </notebook_page>