Content
- Introduction
- The MySites-API
- JSON (The Response)
- Responses
- The MySites-Requests
- GET and POST
- Other Requests
- Registration
- Login /Authentication
- The Permission System
- Upload
- Embed-Players
- Registration
- Login
- Reading Data
- Adding Files
- Adding Folders
- Editing Files
- Moving Files
- Deleting Files
MySites API
We at MySites want YOU to create new exiting apps and services to make MySites better and better. We try to make it really easy for you, so the next few pages give you an overview on how to work with the MySites-API. Ready to use MySites? Ok, so here we go:
The MySites Storage Engine
MySites.com provides a very flexible storage-engine, which you can use to store and share your files with your friends.
If you dont know much about key-value stores, storage clusters, clouds, and the like, thats no problem! To use all this, you just need to be able to use a simple HTTP-Client (Your browser is one, for example). If you already have some knowledge about RESTful APIs and HTTP-Requests, this article might not be as interesting for you. You should then skip directly to the API-Browser, which you can find here:
http://www.mysites.com/help?html=1
MySites offers you a URL-based method, to work with MySites-data.
MySites provides a RESTful(ish) API for all major actions. All API-Methods are POST or GET requests, and provide a JSON response.
General Request:
http://www.mysites.com/main@core/apimethod
http://www.mysites.com/upload?album_name=fancy-album
Most of the time you will be uploading and sharing files through MySites. (see example URL)
We created a simplified upload-method, we going to describe a bit later. The MySites-API is very extensive. We will cover more features in future articles. At this time we just explain how to use the MySites Storage-Engine, to easily add your files and share them with your friends.
If you are interested in all API-Methods, have a look at the API browser here:
http://www.mysites.com/help?html=1
No, thats not another horror-movie. Thats a notation-standard MySites uses for data-exchange. So all responses you get by the MySites-Server are (almost) JSON-Objects. All you need to do, is to parse the JSON-Object and you have all information ready you need.
If you are a developer, you surely know some JSON-parsers for your preferred language or have a look at:
Well, enough theory... let's have a look at the requests and responses.
After you have sent your request, our servers will respond and send the requested data. We have two types of responses:
a) error
error={...}
Oops, something went wrong.. why? Check the provided message!
error={"message":"No such user mXike","details":"","error_type": "UnknownUser"}
b) success
success={...}
Yay! The server understood what you meant, found entries and sent them back to you. The {...} is a JSON notated Object containing your results. We explain that later to you.
So far so good. But "Now What?" you think. Let me show you. Here you can see some example requests, we explain them in detail a bit later.
http://www.mysites.com/model
http://www.mysites.com/upload?album_name=my-album
http://www.mysites.com/recent_json
What you need to know:
- http://www.mysites.com is the base URL of all requests. (www.mysit.es also works, but is not recommended)
- if the requesting client is logged in, the users private and public files will get returned. If the session is not authenticated, only public items are retrieved. More on MySites-Permissions can be found later.
Services:
here we keep it very simple for now. Even though MySites offers many virtual services (lists), the currently used service is "main@core".
All files are stored as main items and are available on mysites.com or username.mysites.com.
We will explain more about generic MySites services in future articles.
Actions:
for you the most important actions are these:
model -> lists available files per user
upload -> uploads binary files to an MySites-Album
edit_item -> edits an exisiting item
move_to_trash -> deletes an existing item.
Notice: MySites offers a two-step deletion system. Deleted items get moved to trash first and can be recovered from the trash afterwards. If the trash is cleaned, all items get deleted for good.
MySites RESTful(ish) API-Requests can be sent to the server as POST or GET requests. For example, to upload a file, you POST the file contents, along with some meta-information to
http://www.mysites.com/upload
Additional parameters can be:
- permission (see later)
Permission of the file. You can select the file to be private or publically available. By default the permission will be set as "onlyme" and can be edited afterwards with the edit_item action.
- album_name (see later)
Every MySites file is located in an album_name (a virtual path of the file). Album names are optional, however, if you do not specify an album name, MySites will generate a week-based Album-name for you. (For guest-Upload, random album-names get generated)
- description
A Description for a mysites file is optional.
- name
The only mandatory parameter for most API resquests ist the NAME of an item.
http://www.mysites.com/move_to_trash?name=someItemName
- path
Upon editing an item, you have to specify its path/album_name.
-other metadata /key/value pairs you wish to add to your stored files.
Sample Requests:
a) http://core.mysites.com/model
b) http://www.mysites.com/model?username_override=core
c) http://core.mysites.com/model?path=/2009-week-31
Explanation of the different requests:
Attention:
The preferred Request-Method is always using http://www.mysites.com as the Base-URL, and appending the target-username with username_override=, However, using the subdomain method will give you the same results.
Okey! Asked the server? Got a response? Great! Let's have a look at the response-object.
success={"path":"\/2009-week-31","read_username":"core","params_action":"model",
"params_login_error":null,"preferences":{},"service_name":"main@core",
"read_user_id":8,"path_folder_type":"folder","can_write":true,
"server_name":"core.mysites.com","read_user_model_data":{"city":"Darmstadt",
"userpicture":"","user_age_day":"25","boxcolor":"EDEDED","fullname":"hard core",
"country":"Germany","website":"http://www.mysites.com","e":"1","user_age_month":"4",
"backgroundimage":" ","birth_day":"1","user_age_year":"2008",
"status_message":"the mysites core",
"userimage":"http://core.mysites.com/get_file/2009-week-31/fire-2.png",
"username":"core","id":8,"group":false},
"default_item_name":"main","folder_item":{"generic_folder":false,"name":"2009-week-31",
"display_type":"Folder","thumbnail_image_url":"\/images\/folder.gif",
"modified_at":1249474758954,"tags":"","permission":"everyone","type":"folder",
"id":214449,"added_at":1249474758908,"cat_id":993,"rating":0,"nr_votes":0,
"pretty_name":"2009-week-31","comment_count":0,"account_id":8,"voted":false}
,"users":{"8":{"city":"Darmstadt","userpicture":"","user_age_day":"25",
"boxcolor":"EDEDED","fullname":"hard core","country":"Germany",
"website":"http://www.mysites.com","e":"1","user_age_month":"4",
"backgroundimage":" ","birth_day":"1","user_age_year":"2008",
"status_message":"the mysites core",
"userimage":"http://core.mysites.com/get_file/2009-week-31/fire-2.png",
"username":"core","id":8,"group":false},
"8":{"city":"Darmstadt","userpicture":"","user_age_day":"25","boxcolor":"EDEDED",
"fullname":"hard core","country":"Germany","website":"http://www.mysites.com","e":"1",
"user_age_month":"4","backgroundimage":" ","birth_day":"1","user_age_year":"2008",
"status_message":"the mysites core",
"userimage":"http://core.mysites.com/get_file/2009-week-31/fire-2.png",
"username":"core","id":8,"group":false}},"category":993,
"items":[
{"display_item_url":"http://core.mysites.com/get_display_file\/2009-week-31\/fire-2.png",
"content_type":"image\/png","name":"fire.png","display_type":"Main",
"display_size":"9.85kb",
"thumbnail_image_url":"http://core.mysites.com/get_thumbnail?path=\/2009-week-31\/fire-2.png",
"modified_at":1250508335269,"tags":"","type":"main","cancel":"Cancel",
"permission":"everyone","id":216286,"description":"",
"added_at":1250288279961,"height":"144","cat_id":993,
"full_item_url":"http://core.mysites.com/get_file\/2009-week-31\/fire-2.png",
"upload_name":"fire.png","width":"144","rating":0,"nr_votes":0,"pretty_name":"fire-2.png",
"comment_count":0,"account_id":8,"voted":false}
[....]
What The Hell ..., you think! Looks complicated, but actually it's really easy. This bunch of JSON represents the data you have requested
This Response-Object consists of two important parts
1) user data (Array)
this array contains information about the owner of the items you have requested. If the requested items are by more than one user, all related usermodels can be found in this array. To retrieve the username of an owner of a specific item, you need to check this user-array for the appropriate account_id
2) item data (Array)
This array contains all neccessary informations of the items you have requested. Currently the size of a model is not limited.
The items-array holds all items that have been found by the server. An item is an object, holding many key:value pairs with item-related data. Some interesting fields are:
name: The actual name of the item. Either automatically generated or user-selected.
display_type: The mime-type of the uploaded file. Based on the mime-type, we generate audio or video files for movies and audio-Tracks, to be able to embed them on webpages.
full_item_url: This is the originally uploaded file, stored on the MySites-Cluster. If you want to share the original file, this is the URL to share.
thumbnail_image_url: If it is possible to generate a Thumbnail for a video or image, we do it! we save the resulting image in this field, so it can be used by the clients easily.
flv_url: if you added an audio or videotrack and it has been accepted, the track will get transcoded to FLV format. This format is suitable for embedded playback and can be used in FLV-Players of your choice. Remember however, you might not be able to pseudo-stream the tracks, if you do not use players that support this.
recent_json (deprecated)
top_rated_json (deprecated)
To Register a MySites-Account, you have to send the Registration-Data (Username, password, full_name) to the registration controller.
http://www.mysites.com/register
Upon successful registration, the server responds with HTML and you have an authenticated, logged in session. If the registration was not successful, you will find more information about what happened, in the server-response.
Currently MySites only provides http-based authentication. You POST username and password to the authentication controller. Upon successful authentication, the server sends a cookie and you are logged in.
http://www.mysites.com/login
Remember persisting the cookie in your implementations. If the login was not successful, a JSON-Error-Response will be delivered. See Error-Responses for details.
MySites offers a simple permission system for your content. Files can be either private or public - simple as that.
Private files are only available for authenticated clients. Public files are publically available. However, you can share the links* to your private files with anyone.
http://www.mysites.com/upload?permission=onlyme
http://www.mysites.com/upload?permission=everyone
Default permission is always "onlyme" (private).
MySites-files get uploaded to this url. having a authenticated session, files
get stored per user. if no valid session is found, files are stored
anonymously and random paths get generated. if an album_name is given,
data fill be stored in the album, otherwise a week-based new name will
be generated for an album and the item stored there.
After a successfull upload (POST multipart-form-data) you will get redirection to the correct folder. Rember, this response is not JSON, but a normal HTML-Response, you need to parse.
need a Video or Audioplayer? just use ours:
<object width='540' height='405' data='http://core.myfil.es/get_file/social/flowplayer-3-1-2.swf' type='application/x-shockwave-flash'>
<param name='movie' value='http://core.myfil.es/get_file/social/flowplayer-3-1-2.swf />
<param name='allowfullscreen' value='true' /><param name='allowscriptaccess' value='always' />
<param name='flashvars' value='config={"clip":{"provider":"pseudo",
"url":"*************",
"autoPlay":true,"autoBuffering":true},"plugins":{"pseudo":{"url":"http://core.myfil.es/get_file/social/flowplayer-pseudostreaming-3-1.swf"},"controls":{"url":"http://core.myfil.es/get_file/social/flowplayer-controls-3-1-2.swf","playlist":false,"fullscreen":true}},
"playlist":[{"provider":"pseudo",
url":"*************",
"autoPlay":true,"autoBuffering":true}]}' />
</object>
This is a simple html-embed-code.
You can use this html to display our players. just remember to replace the "*************" with the actual flv_url of the movie or audio-track. The flv_url attribute has been explained before. If you dont remember, just skip a bit back and read about MySites-Responses.
- Registration
- Login
- Reading Data
- Adding Files
- Adding Folders
- Editing Files
- Moving Files
- Deleting Files
MySites API Step-by-Step runthrough.
We going to register a mysites user, show how to login and how to add, edit and delete files, befor we close the session.
api: create_account
url: http://www.mysites.com/create_account
apibrowser: http://www.mysites.com/create_account?html=1
method: POST or GET
mandatory fields: "username", "full_name", "password", "password_confirmation", "email"
optional fields: from_site, any k:v
Respones:
Errors:
error={"message": ...
Error-Messages
InsufficientParameters
UsernameTooShort
UsernameAlreadyTaken
InvalidUsername
InvalidEmailAddress
EmailAddressAlreadyUsed
PasswordsDontMatch
PasswordTooShort
FullNameTooShort
Success:
success={"username":"xxx"}
Currently MySites does _NOT_ provide an api-based authentication method.
User-credentials have to be POSTed to the login controller.
Also the result in this case is not a JSON response, but a more complex HTML-response.
Upon successful login, a valid session is provided and a cookie saved on the client.
Client implementations need to persist the cookie, or read it, to append proper authenticity tokens to subsequent requests.
api: login (not a real API method)
url: http://www.mysites.com/login
method: POST or GET
mandatory fields: username, password
Responses:
Error:
HTTP/1.x 302 Moved Temporarily
Referer:
http://www.mysites.com/index?login_error=Something%20went%20wrong.%20%20Please%20try%20again%20later.&s=&desired_url=http%3A%2F%2Fwww.mysites.com%2F
upon Login-Error no valid session is exisiting. the referrer-header are showing an login error. Its best to check here the headers and not parse the html document. Of course a a full api-based authentication system will follow.
Success:
HTTP/1.x 302 Moved Temporarily
Set-Cookie: mysites=858101508ac6639b90d2f2253f9fdefe; domain=.mysites.com; path=/; expires=Sat, 19-Sep-2009 11:43:24 GMT
Set-Cookie: been_here=1; domain=.mysites.com; path=/; expires=Wed, 11-May-2011 11:43:24 GMT
simple "workaround": after login, try to make a request for data (model, explained later)
the response-model will hold information about the requesting user. if authenticated, the correct userdata will be shown, otherwise the anonymous guest-user-data will be delivered.
Mysites provides one main method to use per-user files.
api: model
url: http://www.mysites.com/model
apibrowser: http://www.mysites.com/model?html=1
method: GET
mandatory fields: none
optional fields: path, username_override
example-urls:
http://www.mysites.com/model?username_override=core
-> gets cores recent items as JSON object.
[same as: http://core.mysites.com/model]
http://www.mysites.com/model?username_override=core?path=some-album-name
-> gets cores items on specified path/album name
[same as: http://core.mysites.com/model?path=some-album-name]
Notice: MySites internally uses the term path as item-location within the system. An alias is also "album name" (album_name) which will be explained a bit later and
is related to UPLOADING files to mysites.
Suggestions:
Based on your application design, it might be easier to work with only one baseurl:
www.mysites.com.
Per-user Requests then cannot be done through the subdomain, but can be appended to every model-request as
username_override=username
more parameters:
path: Request contents of a specified path, by specified users. A path is the equivalent to „album_name“ for the Upload-conveinience method.
Respones:
Errors:
error={"message":"No such path: [guest] \/guest::\/main@core::\/32452","help":"model [public] (aliases: ls, dir) [no parameters]: Contents of folder\n","details":"","error_type":"NoSuchPathError"}
error={"message":"No such user 241","help":"model [public] (aliases: ls, dir) [no parameters]: Contents of folder\n","details":"","error_type":"UnknownUser"}
Success: (JSONobject holding the data)
success={"path":"\/","read_username":"mike","params_action":"model","params_login_error":null,"preferences":{},
"service_name":"main@core","read_user_id":20,"path_folder_type":"folder","can_write":false,"server_name":"www.mysites.com",
"read_user_model_data":{"city":"","user_age_day":"--","tags":"","country":"","user_age_month":"--","e":"1","user_age_year":"--",
"status_message":"Mike ROCKS!","userimage":"http://coders.myprofil.es/get_file?path=/avatar.png","username":"mike","id":20,
"group":false} ,"default_item_name":"main","folder_item":{"name":"","generic_folder":false,"display_type":"Folder",
"thumbnail_image_url":"\/images\/folder.gif","modified_at":1207073669666,"permission":"everyone","type":"folder",
"id":1250,"added_at":1208602492409,"cat_id":993,"rating":0,"nr_votes":0,"pretty_name":"993::","comment_count":0,
"account_id":20,"voted":false} ,"users":{"5":{"city":"iou","user_age_day":"15","tags":"","country":"jkj","e":"1",
"user_age_month":"7","user_age_year":"1962","username":"guest","id":5,"group":false} ,"20":{"city":"",
"user_age_day":"--","tags":"","country":"","user_age_month":"--","e":"1","user_age_year":"--","status_message":"Mike ROCKS!",
"userimage":"http://coders.myprofil.es/get_file?path=/avatar.png","username":"mike","id":20,"group":false} },"category":993,
"items":[{"name":"homepage","generic_folder":true,"display_type":"Page","thumbnail_image_url":"\/images\/folder_generic.gif",
"modified_at":1217445179936,"tags":"","type":"page","permission":"everyone","id":41350,"added_at":1217445179928,"cat_id":993,
"rating":0,"nr_votes":0,"pretty_name":"homepage","comment_count":0,"account_id":20,"voted":false} ]}
The JSON-notated Object holds all relevant information about the item-owner, and the item-data itself.
remember: all api methods have also aliases, that might better suit your naming conventions. Check the api-browser for a list of methods
http://www.mysites.com/help?html=1
api: create_item
url: http://www.mysites.com/create_item
apibrowser: http://www.mysites.com/create_item?html=1
method: POST
mandatory fields: name, type, permission
optional fields: path, username_override, Filedata, any k:v
default values: name:filename, permission:onlyme
Filedata can be multipart-form-data file-field. This name is chosen, to allow also flashbased uploads for older flashplayers ans Actionscript versions.
Besides that „normal“ HTTP multipart data can be uploaded.
permissions:
everyone (public), items will be publically available
onlyme (private), items will be available only for item-owner, however the URL can be shared and is accessible
NOTICE:
all items created directly through the API method, are categorized as „main@core“ type. Otherwise other meta-data information will be written, and the items will not be available for the MySites browser version.
MySites currently uses only one generic item-type: main. This is currently used, to centralize all content for the MySites homepage. However, MySites is a key-value store and can save any generic item-type on any generic „virtual“ service. More on services can be covered in a future document, since this feature is currently not supported for third party applications.
NOTICE:
guest uploads need to be done to an existing album. Make sure you create unique albumnames. We suggest using a „namespace“ and a random id, eg:
mysites_dwepaswerhoasd
Respones:
Errors:
error={"message":"You cannot have more than 100 items in a folder: [guest] \/guest::\/main@core::\/!","help":"create_item <name> <permission> <tags> <file> <[generic_field ...]> : Create an item\n <name>: name of the item\n <permission>: (default: onlyme) onlyme|allbuddies|allbuddieswrite|allbuddiessticky|everyone|everyonewrite|everyonesticky\n <tags>: A list of tags, separated by space\n <file>: \n <[generic_field ...]>: A generic field can be a field with any name (except reserved fields) and value\n","details":"","error_type":"MaxItemsReached"}
Here the item has not been uploaded to a random foldername, but to the mysites root.
The Mysites-root directory cannot hold more than 100 items, and is currently used for internal items.
So always make sure to append a path to the create_item method and create a folder first! (see next topic)
http://www.mysites.com/create_item?html=1&path=jbtvthvi
Success:
success={"item_info":{"display_item_url":"http://guest.mysites.com/get_display_file\/jbtvthvi\/001-40.png", "name":"001_40.png","content_type":"image\/png","display_type":"Main","thumbnail_image_url": "http://guest.mysites.com/get_thumbnail?path=\/jbtvthvi\/001-40.png","modified_at":1253444928555, "tags":"asdasd","type":"main","permission":"onlyme","id":228246,"added_at":1253444928425,"cat_id":993, "full_item_url":"http://guest.mysites.com/get_file\/jbtvthvi\/001-40.png","upload_name":"001_40.png", "new_name":"some item","rating":0,"nr_votes":0,"pretty_name":"001-40.png","comment_count":0, "account_id":5,"voted":false} }
api: create_folder
url: http://www.mysites.com/create_item
apibrowser: http://www.mysites.com/create_item?html=1
method: POST or GET
mandatory fields: name
optional fields: permission, path
default values: path:/, permission:onlyme
Respones:
Errors:
error={"message":"Missing mandatory parameter: name","help":"create_folder (aliases: mkdir) <name> <permission> : Create Folder\n <name>: name of the item\n <permission>: (default: onlyme) onlyme|allbuddies|allbuddieswrite|allbuddiessticky|everyone|everyonewrite|everyonesticky\n","details":"","error_type":"InsufficientParameters"}
Success:
success={"item_info":{"generic_folder":false,"name":"testfolderabcmike","display_type":"Folder", "thumbnail_image_url":"\/images\/folder.gif","modified_at":1253445053485,"tags":"","permission":"everyone", "type":"folder","id":228247,"added_at":1253445053464,"cat_id":993,"rating":0,"nr_votes":0, "pretty_name":"testfolderabcmike","comment_count":0,"account_id":5,"voted":false} }
NOTICE:
currently some input-fields in the api-browser have wrong names. You can fix those problems with firebug, and do the proper requests, until we fix them on our end
Adding files, conveinience method
Besides the API method, there is also a conveinience method for uploading files to mysites. This method automatically takes care of given album_names (alias for path) and generates random foldernames for anonymous uploads. Also this method automatically creates week-based foldernames, if no album_name is given.
conveinience method: upload
url: http://www.mysites.com/upload
apibrowser: http://www.mysites.com/upload?html=1
method: POST
mandatory fields: name
optional fields: album_name, username_override
example url:
Headers:
POST /upload HTTP/1.1
Host: www.mysites.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.mysites.com/upload?html=1
Cookie: been_here=1; mysites=835be1c74da64c5c2e10d3d8de6a7b01
Content-Type: multipart/form-data; boundary=---------------------------1287833386723
Content-Length: 1373
-----------------------------1287833386723
Content-Disposition: form-data; name="path"
/
-----------------------------1287833386723
Content-Disposition: form-data; name="new_name"
somename
-----------------------------1287833386723
Content-Disposition: form-data; name="permission"
onlyme
-----------------------------1287833386723
Content-Disposition: form-data; name="tags"
-----------------------------1287833386723
Content-Disposition: form-data; name="file"; filename="001_42.png"
Content-Type: image/png
PNG
HTTP/1.x 302 Moved Temporarily
Server: nginx/0.7.7
Date: Sun, 20 Sep 2009 15:28:05 GMT
Content-Type: text/html
Connection: close
Location: http://guest.mysites.com/-gjtidjrk
Cache-Control: no-cache
Content-Length: 117
----------------------------------------------------------
http://guest.mysites.com/-gjtidjrk
example url:
http://www.mysites.com/edit?html=1&path=/jbtvthvi
Responses:
Success:
success={"item_info":{"flv_url":"http://guest.mysites.com/flv\/5\/215849.flv","display_item_url": "http://guest.mysites.com/get_display_file\/jbtvthvi\/xxxholic.mov","name":"xxxholic.mov", "content_type":"video\/quicktime","display_type":"Main","thumbnail_image_url": "http://guest.mysites.com/get_thumbnail?path=\/jbtvthvi\/xxxholic.mov","modified_at":1253477278781,"tags":"","type":"main","permission":"onlyme","id":215849,"added_at": 1250179411181,"cat_id":993,"full_item_url":"http://guest.mysites.com/get_file\/jbtvthvi\/xxxholic.mov", "upload_name":"xxxholic.mov","rating":0,"nr_votes":0,"pretty_name":"xxxholic.mov","comment_count":0, "account_id":5,"voted":false} }
Errors:
error={"message":"Does not exist: [guest] \/guest::\/main@core::\/jbtvthvi\/xxxholic.movg!","help":"edit <name> <permission> <tags> <[generic_field ...]> : Edit item\n <name>: a name of an existing item, or a list of names, separated with comma.\n <permission>: (default: onlyme) onlyme|allbuddies|allbuddieswrite|allbuddiessticky|everyone|everyonewrite|everyonesticky\n <tags>: A list of tags, separated by space\n <[generic_field ...]>: A generic field can be a field with any name (except reserved fields) and value\n","details":"","error_type":"ItemException"}
error={"message":"No such path: [guest] \/guest::\/main@core::\/jbtvthvf","help":"edit <name> <permission> <tags> <[generic_field ...]> : Edit item\n <name>: a name of an existing item, or a list of names, separated with comma.\n <permission>: (default: onlyme) onlyme|allbuddies|allbuddieswrite|allbuddiessticky|everyone|everyonewrite|everyonesticky\n <tags>: A list of tags, separated by space\n <[generic_field ...]>: A generic field can be a field with any name (except reserved fields) and value\n","details":"","error_type":"NoSuchPathError"}
[the item used in this example is a public guest item, so it can be edited by guests, also
MySites allows moving files from one location to another. You have control over the pathname, but no control over the cluster. Undeleting files can also be done with this method.
api: move_to
url: http://www.mysites.com/move_to
apibrowser: http://www.mysites.com/move_to?html=1
method: POST or GET
mandatory fields: name
optional fields: path
example url:
http://www.mysites.com/move_to?html=1&path=/jbtvthvi
Responses:
Success:
success=true
Errors:
error={"message":"Does not exist: [guest] \/guest::\/main@core::\/jbtvthvi\/xxxholic.mov!","help":"move_to (aliases: mv, move) <name> <dest> :
Move item\n <name>: a name of an existing item, or a list of names, separated with comma.\n <dest>: \n","details":"","error_type":"ItemException"}
api: move_to_trash
url: http://www.mysites.com/create_item
apibrowser: http://www.mysites.com/create_item?html=1
method: POST or GET
mandatory fields: name
optional fields: path
see move_to for example
Closing a Session
this method also is not part of the API, but a conveinience method to logout
api: logout
url: http://www.mysites.com/logout
mandatory fields: none
optional fields: none
closes the session and invalidates cookies.
No JSON-Response is given, but the session is closed. (Redirection-headers)
HTTP/1.x 302 Moved Temporarily