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 Subscriptions in Yammer
Overview
The following operations allow you to work with subscriptions. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with subscriptions, see Sample configuration.
Operation | Description |
---|---|
Adds a new subscription. | |
deleteSubscription | Deletes an existing subscription. |
getSubThread | Retrieves the thread subscribed to. |
getSubTopic | Retrieves the topic subscribed to. |
getSubUser | Retrieves the user. |
Operation details
This section provides further details on the operations related to subscriptions.
Adding a subscription
The addSubscription
operation adds a new subscription.
<yammer.addSubscription> <targetType>{$ctx:targetType}</targetType> <targetId>{$ctx:targetId}</targetId> </yammer.addSubscription>
Properties
The target type to which the user will subscribe or unsubscribe.targetType:
The ID of the object to which the user will subscribe or unsubscribe.targetId:
Sample request
Following is a sample REST/JSON request that can be handled by the addSubscription
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"bwGBT89WMbAwefDZHVaZA", "responseType":"json", "targetType":"topic", "targetId":"6399334" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-subscriptions
Deleting an existing subscription
The deleteSubscription operation deletes an existing subscription.
<yammer.deleteSubscription> <targetType>{$ctx:targetType}</targetType> <targetId>{$ctx:targetId}</targetId> </yammer.deleteSubscription>
Properties
The target type to which the user will subscribe or unsubscribe.targetType:
The ID of the object to which the user will subscribe or unsubscribe.targetId:
Sample request
Following is a sample REST/JSON request that can be handled by the deleteSubscription operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"xDH2yacFLuo1yfjTYsoHA", "responseType":"json", "targetType":"user", "targetId":"1530177481" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-subscriptions
Retrieving the thread subscribed to
The
operation retrieves the thread that has been subscribed to.getSubThread
<yammer.getSubThread> <threadId>{$ctx:threadId}</threadId> </yammer.getSubThread>
Properties
The ID of a thread.threadId:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getSubThread
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "threadId":"1530177481" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-subscriptions
Retrieving the topic subscribed to
The
operation retrieves the topic that has been subscribed to.getSubTopic
<yammer.getSubTopic> <topicId>{$ctx:topicId}</topicId> </yammer.getSubTopic>
Properties
The ID of the topic.topicId:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getSubTopic
{ "apiUrl":"https://www.yammer.com", "apiToken":"bwGBT89WMbAwefDZHVaZA", "responseType":"json", "topicId":"6399334" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-subscriptions
Retrieving the user
The
operation retrieves the user.getSubUser
<yammer.getSubUser> <userId>{$ctx:userId}</userId> </yammer.getSubUser>
Properties
The ID of the user.userId:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getSubUser
{ "apiUrl":"https://www.yammer.com", "apiToken":"bwGBT89WMbAwefDZHVaZA", "responseType":"json", "userId":"1530172115" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-subscriptions
Sample configuration
Following is a sample proxy service that illustrates how to connect to Yammer with the init
operation and use the addSubscription operation. The sample request for this proxy can be found in the addSubscription 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="yammer_addSubscription" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiToken" expression="json-eval($.apiToken)"/> <property name="responseType" expression="json-eval($.responseType)"/> <property name="targetType" expression="json-eval($.targetType)"/> <property name="targetId" expression="json-eval($.targetId)"/> <yammer.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiToken>{$ctx:apiToken}</apiToken> <responseType>{$ctx:responseType}</responseType> </yammer.init> <yammer.addSubscription> <targetType>{$ctx:targetType}</targetType> <targetId>{$ctx:targetId}</targetId> </yammer.addSubscription> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>