Bcms : Api?? Why not…

Since I’m a freelancer, the development on Bcms is more easy and faster.
Now I can present to you a big point : how can we get our datas saved in the cms ? With a tiny API :)

Each call to this API returns you a XML file or a media file if you want one.
It’s more easy to understand the concept with examples :

  • To get all actives sections : http://yourdomain/api/sections
  • To get all actives contents from a specific section (section id = 56) : http://yourdomain/api/section/56
  • To get a specific content from a specific section (content id = 31 and section id = 56) : http://yourdomain/api/section/56/content/31

For medias we have some calls. Do you remember this post? I told you that for each image you can define sizes in an image profil. So, to get a specific image into a specific size (for example I have a picture with a size named “thumbnail”) :   http://yourdomain/api/image/95/format/thumbnail (image id = 95 and size name = thumbnail)

For files (videos and other files) we can have directly their URL or force to download them with the browser.

  • To have the full url : http:// yourdomain/api/file/84
  • To force the download : http://yourdomain/api/file/84/get

These calls is included into the XML. If we had a content with an image and a text (which links to a file), we could have something like this:

1
2
3
4
5
6
7
8
9
10
11
12
31
56
 
 
 
my first news
 
 
http://yourdomain/api/image/95/format/thumbnail
 
 
Description of the content. <a href="http://yourdomain/api/file/84/get">Download my file</a>
Mar 9, 2011
Tags: api, as3, flash, flex

Leave a comment

Archives