File resource

Share file API - Share via link - Share via link v1

OVERVIEW

Applies to API version 5 and below published in Collaborate 5.0 and below

Purpose


This api method is used to share content (file or folder) from "my files" or "shared items"

Request URL

POST  /shares/link

 

Request Body

Parameter Type Description
resourcetype String The type of the resource which is to be shared. This is a text field with two possible entries "folder" or "file"
resourceid int The Id of the resource to share. The resource ID can be obtained by using the file or folder information methods
permissions  int

There are two possible options 

1 = Download, view or print

2 =  View only

shareoption int

There are three possible options which governs who can use this share

1 = anyone

2 = my organisation user

3 = system users

expiry date This is the UTC date and time when this share will expire

             

<share> 
                            <resourcetype>folder/file</resourcetype> {folder/file}

                           <resourceid>integer content id</resourceid> (the id can be any from my files or shared items)

                           <permissions> integer value for the two options </permissions> {1(download_view_print) / 2(view_only)}

                          <shareoption> integer value for the options </shareoption {1(anyone) / 2(my organisation user) 3(system users)}

                          <expiry>UTC date and time(dd MMM yyyy HH:mm)</expiry>

  <share>

All fields in the request body are mandatory.

Sample request xml :
               <share> 
                            <resourcetype>file</resourcetype>
                           <resourceid>53</resourceid>
                           <permissions>1</permissions>
                          <shareoption>1</shareoption>
                          <expiry>09 Dec 2014 13:54</expiry>
                </share>

Response XML

Field Type Description
shareid int ID of the newly created share
resourcename String The name of the item that has been shared
link string The link to the shared resource, this can be used in an email or any other way of distributing the share with the required personal. 
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <share>
        <shareid>85</shareid>
        <resourcename>Quick16.png</resourcename>
        <link>https://ankitjava.local.com/ankit_3_4_1/viewSharedContent.action?linkParam=nkZuZK5FIto=</link>
  </share>

Response Codes

Code Meaning
200 Response successfully
401 Unauthorized
403 Validation failed/ Forbidden
405 Method not allowed (calling api with wrong method)
500 Internal error occured while uploading document
 

Comments


0 Comments

Last Updated: Nov 08,2024