Welcome Guest, Not a member yet? Register   Sign In
Codeigniter as an API
#1

[eluser]Unknown[/eluser]
Hello All,

I have been working for a few days on integrating Phil Sturgeon's RESTful API Implemation but have been unable to make it do what I'd like and am wondering if I am even in the right direction.

Basically, I am developing a mobile app that will need to pull information from a MySQL Database and other developers would need access to the API for it. Essentially I would like to have it so when a developer types : http://myapi.com/v1/search?api_key=01234...cation=bar

It would return a JSON encoded set of data that could be fed into my mobile app.

I have the database setup and ready to go with data in it, and I have Phil's REST Server ready to go in my CodeIgniter install. But I can't seem to find any information as to if Phil's code allows returning information from a MySQL database or how I might go about achieving the results I want.

I know many of you can't help with Phil's stuff, but any pointers in the right direction for this project would be awesome!

Thanks!

Brian
#2

[eluser]jmadsen[/eluser]
of course it does. a RESTful (including his) is simply a way of routing the api call to a function. the function itself is like any other CI controller function, except for the naming conventions

Phil's examples show using some static arrays as data - just replace them with normal database calls like you would to a page.




Theme © iAndrew 2016 - Forum software by © MyBB