My Question on Support site for LampCMS project
Hello!Just want to share some progress of the LampCMS API work:
Any good API must have a way for developers to quickly register their APP and get a unique API KEY.
I have added this feature. This is how it works: most api calls can be made without the API KEY but the daily rate limit will be low without the key. With the valid API KEY the daily limit is much higher. All these limits are configures from !config.ini
So this is how it works: If you want to add API to your Lampcms powered site you need to tell developers how to register their app. All you do is point them to /viewapps/ url
If use does not have any apps yet, then user is redirected to the form to create new app, otherwise user sees the list of all registered apps and can view and edit any app.
You are welcome to try it here http://support.lampcms.com/viewapps/
Once you have the api key you just add &apikey=somekey to all the API requests
For example: http://support.lampcms.com/api/api.php?a=questions&tags=feature&starttime=1306360958&apikey=yourkey
Replace "youkey" with your new valid key or you will get an error, just as you should in case of invalid api key
Several api controllers are ready. Controllers are identiried by the value of the 'a' param which stands for "action"
So in previous example url the "a" is "Questions"
Other controllers are "users" - get info on any user(s) by passing comma-separated values of "uids" param
You can also just call /api/api.php?a=users with no params to get all users and can user pageID and limit params to paginate results. Results can also be sorted using sort= and dir=
for example sort=i_rep&dir=desc to sort by reputation in descending order
Another controllers:
"tags" to get tags data,
"relatedtags" to get related tags - pass tag=sometag to get related data of "sometag"
"usertags" to get tags user's active tags. Pass userID in uid param
"isfollowing" to check if user identified by uid is following another user (or tag or question) identified by "val"
For example: /api/api.php?a=isfollowing&uid=3&t=q&val=125
Will return is_following = true if user with id 3
is following question with id 125
For example /api/api.php?a=isfollowing&uid=3&t=u&val=23
Will return is_following = true IF user with id 3 IS FOLLOWING
user with id 23 (false if not following)
I will push all the latest stuff to github soon so you can examine the API controllers for yourself.
I will push all the latest stuff to github soon so you can examine the API controllers for yourself.
Click here to post your reply
No comments:
Post a Comment