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 Links in Teamwork



Overview

The following operations allow you to work with links. 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
updateLinkModifies a single link.
deleteLinkDeletes a link.
getLinkReturns a Link identified by its id.
getAllLinksRetrieves all Links.
getLinksOnProjectRetrieve all the links on a project.

Operation details

This section provides further details on the operations related to discussions 

The updateLink operation updates a  link.

updateLink
<teamwork.updateLink>
    <linkId>{$ctx:linkId}</linkId>
    <name>{$ctx:name}</name>
    <description>{$ctx:description}</description>
    <private>{$ctx:private}</private>
    <code>{$ctx:code}</code>
    <width>{$ctx:width}</width>
    <height>{$ctx:height}</height>
    <categoryId>{$ctx:categoryId}</categoryId>
    <categoryName>{$ctx:categoryName}</categoryName>
    <notify>{$ctx:notify}</notify>
	<openInNewWindow>{$ctx:openInNewWindow}</openInNewWindow>
</teamwork.updateLink>
Properties
  • linkId: The id of the link.
  • name: The name of the link.
  • description: The description of the link.
  • private: The private status of the link.
  • code: The valid Embed Code IFrame Code or a URL.
  • width: The width of the link.
  • height: The height of the link.
  • categoryId: The category id of the link.
  • categoryName: The category name of the link.
  • notify: The notify ids of the link.
  • openInNewWindow: Whether open in new window
Sample Request

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

Sample request for updateLink
{
  "apiUrl":"https://wso2test.teamwork.com/",
  "apiKey":"clark42ceiling",
  "linkId":"13236",
  "name": "teamwork",
  "description": "The Teamwork website",
  "private":"0",
  "code": "http://teamwork.com",
  "width": "800",
  "height": "600",
  "categoryId": "999",
  "categoryName":"Demo",
  "notify": "149195",
  "openInNewWindow": "1"
}
Related Teamwork documentation

http://developer.teamwork.com/links#update_a_single_l

The deleteLink operation deletes a  link.

deleteLink
<teamwork.deleteLink>
	<linkId>{$ctx:linkId}</linkId>
</teamwork.deleteLink>
Properties
  • linkId: The id of the link.
Sample Request

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

Sample request for deleteLink
{
  "apiUrl":"https://wso2test.teamwork.com/",
  "apiKey":"clark42ceiling",
  "linkId":"13236"
}
Related Teamwork documentation

http://developer.teamwork.com/links#delete_a_single_l

The getLink operation retrieves the link of given id.

getLink
<teamwork.getLink>
	<linkId>{$ctx:linkId}</linkId>
</teamwork.getLink>
Properties
  • linkId: The id of the link.
Sample Request

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

Sample request for getLink
{
  "apiUrl":"https://wso2test.teamwork.com/",
  "apiKey":"clark42ceiling",
  "linkId":"13236"
}
Related Teamwork documentation

http://developer.teamwork.com/links#get_a_single_link

The getAllLinks operation retrieves all the links.

getAllLinks
<teamwork.getAllLinks/>
Sample Request

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

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

http://developer.teamwork.com/links#list_all_links

Retrieving links on a project

The getLinksOnProject operation retrieves all the links on a given project id.

getLinksOnProject
<teamwork.getLinksOnProject>
	<projectId>{$ctx:projectId}</projectId>
</teamwork.getLinksOnProject>
Properties
  • projectId: The id of the project.
Sample Request

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

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

http://developer.teamwork.com/links#list_links_on_a_p

Sample configuration

Following is a sample proxy service that illustrates how to connect to Teamwork with the init operation and use the getLinksOnProject operation. The sample request for this proxy can be found in getLinksOnProject 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_getLinksOnProject"
       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.getLinksOnProject>
            <projectId>{$ctx:projectId}</projectId>
         </teamwork.getLinksOnProject>
         <respond/>
      </inSequence>
      <outSequence/>
      <faultSequence/>
   </target>
</proxy>