I don't even know where to start, the ideea is that I want to develope an API that responds with certain data, but I don't have a clue for what to look.
The ideea is that there is a panel like google analytics but with no stats, but some info for some users and I want to let them embed this into their pages as a service.
Could you please point me for this method so that I know what to look for ? :)
The data you serve will be based on the url (mod rewrite) with possible authentication (e.g. oauth2).
Once you get authentication out of the way deconstruct the url to see what info the user wants.
I sugegst returning data as json. As you know you can do this via json_encode().
This tells you that the user wants to get data held for user 2367.
So you could have prepared mysqli queries, e.g. for user data and use '2367' in your execution
The returned data should be in array form that you can then format as json. Yopu just echo this.
The client (caller) can use a jQuery jsonp call for example to get this, if they want to use JS. Or use file_get_contents or even cURL (if fgc not possible for them), if they want to use PHP. The call to you is just the url (authentication aside), so it shouldn't matter if they request via RoR, java, asp.net, whatever.
I've really skimmed this topic and possibly made a few assumptions, but Dani is the experts here. She set up the DW API: have a look here for ideas:
Diafol, thank you for your input, this is exactly what i want to do. It will be a small service for photographers like me to verify their dates for clients.
Let me chew your post so i can start working on it! :)