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

The getSearch operation searches using a search query.

getSearch
<yammer.getSearch>
    <search>{$ctx:search}</search>
    <page>{$ctx:page}</page>
	<numPerPage>{$ctx:numPerPage}</numPerPage>
</yammer.getSearch>
Properties
  • search: The search query.
  • page: The page number to return.
  • numPerPage: The number of results per page.
Sample request

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

Sample Request for getSearch
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"bxmUDADfr3F2ee1rE2Awkw",
	"responseType":"json",
	"search":"name",
	"numPerPage":"2",
	"page":"1"
}
Related Yammer documentation

Sample configuration

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