Unfuddle STACK API
Introduction
Notebooks are probably the most obfuscated data model in Unfuddle. This is because of how page versioning works. You will need to be very aware of which id's you are passing around when manipulating Notebooks.
Each Page object in a Notebook actually represents a specific version of a conceptual page within a Notebook. The real world concept of a page in Notebook is actually defined by the 'number' field on each Page object.
Each Project can have any number of Notebooks.
Each Notebook can have any number of many Pages.
Each Page actually represents a version of a conceptual page.
Each Page object has a completely unique id as well as a 'number', indicating the conceptual page to which it belongs.
Each Notebook can have any number of Attachments. See Attachments for more information.
Notebooks
The collection represents all Notebooks for either an Account or a Project.
- URL:
- /api/v1/notebooks[GET]
- /api/v1/projects/{id}/notebooks[GET, POST]
- /api/v1/projects/{id}/notebooks/{id}[GET, PUT, DELETE]
- Response Formats:
- XML, JSON
- Request/Response Body:
- See Notebook Data Model
- Example:
-
curl -i -u username:password -X GET \\ -H 'Accept: application/xml' \\ https://mysubdomain.unfuddle.com/api/v1/projects/9875/notebooks.xml
Pages
The collection represents all Pages within a Notebook.
- URL:
- /api/v1/projects/{id}/notebooks/{id}/pages[GET, POST]
- /api/v1/projects/{id}/notebooks/{id}/pages/by_title/{title}[GET]
- /api/v1/projects/{id}/notebooks/{id}/pages/unique[GET]
- /api/v1/projects/{id}/notebooks/{id}/pages/{id}[GET, PUT, DELETE]
- /api/v1/projects/{id}/notebooks/{id}/pages/{id}/root[GET]
- /api/v1/projects/{id}/notebooks/{id}/pages/{id}/latest[GET]
- /api/v1/projects/{id}/notebooks/{id}/pages/{id}/versions[GET]
- Response Formats:
- XML, JSON
- Request/Response Body:
- See Page Data Model
- Notes:
-
Updating a Page will always create a new version of the given Page with a version number that is higher than the maximum version for that Page number. The exception to this is if the 'minor' boolean is set to true. In that case, the latest version of the Page will be updated as a minor change.
Deleting any Page with the provided ID will delete all versions of the Page with the same number.
Please note that the "root", "latest", and "by_title" URLs are meant as a convenience only. If you wish to POST or DELETE to a Page, you must use the URL based on the Page ID.
The root of a Page represents version 1 of the page, while the latest of a page represents its latest version.
The unique URL represents the most latest versions of all Pages currently in the Notebook.
- Example:
-
curl -i -u username:password -X GET \\ -H 'Accept: application/xml' \\ 'https://mysubdomain.unfuddle.com/api/v1/projects/9875/notebooks/234/pages/unique.xml?formatted=true'
Compare Pages
The response represents the unified diff obtained from comparing two versions of the page.
- URL:
- /api/v1/projects/{id}/notebooks/{id}/pages/{id}/compare[GET]
- Response Formats:
- DIFF
- Parameters (via query string or request body):
-
<request> <!-- REQUIRED: one the versions chosen for the comparison --> <version_a>dashboard widget</version_b> <!-- REQUIRED: the other version chosen for the comparison--> <version_b>20</version_b> </request>
- Example:
-
curl -i -u username:password -X GET \\ -H 'Accept: text/x-diff' \\ -H 'Content-Type: application/xml' \\ -d '<request><version_a>1</version_a><version_b>3</version_b></request>' \\ https://mysubdomain.unfuddle.com/api/v1/projects/1/notebooks/1/pages/1/compare