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 Messages in Teamwork
Overview
The following operations allow you to work with messages. 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.
Operation | Description |
---|---|
updateMessage | Modifies the message data. |
deleteMessage | Delete a message. |
getMessage | Retrieves a message. |
getLatestMessages | Retrieves the most recent messages. |
archiveAMessage | Archive a message. |
unarchiveAMessage | Unarchive a message. |
getArchivedMessages | Retrieves all archived messages. |
getArchivedMessagesByCategory | Retrieves all archived messages by category. |
getMessagesByCategory | Retrieves messages by category. |
Operation details
This section provides further details on the operations related to discussions.
Updating a message
The update
Message operation updates a message.
<teamwork.updateMessage> <messageId>{$ctx:messageId}</messageId> <title>{$ctx:title}</title> <categoryId>{$ctx:categoryId}</categoryId> <notify>{$ctx:notify}</notify> <private>{$ctx:private}</private> <messageBody>{$ctx:messageBody}</messageBody> <attachments>{$ctx:attachments}</attachments> <pendingFileAttachments>{$ctx:pendingFileAttachments}</pendingFileAttachments> </teamwork.updateMessage>
Properties
messageId
: The id of the message.title
: The title of the message.categoryId
: The category id of the message.notify
: The ids of people who get notified by the messageprivate
: The private status of the message.messageBody
: The body of the message.attachments
: The attachments of the message.pendingFileAttachments
: The pending file attachments of the message.
Sample Request
Following is a sample REST/JSON request that can be handled by the updateMessage
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "messageId": "174704", "title": "WelCome", "categoryId": "0", "notify": "81424", "private": "0", "messageBody": "Message content goes here", "attachments": "745098", "pendingFileAttachments": "tf_BC11BCB2-EFF5-D020-0457C3EDDD3B0491" }
Related Teamwork documentation
http://developer.teamwork.com/messages#update_message
Deleting a message
The deleteMessage
operation deletes a message.
<teamwork.deleteMessage> <messageId>{$ctx:messageId}</messageId> </teamwork.deleteMessage>
Properties
messageId: The id of the message.
Sample Request
Following is a sample REST/JSON request that can be handled by the deleteMessage
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "messageId": "174704" }
Related Teamwork documentation
http://developer.teamwork.com/messages#destroy_message
Retrieving a message
The getMessage
operation retrieves the message of given id.
<teamwork.getMessage> <messageId>{$ctx:messageId}</messageId> </teamwork.getMessage>
Properties
messageId: The id of the message.
Sample Request
Following is a sample REST/JSON request that can be handled by the getMessage
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "messageId": "174704" }
Related Teamwork documentation
http://developer.teamwork.com/messages#retrieve_a_single
Retrieving latest message
The getLatestMessages
operation retrieves the latest messages.
<teamwork.getLatestMessages> <projectId>{$ctx:projectId}</projectId> </teamwork.getLatestMessages>
Properties
projectId: The id of the project.
Sample Request
Following is a sample REST/JSON request that can be handled by the getLatestMessages
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538" }
Related Teamwork documentation
http://developer.teamwork.com/messages#retrieve_latest_m
Archive a message
The archiveAMessage
operation archives a message.
<teamwork.archiveAMessage> <messageId>{$ctx:messageId}</messageId> </teamwork.archiveAMessage>
Properties
messageId: The id of the message.
Sample Request
Following is a sample REST/JSON request that can be handled by the archiveAMessage
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "messageId": "174704" }
Related Teamwork documentation
http://developer.teamwork.com/messages#archive_a_message
Un-archive a message
The unarchiveAMessage
operation unarchives a message.
Properties
messageId: The id of the message.
Sample Request
Following is a sample REST/JSON request that can be handled by the unarchiveAMessage
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "messageId": "174704" }
Related Teamwork documentation
http://developer.teamwork.com/messages#un-archive_a_mess
Retrieving archived messages
The getArchivedMessages
operation retrieves the archived messages.
<teamwork.getArchivedMessages> <projectId>{$ctx:projectId}</projectId> </teamwork.getArchivedMessages>
Properties
projectId: The id of the project.
Sample Request
Following is a sample REST/JSON request that can be handled by the getArchivedMessages
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538" }
Related Teamwork documentation
http://developer.teamwork.com/messages#get_archived_mess
Retrieving archived messages by category
The getArchivedMessagesByCategory
operation retrieves the archived messages by category.
<teamwork.getArchivedMessagesByCategory> <projectId>{$ctx:projectId}</projectId> <messageCategoryId>{$ctx:messageCategoryId}</messageCategoryId> </teamwork.getArchivedMessagesByCategory>
Properties
projectId: The id of the project.
messageCategoryId
: the id of the message category.
Sample Request
Following is a sample REST/JSON request that can be handled by the getArchivedMessagesByCategory
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538", "messageCategoryId": "231558" }
Related Teamwork documentation
http://developer.teamwork.com/messages#get_archived_mess
Retrieving messages by category
The getMessagesByCategory
operation retrieves the messages by category.
<teamwork.getMessagesByCategory> <projectId>{$ctx:projectId}</projectId> <messageCategoryId>{$ctx:messageCategoryId}</messageCategoryId> </teamwork.getMessagesByCategory>
Properties
projectId: The id of the project.
messageCategoryId
: the id of the message category.
Sample Request
Following is a sample REST/JSON request that can be handled by the getMessagesByCategory
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538", "messageCategoryId": "231558" }
Related Teamwork documentation
http://developer.teamwork.com/messages#retrieve_messages
Sample configuration
Following is a sample proxy service that illustrates how to connect to Teamwork with the init
operation and use the getArchivedMessages
operation. The sample request for this proxy can be found in getArchivedMessages sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="tw_getArchivedMessages" 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)"/> <teamwork.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </teamwork.init> <teamwork.getArchivedMessages> <projectId>{$ctx:projectId}</projectId> </teamwork.getArchivedMessages> <respond/> </inSequence> <outSequence/> <faultSequence/> </target> </proxy>