API documentation

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

sylario
Posts: 28
Joined: 14 Feb 2012, 13:44

API documentation

Post by sylario »

I will not be using the SDK (working in ruby on rails), is there a documentation of the API itself?
http://www.statsmania.net Maniaplanet ladders
User avatar
Jojo_44
Posts: 485
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

Re: API documentation

Post by Jojo_44 »

Hi,

I guess nobody from nadeo will answer this weekend, so I try to give you some informations.

The SDK uses the REST API. You can get further information about this from gouxims post here:

http://forum.maniaplanet.com/viewtopic. ... 212#p19721

I am not so familiar with ruby on rails but you should search for "RESTful Rails", I think.

best regards, Jojo
Image
my english sounds very unfriendly but it isn´t ;)
sylario
Posts: 28
Joined: 14 Feb 2012, 13:44

Re: API documentation

Post by sylario »

Thanks, but what i am actually looking is this kind of documentation : http://wiki.eve-id.net/APIv2_Page_Index

The description of all the info you can get from the API. Currently i must browse the SDK code hoping that i'll miss nothing.
http://www.statsmania.net Maniaplanet ladders
svens
Posts: 97
Joined: 15 Jun 2010, 11:06
Location: Bern, CH
Contact:

Re: API documentation

Post by svens »

Nah, nothing like this is available. Also at NADEO it's quite common to let the people figure out how things work, instead of providing documentation....

Just stick to the descriptions in this thread: http://forum.maniaplanet.com/viewtopic.php?f=282&t=5058 and get the URLs from the PHP code.
sylario
Posts: 28
Joined: 14 Feb 2012, 13:44

Re: API documentation

Post by sylario »

Ok, the API does not seems to be Restful at all, the Built in API connector of ruby on rails cannot work with the maniaplanet API ><

I'l have to write a connector to use maniaplanet API.
http://www.statsmania.net Maniaplanet ladders
User avatar
fastforza
Posts: 850
Joined: 15 Jun 2010, 11:19
Contact:

Re: API documentation

Post by fastforza »

sylario wrote:Ok, the API does not seems to be Restful at all
The web service is as RESTful as it can get. Gouxim put a lot of work into the web service and I'm sure he followed the concepts of REST down to every detail.
sylario wrote:the Built in API connector of ruby on rails cannot work with the maniaplanet API ><
That's an RoR problem then. The web service works well in other languages such as PHP and C#.

Kudos for using RoR though. 8-)
Mania Exchange - Share your maps!

ASUS Maximus IV GENE Z / i7 2600K 3.40Ghz QC / 16GB G.Skill Ripjaws DDR3 / GTX 560 Ti

Need technical help for ManiaPlanet? Click here. :)
User avatar
magnetik
Posts: 1673
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: API documentation

Post by magnetik »

You can see quickly most of available method of the WebService API by searching '\$this->execute\(' in google code.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
sylario
Posts: 28
Joined: 14 Feb 2012, 13:44

Re: API documentation

Post by sylario »

My bad, it seems that the mania API use unusual syntax but is RESTful. I overrided a rails method and nows it works fine. RoR does not like API without .xml or .json ath the end of query.
http://www.statsmania.net Maniaplanet ladders
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: API documentation

Post by gouxim »

Our API is indeed RESTful and we put lot of effort in doing that. However, it's important to rememeber that REST is not a protocol but more a philosophy. It's basically the idea to use as much of the HTTP protocol as possible.

For instance if you need authentication, why make your own system with required parameters and stuff when you can simply rely on the HTTP Basic Authentication scheme? Another good example is input/output encoding specification: just use the HTTP Accept & Content-type headers.
sylario wrote:RoR does not like API without .xml or .json ath the end of query.
It's sad, because it's better to rely on the Accept header in the request and the Content-Type header in the response, which could be something like "application/json". However, the API do support extensions to specify the requested type! Note that it only works for specifying the type of the response, it won't work for specifying how you encode your data when POSTing something (for that you need to use the Content-Type header in your POST request).

Try GETting that:

https://ws.maniaplanet.com/foobar/index.json
https://ws.maniaplanet.com/foobar/index.txt
https://ws.maniaplanet.com/foobar/index.html

It's simple to use. Just add "index.json" after any of the URL of the API. Another example:

http://ws.maniaplanet.com/players/gouxim/index.json

If you have other questions regarding how the API works, don't hesitate to ask.

Hope it helps :yes:
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
sylario
Posts: 28
Joined: 14 Feb 2012, 13:44

Re: API documentation

Post by sylario »

It works great!
Now i am setting up a cache system for the query to the API, i guess i'll cache info 15mins to 1hour.
http://www.statsmania.net Maniaplanet ladders
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 1 guest