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 Users in Yammer



Overview

The following operations allow you to work with users. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with users, see Sample configuration

OperationDescription

getAboutAUser

Retrieves data about a user.

getByEmailRetrieves users by e-mail address.
getByGroupRetrieves users by a group.
getCurrentUserRetrieves the current user.
getUsersRetrieves the users of the current user's network.

Operation details

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

Retrieving data about a user

The getAboutAUser operation retrieves data about a user.

getAboutAUser
<yammer.getAboutAUser>
	<userId>{$ctx:userId}</userId>
</yammer.getAboutAUser>
Properties
  • userId: The ID of a user.
Sample request

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

Sample Request for getAboutAUser
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"uewmZGcC18LOvwYfCRSbPA",
	"responseType":"json",
	"userId":"1530177481"
}
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-users

Retrieving users by e-mail address

The getByEmail operation retrieves users by e-mail address.

getByEmail
<yammer.getByEmail>
	<email>{$ctx:email}</email>
</yammer.getByEmail>
Properties
  • email: An e-mail address of a user.
Sample request

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

Sample Request for getByEmail
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"uewmZGcC18LOvwYfCRSbPA",
	"responseType":"json",
	"email":"amila@Chamath.onmicrosoft.com"
}
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-users

Retrieving users by a group

The getByGroup operation retrieves users by a group.

getByGroup
<yammer.getByGroup>
    <groupId>{$ctx:groupId}</groupId>
	<page>{$ctx:page}</page>
</yammer.getByGroup>
Properties
  • groupId: The ID of a group.
  • page: The page number.
Sample request

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

Sample Request for getByGroup
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"uewmZGcC18LOvwYfCRSbPA",
	"responseType":"json",
	"groupId":"4976430",
	"page":"1"
}
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-users

Retrieving the current user

The getCurrentUser operation retrieves the current user.

getCurrentUser
<yammer.getCurrentUser/>
Sample request

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

Sample Request for getCurrentUser
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"uewmZGcC18LOvwYfCRSbPA",
	"responseType":"json"
}
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-users

Retrieving the users of the current user's network

The getUsers operation retrieves the users of the current user's network.

getUsers
<yammer.getUsers>
	<page>{$ctx:page}</page>
    <letter>{$ctx:letter}</letter>
    <sortBy>{$ctx:sortBy}</sortBy>
    <reverse>{$ctx:reverse}</reverse>
</yammer.getUsers>
Properties
  • page: The page number.
  • letter: Returns users with usernames beginning with the given character.
  • sortBy: Returns the number of messages or followers sorted by.
  • reverse: If "true", returns results in reverse order.
Sample request

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

Sample Request for getUsers
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"uewmZGcC18LOvwYfCRSbPA",
	"responseType":"json",
	"page":"1",
	"letter":"",
	"sortBy":"",
	"reverse":"true"
}
Related Yammer documentation
https://developer.yammer.com/restapi/#rest-users

Sample configuration

Following is a sample proxy service that illustrates how to connect to Yammer with the init operation and use the getAboutAUser operation. The sample request for this proxy can be found in the getAboutAUser 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_getAboutAUser"
       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="userId" expression="json-eval($.userId)"/>
         <yammer.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiToken>{$ctx:apiToken}</apiToken>
            <responseType>{$ctx:responseType}</responseType>
         </yammer.init>
         <yammer.getAboutAUser>
            <userId>{$ctx:userId}</userId>
         </yammer.getAboutAUser>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>