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 Pending Attachments in Yammer



Overview

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

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

OperationDescription

createPendingAttachment

Creates a pending attachment.

deletePendingAttachmentDeletes a pending attachment.

Operation details

This section provides further details on the operations related to pending attachments.

Creating a pending attachment

The createPendingAttachment operation creates a pending attachment. This does not require init to be passed in. 

createPendingAttachment
<yammer.createPendingAttachment>
	<apiUrl>{$url:apiUrl}</apiUrl>
    <responseType>{$url:responseType}</responseType>
	<apiToken>{$url:apiToken}</apiToken>
</yammer.createPendingAttachment>
Properties
  • apiUrl: The URL to access the Yammer API.
  • responseType: The response type of the method call.
  • apiToken: The API token of the account.
Sample request

Following is a sample request that can be handled by the createPendingAttachment operation. The Content-Type is, 'multipart/form-data' and form-date; name: attachment and type: file.

Sample Request for createPendingAttachment
http://localhost:8280/services/yammer_createPendingAttachment?apiToken=pw3U7vPLe3oK0Cyj9wgKeg&responseType=json&apiUrl=https://www.yammer.com

Deleting a pending attachment

The deletePendingAttachment operation deletes a pending attachment. 

deletePendingAttachment
<yammer.deletePendingAttachment>
	<attachmentId>{$ctx:attachmentId}</attachmentId>
</yammer.deletePendingAttachment>
Properties
  • attachmentId: The ID of the attachment to be deleted.
Sample request

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

Sample Request for deletePendingAttachment
{
	"apiUrl":"https://www.yammer.com",
	"apiToken":"pw3U7vPLe3oK0Cyj9wgKeg",
	"responseType":"json",
	"attachmentId":"6399334"
}

Sample configuration

Following is a sample proxy service that illustrates how to connect to Yammer with the init operation and use the createPendingAttachment operation. The sample request for this proxy can be found in the createPendingAttachment 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_createPendingAttachment"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <yammer.createPendingAttachment>
			<apiUrl>{$url:apiUrl}</apiUrl>
            <responseType>{$url:responseType}</responseType>
			<apiToken>{$url:apiToken}</apiToken>
		 </yammer.createPendingAttachment>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>