RESTful API System - ALPHA testers needed
#1
Hey,

As you may know I've been working on this for about 3 weeks now and I think we can start with the tests right away  Big Grin

This plugin should be compatible with 1.6, 1.8 (beta versions 1.7.* and official releases 1.8.*).


[Image: 39b37bdd_o.png]

[Image: 947e4af4_o.png]


I would like feedback on the following things :
- Does the configuration work? I mean when you change the configuration under : Configuration > Settings > RESTful API System.

- When you try to call an API without any API key, does it show an error message?

- Does the API calculate the time difference right? This is a very important test. In order to test this, create an API key, and set it to only use a maximum amount of requests (different than 0 = unlimited), say per day or per week, when you reach that amount does it show you an error? Now if you can go to your SQL (using phpMyAdmin for example), under the table apikeys, locate the API key you're using, and change the maxreqfirstaccess field to an older date, so that the restriction expires, deactivate and reactivate the plugin again, did the restriction go? Can you use the API system again?
For example :
You'd only allow the API key to use 2 requests per day, when you use them all, you should see an error, then if you change the maxreqfirstaccess to day - 1 (which should make the restriction expire, as you've "virtually" waited ONE day), deactivate and reactivate the plugin, you should be able to access the API system again, and the counter should.

Deactivating / Reactivating the plugin is because I use the cache system, to limit the number of queries on DB  Big Grin

- Try calling these APIs :
http://localhost/mybb/api.php/online (online users)
http://localhost/mybb/api.php/authenticate (pass headers username and password) (authenticate a user)
http://localhost/mybb/api.php/forum/list (list of forums in your board)
http://localhost/mybb/api.php/forum/threads/forumid (replace forumid by a valid forum ID) (return threads in a forum)
http://localhost/mybb/api.php/user/list (users list)
http://localhost/mybb/api.php/version (MyBB version)
http://localhost/mybb/api.php/date?ty=0 (MyBB's current date, you can use timestamp parameter to convert a timestamp to a date and time according to MyBB's settings, ty=0 or ty=1 is to show "today" "yesterday" accordingly when the date indicates today or yesterday).


HOW TO CALL AN API ??
Either using cURL if you're comfortable with that, or using Firefox plugin or Chrome extension, like DHC.

Add the following headers :
apikey : a valid API key generated by the system
output : one of the following : json, jsonp, jsonpretty, dump, serialize, xml is broken for now, I'm working on that.
When using jsonp, you can add a callback header, to specify the name of the jsonp callback function.

You can add these headers if the API requires authentication :
username : a user's username
password : the user's password

OR

Following the HTTP recommandations, you can authenticate a user using the following header :
Authorization : Basic base64_encode("username:password").
To know more about that, click here. Anyway, the API System accepts either of those methods, but it's preferrable to use the second one as it's recommended by the IETF.

Please note that this is an ALPHA release :
Quote:Alpha software can be unstable and could cause crashes or data loss.


So don't test it on live boards Shy 

Free cookies to all the testers,

Find in on GitHub - Download it from GitHub
Rasmus Lerdorf Wrote:If eval() is the answer, you're almost certainly asking the wrong question. - Rasmus Lerdorf
Reply


Messages In This Thread
RESTful API System - ALPHA testers needed - by TheGarfield - 2014-09-01, 11:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)