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.

OperationDescription
updateMessageModifies the message data.
deleteMessageDelete a message.
getMessageRetrieves a message.
getLatestMessagesRetrieves the most recent messages.
archiveAMessageArchive a message.
unarchiveAMessageUnarchive a message.
getArchivedMessagesRetrieves all archived messages.
getArchivedMessagesByCategoryRetrieves all archived messages by category.
getMessagesByCategoryRetrieves messages by category.

Operation details

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

Updating a message

The updateMessage operation updates a  message.

updateMessage
<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 message
  • private: 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.

Sample request for updateMessage
{
    "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.

deletMessage
<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.

Sample request for deleteMessage
{
    "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.

getMessage
<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.

Sample request for getMessage
{
    "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.

getLatestMessages
<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.

Sample request for getLatestMessages
{
    "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.

archiveAMessage
<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.

Sample request for archiveAMessage
{
    "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.

unarchiveAMessage
<teamwork.unarchiveAMessage>
	<messageId>{$ctx:messageId}</messageId>
</teamwork.unarchiveAMessage>
Properties
  • messageId: The id of the message.
Sample Request

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

Sample request for unarchiveAMessage
{
    "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.

getArchivedMessages
<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.

Sample request for getArchivedMessages
{
    "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.

getArchivedMessagesByCategory
<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.

Sample request for getArchivedMessagesByCategory
{
    "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.

getMessagesByCategory
<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.

Sample request for getMessagesByCategory
{
    "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.

Sample proxy
<?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>