File resource

Share file API - Share via microblog

OVERVIEW

Purpose

This API method is used to share a file or folder using a microblog. 

Request URL

POST    /shares/microblog

Sample request URL : https://domain.com/instance/api/1/shares/microblog

 

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
 
microblogmessage string Message to be sent in the microblog, The message can accept # and @ mention

 

            <share> 

                            <resourcetype>folder/file</resourcetype> {folder is required in case we want to share a folder already present in Collaborate}

                           <resourceid>folderid/fileid</resourceid>

                           <permissions> integer value for the two options (download / view)</permissions>

                          <sharegroup> List of sites to share with</sharegroup>

                          <microblogmessage>Message to the sent in the microblog</microblogmessage> {The microblog can accept # and @ mention}

                           <expiry>UTC date and time</expiry>

               <share>

Example Request XML:

<share>
   <resourcetype>file</resourcetype>
   <resourceid>425</resourceid>
   <permissions>1</permissions>
   <sharegroup>
      <internalorganisation>true</internalorganisation>
      <sites>
         <site>
            <id>3</id>
         </site>
      </sites>
   </sharegroup>
   <microblogmessage>Message to the sent in the microblog[~saviz.izadpanah@highq.com] to [#highq]</microblogmessage>
   <expiry>31 Dec 9999 00:00</expiry>
</share>

 

Response XML

Field Type Description
shareid int ID of the newly created share
microblogid int This is a reference to the microblog id in the activity stream. The user can use this id to make any changes to the microblog if needed. 

200 Ok in case of a success an alternate error response otherwise. In case of success the response body will hold the share details. 

In case of an error our standard error object will be returned with explanation of the error.  

<share>

                  <shareid>{id of the share}</shareid> {database id}

                 <microblogid>{ID of the newly created microblog}</microblogid> This is a reference to the microblog id in the activity stream. The user can use this id to make any changes to the microblog if needed. 

</share>
 

Example Response XML:

<share>
   <shareid>92</shareid>
   <microblogid>3491</microblogid>
</share>

Response Codes

Code Meaning
200 Share via microblog successfully
400

Problem with parsing XML or JSON object (Bad Request)

401 Unauthorized
403 Validation failed/ Forbidden
405 Method not allowed (calling api with wrong method)
500 Internal error occured

 

Comments


0 Comments

Last Updated: Jun 09,2023