This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Notebooks in Teamwork



Overview

The following operations allow you to work with notebooks. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with attachments, see Sample configuration.

OperationDescription
updateNotebookModifies a Notebook.
deleteNotebookDeletes a Notebook.
getNotebookReturns a Notebook identified by it id.
getAllNotebooksRetrieves all accessible Notebooks.
getNotebooksInCategoryRetrieves all the notebooks for a specific category.
getNotebooksOnProjectRetrieves all the notebooks for a project.
lockNotebookLocks the notebook and all versions for editing.
unlockNotebooknlocks a locked notebook so it can be edited again.

Operation details

This section provides further details on the operations related to discussions.

Updating a notebook

The updateNotebook operation updates a  notebook.

updateNotebook
<teamwork.updateNotebook>
    <notebookId>{$ctx:notebookId}</notebookId>
    <name>{$ctx:name}</name>
    <description>{$ctx:description}</description>
    <content>{$ctx:content}</content>
    <notify>{$ctx:notify}</notify>
    <categoryId>{$ctx:categoryId}</categoryId>
    <categoryName>{$ctx:categoryName}</categoryName>
    <private>{$ctx:private}</private>
    <newVersion>{$ctx:newVersion}</newVersion>
	<grantAccessTo>{$ctx:grantAccessTo}</grantAccessTo>
</teamwork.updateNotebook>
Properties
  • notebookId: The id of the notebook.
  • name: The name of the notebook.
  • description: The description of the notebook.
  • content: The content of the notebook.
  • notify: The notify status of the notebook(true/false).
  • categoryId: The category id of the notebook.
  • categoryName: The category name of the notebook.
  • private: The private status of the notebook(true/false).
  • newVersion: Whether new version of the notebook(true/false).
  • grantAccessTo: The ids of users who can access of the notebook.
Sample Request

Following is a sample REST/JSON request that can be handled by the updateNotebook operation.

Sample request for updateNotebook
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"notebookId":"42139",
	"name":"Testnotebook",
	"description":"notebook description",
	"content":"Textfornotebook",
	"notify":"true",
	"categoryId":"9",
	"categoryName":"notebookCategoryName",
	"private":"true",
	"newVersion":"true",
	"grantAccessTo":"149195"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#update_a_single_n

Deleting a notebook

The deleteNotebook operation deletes a  notebook.

deleteNotebook
<teamwork.deleteNotebook>
	<notebookId>{$ctx:notebookId}</notebookId>
</teamwork.deleteNotebook>
Properties
  • notebookId: The id of the notebook.
Sample Request

Following is a sample REST/JSON request that can be handled by the deleteNotebook operation.

Sample request for deleteNotebook
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"notebookId":"42139"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#delete_a_single_n

Retrieving a notebook

The getNotebook operation retrieves the notebook of given id.

getNotebook
<teamwork.getNotebook>
	<notebookId>{$ctx:notebookId}</notebookId>
</teamwork.getNotebook>
Properties
  • notebookId: The id of the notebook.
Sample Request

Following is a sample REST/JSON request that can be handled by the getNotebook operation.

Sample request for getNotebook
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"notebookId":"42139"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#get_a_single_note

Retrieving all notebooks

The getAllNotebooks operation retrieves all the notebooks.

getAllNotebooks
<teamwork.getAllNotebooks>
	<includeContent>{$ctx:includeContent}</includeContent>
</teamwork.getAllNotebooks>
Properties
  • includeContent: Whether includes the content of the notebook(true/false).

Sample Request

Following is a sample REST/JSON request that can be handled by the getAllNotebooks operation.

Sample request for getNotebook
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"includeContent":"true"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#list_all_notebook

Retrieving notebooks in a category

The getNotebooksInCategory operation retrieves all the notebooks in a specific category.

getNotebooksInCategory
<teamwork.getNotebooksInCategory>
    <notebookCategoryId>{$ctx:notebookCategoryId}</notebookCategoryId>
	<includeContent>{$ctx:includeContent}</includeContent>
</teamwork.getNotebooksInCategory>
Properties
  • notebookCategoryId: The id of notebook category.

  • includeContent: Whether includes the content of the notebook(true/false).
Sample Request

Following is a sample REST/JSON request that can be handled by the getNotebooksInCategory operation.

Sample request for getNotebooksInCategory
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"notebookCategoryId":"9",
    "includeContent":"true"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#list_notebooks_in

Retrieving notebooks on a Project

The getNotebooksOnProject operation retrieves all the notebooks in a project.

getNotebooksOnProject
<teamwork.getNotebooksOnProject>
	<projectId>{$ctx:projectId}</projectId>
    <includeContent>{$ctx:includeContent}</includeContent>
</teamwork.getNotebooksOnProject>
Properties
  • projectId: The id of project.

  • includeContent: Whether includes the content of the notebook(true/false).
Sample Request

Following is a sample REST/JSON request that can be handled by the getNotebooksOnProject operation.

Sample request for getNotebooksOnProject
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"projectId":"90538",
    "includeContent":"true"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#list_notebooks_on

Locking a notebook

The lockNotebook operation locks a notebook and all versions for editing.

lockNotebook
<teamwork.lockNotebook>
	<notebookId>{$ctx:notebookId}</notebookId>
</teamwork.lockNotebook>
Properties
  • notebookId: The id of the notebook.
Sample Request

Following is a sample REST/JSON request that can be handled by the lockNotebook operation.

Sample request for lockNotebook
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"notebookId":"42139"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#lock_a_single_not

Unlocking a notebook

The unlockNotebook operation unlocks a notebook so it can be edited again.

unlockNotebook
<teamwork.unlockNotebook>
	<notebookId>{$ctx:notebookId}</notebookId>
</teamwork.unlockNotebook>
Properties
  • notebookId: The id of the notebook.
Sample Request

Following is a sample REST/JSON request that can be handled by the unlockNotebook operation.

Sample request for lockNotebook
{
	"apiUrl":"https://wso2test.teamwork.com/",
	"apiKey":"clark42ceiling",
	"notebookId":"42139"
}
Related Teamwork documentation

http://developer.teamwork.com/notebooks#unlock_a_single_n

Sample configuration

Following is a sample proxy service that illustrates how to connect to Teamwork with the init operation and use the getNotebooksOnProject operation. The sample request for this proxy can be found in getNotebooksOnProject sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="tw_getNotebooksOnProject"
       transports="https http"
       startOnLoad="true"
       trace="disable">
   <description/>
   <target>
      <inSequence>
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiKey" expression="json-eval($.apiKey)"/>
         <property name="projectId" expression="json-eval($.projectId)"/>
         <property name="includeContent" expression="json-eval($.includeContent)"/>
         <teamwork.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
         </teamwork.init>
         <teamwork.getNotebooksOnProject>
            <projectId>{$ctx:projectId}</projectId>
            <includeContent>{$ctx:includeContent}</includeContent>
         </teamwork.getNotebooksOnProject>
         <respond/>
      </inSequence>
      <outSequence/>
      <faultSequence/>
   </target>
</proxy>