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/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »



Overview

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

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

OperationDescription

attachFile

Attaches a file to an object.

getFileRetrieves the file details.
uploadFileUploads a file.

Operation details

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

Attaching a file to an object

The attachFile operation attaches the uploaded file to an object.

attachFile
<podio.attachFile>
    <isSilent>{$ctx:isSilent}</isSilent>
    <fileId>{$ctx:fileId}</fileId>
    <refId>{$ctx:refId}</refId>
	<refType>{$ctx:refType}</refType>
</podio.attachFile>
Properties
  • isSilent: If "true", the object will not be bumped up in the stream.
  • fileId: The ID of the file.
  • refId: The ID of the reference.
  • refType: The reference type of the file.
Sample request

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

Sample Request for attachFile
{
	"apiUrl":"https://api.podio.com",
	"accessToken":"8d416711e5974846b7f44425e37a348e",
	"fileId":"149738248",
	"refId":28900126,
	"refType":"task",
	"isSilent":"true"
}
Related Podio Documentation

https://developers.podio.com/doc/files/attach-file-22518

Retrieving the file details 

The getFile operation retrieves the file details. 

getFile
<podio.getFile>
	<fileId>{$ctx:fileId}</fileId>
</podio.getFile>
Properties
  • fileId: The ID of the file.
Sample request

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

Sample Request for getFile
{
	"apiUrl":"https://api.podio.com",
	"accessToken":"49806ca6128f47c59d4a8e29e84f5a6f",
	"fileId":"149592541"
}
Related Podio Documentation

https://developers.podio.com/doc/files/get-file-22451

Uploading a new file 

The uploadFile operation uploads a new file. 

uploadFile
<podio.uploadFile>
	<apiUrl>{$url:apiUrl}</apiUrl>
</podio.uploadFile>
Properties
  • apiUrl: The URL to access the Podio API.
Sample request

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

Sample Request for uploadFile
http://localhost:8280/services/podio_uploadFile?apiUrl=https://api.podio.com&user=user@gmail.com
Related Podio Documentation

https://developers.podio.com/doc/files/upload-file-1004361

Sample configuration

Following is a sample proxy service that illustrates how to connect to Podio with the init operation and use the attachFile operation. The sample request for this proxy can be found in the attachFile sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="podio_attachFile"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="accessToken" expression="json-eval($.accessToken)"/>
         <property name="fileId" expression="json-eval($.fileId)"/>
         <property name="refType" expression="json-eval($.refType)"/>
         <property name="refId" expression="json-eval($.refId)"/>
         <property name="isSilent" expression="json-eval($.isSilent)"/>
         <podio.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <accessToken>{$ctx:accessToken}</accessToken>
         </podio.init>
         <podio.attachFile>
            <isSilent>{$ctx:isSilent}</isSilent>
            <fileId>{$ctx:fileId}</fileId>
            <refId>{$ctx:refId}</refId>
            <refType>{$ctx:refType}</refType>
         </podio.attachFile>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>                                                                                                                                                 
  • No labels