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.
Operation | Description |
---|---|
Retrieves data about a user. | |
getByEmail | Retrieves users by e-mail address. |
getByGroup | Retrieves users by a group. |
getCurrentUser | Retrieves the current user. |
getUsers | Retrieves 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.
<yammer.getAboutAUser> <userId>{$ctx:userId}</userId> </yammer.getAboutAUser>
Properties
The ID of a user.userId:
Sample request
Following is a sample REST/JSON request that can be handled by the getAboutAUser
operation.
{ "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.
<yammer.getByEmail> <email>{$ctx:email}</email> </yammer.getByEmail>
Properties
An e-mail address of a user.email:
Sample request
Following is a sample REST/JSON request that can be handled by the getByEmail operation.
{ "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
operation retrieves users by a group.getByGroup
<yammer.getByGroup> <groupId>{$ctx:groupId}</groupId> <page>{$ctx:page}</page> </yammer.getByGroup>
Properties
The ID of a group.groupId:
The page number.page:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.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
operation retrieves the current user.getCurrentUser
<yammer.getCurrentUser/>
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.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
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
The page number.page:
Returns users with usernames beginning with the given character.letter:
Returns the number of messages or followers sorted by.sortBy:
If "true", returns results in reverse order.reverse:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.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.
<?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>