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 Relationships in Yammer
Overview
The following operations allow you to work with relationships. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with relationships, see Sample configuration.
Operation | Description |
---|---|
Creates a new relationship. | |
deleteRelationship | Deletes an existing relationship. |
getRelationship | Retrieves the relationships. |
Operation details
This section provides further details on the operations related to relationships.
Creating a relationship
The addRelationship operation creates a relationship.
<yammer.addRelationship> <type>{$ctx:type}</type> <email>{$ctx:email}</email> <userId>{$ctx:userId}</userId> </yammer.addRelationship>
Properties
The type of the relationship: "subordinate", "superior", or "colleague".type:
The e-mail address of the user.email:
The ID of the user other than the logged-in user.userId:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.addRelationship
{ "apiUrl":"https://www.yammer.com", "apiToken":"xDH2yacFLuo1yfjTYsoHA", "responseType":"json", "type":"subordinate", "email":"anuradhika@chamath.onmicrosoft.com", "userId":"1530177481" }
Deleting an existing relationship
The deleteRelationship operation deletes an existing relationship.
<yammer.deleteRelationship> <userId>{$ctx:userId}</userId> <type>{$ctx:type}</type> </yammer.deleteRelationship>
Properties
The ID of the user.userId:
The type of the relationship: "subordinate", "superior", or "colleague".type:
Sample request
Following is a sample REST/JSON request that can be handled by the deleteRelationship operation.
{ "apiUrl":"https://www.yammer.com", "apiToken":"xDH2yacFLuo1yfjTYsoHA", "responseType":"json", "userId":"1530177481", "type":"superior" }
Retrieving the relationships
The
operation retrieves the relationships. getRelationship
<yammer.getRelationship> <userId>{$ctx:userId}</userId> </yammer.getRelationship>
Properties
The ID of the user.userId:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getRelationship
{ "apiUrl":"https://www.yammer.com", "apiToken":"xDH2yacFLuo1yfjTYsoHA", "responseType":"json", "userId":"1530177481" }
Sample configuration
Following is a sample proxy service that illustrates how to connect to Yammer with the init
operation and use the addRelationship operation. The sample request for this proxy can be found in the addRelationship 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_addRelationship" 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="type" expression="json-eval($.type)"/> <property name="email" expression="json-eval($.email)"/> <property name="userId" expression="json-eval($.userId)"/> <yammer.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiToken>{$ctx:apiToken}</apiToken> <responseType>{$ctx:responseType}</responseType> </yammer.init> <yammer.addRelationship> <type>{$ctx:type}</type> <email>{$ctx:email}</email> <userId>{$ctx:userId}</userId> </yammer.addRelationship> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>