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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »



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

OperationDescription

1Working with Messages in Yammer

Deletes a message.

1Working with Messages in YammerRetrieves the algorithmic feed for the user.
1Working with Messages in YammerRetrieves the followings of the user.
1Working with Messages in YammerRetrieves all messages.
1Working with Messages in YammerRetrieves the current user's feed.
1Working with Messages in YammerRetrieves private messages.
1Working with Messages in YammerRetrieves received messages.
1Working with Messages in YammerRetrieves sent messages.
1Working with Messages in YammerLikes a post.
1Working with Messages in YammerPosts a new message.
1Working with Messages in YammerRemoves a like set to a post.
1Working with Messages in YammerSends 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.

deleteMessage
<yammer.deleteMessage>
	<messageId>{$ctx:messageId}</messageId>
</yammer.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://www.yammer.com",
	"apiToken":"CQ9uJaP0fPPoyaPg9lAcw",
	"responseType":"json",
	"messageId":"467053911"
}
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-messages

Retrieving the algorithmic feed 

The getAlgorithmicFeed 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
  • olderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getAlgorithmicFeed
{
	"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 getFollowing 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
  • OlderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getFollowing
{
	"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 getMessages 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
  • OlderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getMessages
{
	"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 getMyFeed 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
  • OlderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getMyFeed
{
	"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 getPrivateMessages 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
  • OlderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getPrivateMessages
{
	"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 getReceivedMessages 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
  • OlderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getReceivedMessages
{
	"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 getSentMessages 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
  • OlderThan: The message ID for which the resulting messages should be older than.
  • newerThan: The message ID for which the resulting messages should be newer than.
  • threaded: The boolean flag to request only the first message in each thread.
  • limit: The number of messages to be retrieved in the response.
Sample request

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

Sample Request for getSentMessages
{
	"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.

postLike
<yammer.postLike>
	<messageId>{$ctx:messageId}</messageId>
</yammer.postLike>
Properties
  • messageId: The ID of the message.
Sample request

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

Sample Request for postLike
{
	"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 postNewMessage 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
  • apiUrl: The URL to access the Yammer API. 
  • apiToken: The API token of the account.
  • responseType: The response type of the method call.
Sample request

Following is a sample request that can be handled by the postNewMessage operation. The Content-Type is 'multipart/form-data'.

Sample Request for postNewMessage
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 removeLike operation removes a like already set to a post.

removeLike
<yammer.removeLike>
	<messageId>{$ctx:messageId}</messageId>
</yammer.removeLike>
Properties
  • messageId: The ID of the message.
Sample request

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

Sample Request for removeLike
{
	"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 sendMessageToEmail operation sends the message to the e-mail address.

sendMessageToEmail
<yammer.postLike>
	<messageId>{$ctx:messageId}</messageId>
</yammer.postLike>
Properties
  • messageId: The ID of the message.
Sample request

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

Sample Request for sendMessagetoEmail
{
	"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.

Sample Proxy
<?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>                                                                                         
  • No labels