It is currently Tue May 21, 2013 4:14 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Tonido HTTP API Documentation
PostPosted: Tue Jan 18, 2011 11:37 am 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

There is very little documentation on useful HTTP API calls; so, I have decided to start documenting some of it here to save some people some time.

Not all Tonido API calls are useful to the average developer, and since PHP is also available, sometimes it is not advantageousness to call the Tonido API for what can easily be done in PHP.

Some documentation is already available via the Tonido Developers site. I only plan on documenting what isn't already covered elsewhere, and only what I personally have felt it worthwhile to look into. Other people can feel free to add what they discover as well.

General:
The API usually returns an xml structure containing return data. This layout may vary from command to command, but this is generally what I have found.
Code:
<commands>
   <command>
       <type>Name of command</type>
       <result>usually 1 or 0</result>
       <message>Some additional return data</message>
   </command>
</commands>


Download File:
Code:
http://host/downloadfile?filepath=directory_path/file_name&filename=file_name


  • Inputs:
    • filepath: path (including file name) to target file to download
    • filename: target file to download
  • Outputs:
    • type: downloadfile
    • result: 1 for success and 0 for fail (this doesn't really need to be checked because the file will download and you will see it, or it won't)

Upload File:
Code:
http://host/upload?appname=explorer&path=/directory_path&expandzip=numerical_value


  • Inputs:
    • path: Path to upload to
    • expandzip: is for expanding uploaded zip files: 1 = expand, 0 = no expand
  • Outputs:
    • Success or failure message

Zip Files in a Folder:
Code:
http://host/core/startzip?path=directory_path&time=epoch_time
http://host/core/zipstatus?id=zip_id&time=epoch_time


***Note: files will be zipped with the following name Tonido_Zip_<zip job id>.zip***

  • Inputs (startzip):
    • path: Path to folder containing contents to zip
    • time: epoch time in seconds
  • Outputs (startzip):
    • type: startzip
    • result: 1 for success and 0 for fail
    • message: id for zip job

  • Inputs (zipstatus):
    • id: id for zip job returned by startzip
    • time: epoch time in seconds
  • Outputs (zipstatus):
    • type: zipstatus
    • result: 1 for finished and 0 for still zipping
    • message: current files that were zipped (files are separated with the following delimiter: nline_)

Download Folder:
Code:
http://host/core/startzip?path=directory_path&time=epoch_time
http://host/core/zipstatus?id=zip_id&time=epoch_time
http://host/core/downloadaszip?id=zip_id


***Note: See Zipping Files in Folder to view inputs and outputs for startzip and zipstatus***

  • Inputs (downloadaszip):
    • id: zip job id returned from startzip
  • Outputs (startzip):
    • Todo: (doesn't really need to be checked. Download will start or it won't)

Get Thumbnails:
To Do

***More to come***

_________________
My Tonido Plugins:


Last edited by facelessuser on Tue Jan 18, 2011 12:26 pm, edited 4 times in total.

Offline
 Profile  
 Post subject: Re: Tonido HTTP API Documentation
PostPosted: Tue Jan 18, 2011 12:03 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7303
Location: Dallas, USA

Good start. Also a lot of our XML from the API follows some rules like this.
Code:
<records>
    <metarecord>
   // contains some meta information about result set
   </metarecord>

   <record>
   // data
   </record>

  <record>
  // data
  </record>

</records>


Offline
 Profile  
 Post subject: Re: Tonido HTTP API Documentation
PostPosted: Tue Jan 18, 2011 12:27 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Thanks madhan. I will update the opening post with the info you provided.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Tonido HTTP API Documentation
PostPosted: Wed Mar 16, 2011 1:52 am 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Moved info to tonidousers.com developers section

_________________
My Tonido Plugins:


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: