Username
Forgot password?
Welcome to our site!
Or Join with FTTF

Lampcms REST API update

1

4880 views
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.





 
asked June 10, 2011 at 7:57 AM

 US
app keys.. very cool stuff IMO.. would be nice eventually to get API access to all the counters.. for real time analytics and usage visualization via external BI and data crunch software.. which reminds me of this example of the richness of KE datasets.. http://sqlserverpedia.com/blog/sql-server-tutorial/data-mining-the-sta ckoverflow-database/
flag
Jun 10 '11 at 8:13
What counters? The data about up/down votes for question(s) is already included. The Views counter is not and probably will not be included. Profile reputation is included. You can already do alot of data analysys by user starttime and endtime params to get weekly activity (for example) or daily activity per tag, per user, etc...
flag
Jun 10 '11 at 8:20
Also with api keys it will be possible (in the future) to log all api requests and then analyze which app access what data. This will be very easy to add, just have not added it yet.
flag
Jun 10 '11 at 8:21
yes.. yes.. and .. yes.. ie, would be good to have api access to history of all activity on the system.. social media interactions, api access, votes, reps, page views, posts, comments, contribution word count, tag use, tag create.. etc etc. for all the Q/A projects I'm looking at.. the analytics is really key to meeting requirements..
flag
Jun 10 '11 at 9:25
@Steve King
Steve I think you should give it some time. The progress he is makes as a single programmer is phenomenal. His code is very clean, and if you need something badly then have someone code it for you. It is up to him what gets coded, all we can do is suggest, and if he doesn't like it, we can pay him or someone else to do the job. Besides, I think it is more important to get the futures done needed to launch the first sides, reporting futures can always be added later. I for one, can't wait for the code to be ready for a public side.
flag
Jun 16 '11 at 2:29
@RoboTamer.. good points.. although its true that Dimitri is a coding superman.. we do need to give the codebase a chance to stabilize..
flag
Jun 16 '11 at 7:36

0 Answers

Be the first to answer this question

Join with account you already have

FTTF

Preview

Alert