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 Yammer
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 messages, see Sample configuration.
Operation | Description |
---|---|
Deletes a message. | |
getAlgorithmicFeed | Retrieves the algorithmic feed for the user. |
getFollowing | Retrieves the followings of the user. |
getMessages | Retrieves all messages. |
getMyFeed | Retrieves the current user's feed. |
getPrivateMessages | Retrieves private messages. |
getReceivedMessages | Retrieves received messages. |
getSentMessages | Retrieves sent messages. |
postLike | Likes a post. |
postNewMessage | Posts a new message. |
removeLike | Removes a like set to a post. |
sendMessageToEmail | Sends the message to the e-mail address. |
Operation details
This section provides further details on the operations related to messages.
Deleting a message
The deleteMessage operation deletes a message.
<yammer.deleteMessage> <messageId>{$ctx:messageId}</messageId> </yammer.deleteMessage>
Properties
The ID of the message.messageId:
Sample request
Following is a sample REST/JSON request that can be handled by the deleteMessage
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"CQ9uJaP0fPPoyaPg9lAcw", "responseType":"json", "messageId":"467053911" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving the algorithmic feed
The
operation retrieves the algorithmic feed for the user.getAlgorithmicFeed
<yammer.getAlgorithmicFeed> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getAlgorithmicFeed>
Properties
The message ID for which the resulting messages should be older than.olderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getAlgorithmicFeed
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"", "newerThan":"467703777", "threaded":"", "limit":"" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving the followings of the user
The
operation retrieves the followings of the user.getFollowing
<yammer.getFollowing> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getFollowing>
Properties
The message ID for which the resulting messages should be older than.OlderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getFollowing
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"6388797", "newerThan":"", "threaded":"", "limit":"" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving all messages
The
operation retrieves all messages.getMessages
<yammer.getMessages> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getMessages>
Properties
The message ID for which the resulting messages should be older than.OlderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getMessages
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"", "newerThan":"", "threaded":"true", "limit":"1" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving the user's feeds
The
operation retrieves the current user's feeds.getMyFeed
<yammer.getMyFeed> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getMyFeed>
Properties
The message ID for which the resulting messages should be older than.OlderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getMyFeed
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"", "newerThan":"", "threaded":"", "limit":"2" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving private messages
The
operation retrieves private messages.getPrivateMessages
<yammer.getPrivateMessages> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getPrivateMessages>
Properties
The message ID for which the resulting messages should be older than.OlderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getPrivateMessages
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"", "newerThan":"", "threaded":"", "limit":"" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving received messages
The
operation retrieves received messages.getReceivedMessages
<yammer.getReceivedMessages> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getReceivedMessages>
Properties
The message ID for which the resulting messages should be older than.OlderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getReceivedMessages
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"", "newerThan":"", "threaded":"", "limit":"" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Retrieving sent messages
The
operation retrieves sent messages.getSentMessages
<yammer.getSentMessages> <olderThan>{$ctx:olderThan}</olderThan> <newerThan>{$ctx:newerThan}</newerThan> <threaded>{$ctx:threaded}</threaded> <limit>{$ctx:limit}</limit> </yammer.getSentMessages>
Properties
The message ID for which the resulting messages should be older than.OlderThan:
The message ID for which the resulting messages should be newer than.newerThan:
The boolean flag to request only the first message in each thread.threaded:
The number of messages to be retrieved in the response.limit:
Sample request
Following is a sample REST/JSON request that can be handled by the getSentMessages
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"uewmZGcC18LOvwYfCRSbPA", "responseType":"json", "olderThan":"", "newerThan":"", "threaded":"", "limit":"" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Liking a post
The postLike operation sets a like to a post.
<yammer.postLike> <messageId>{$ctx:messageId}</messageId> </yammer.postLike>
Properties
The ID of the message.messageId:
Sample request
Following is a sample REST/JSON request that can be handled by the postLike
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"CQ9uJaP0fPPoyaPg9lAcw", "responseType":"json", "messageId":"467703777" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Posting a new message
The
operation posts a new message. This operation does not require init to be passed in.postNewMessage
<yammer.postNewMessage> <apiUrl>{$url:apiUrl}</apiUrl> <apiToken>{$url:apiToken}</apiToken> <responseType>{$url:responseType}</responseType> </yammer.postNewMessage>
Properties
The URL to access the Yammer API.apiUrl:
The API token of the account.apiToken:
The response type of the method call.responseType:
Sample request
Following is a sample request that can be handled by the postNewMessage
operation. The Content-Type is 'multipart/form-data'.
http://localhost:8280/services/yammer_postNewMessage?apiToken=CQ9uJaP0fPPoyaPg9lAcw&responseType=json&apiUrl=https://www.yammer.com
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Removing a like
The
operation removes a like already set to a post.removeLike
<yammer.removeLike> <messageId>{$ctx:messageId}</messageId> </yammer.removeLike>
Properties
The ID of the message.messageId:
Sample request
Following is a sample REST/JSON request that can be handled by the removeLike
operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"CQ9uJaP0fPPoyaPg9lAcw", "responseType":"json", "messageId":"467702501" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Sending the message to the e-mail address
The
operation sends the message to the e-mail address.sendMessageToEmail
<yammer.postLike> <messageId>{$ctx:messageId}</messageId> </yammer.postLike>
Properties
The ID of the message.messageId:
Sample request
Following is a sample REST/JSON request that can be handled by the sendMessagetoEmail operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"y8RKAv09VSVQYFrvDBozQ", "responseType":"json", "messageId":"467060053" }
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages
Sample configuration
Following is a sample proxy service that illustrates how to connect to Yammer with the init
operation and use the deleteMessage operation. The sample request for this proxy can be found in the deleteMessage 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_deleteMessage" 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="messageId" expression="json-eval($.messageId)"/> <yammer.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiToken>{$ctx:apiToken}</apiToken> <responseType>{$ctx:responseType}</responseType> </yammer.init> <yammer.deleteMessage> <messageId>{$ctx:messageId}</messageId> </yammer.deleteMessage> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>