Welcome Guest, Not a member yet? Register   Sign In
how do I organize API stuff
#1

(This post was last modified: 03-04-2016, 06:53 PM by digity.)

I'm building an app with CI that relies a lot on returned data from multiple APIs. For example APIs from FlightAware, WeatherUndergound, amongst others. They'll be SOAP, RESTful, JSON, etc. based. I imagine it's best to not have the code snippets for those APIs in controller or view - what's best practice for integrating APIs, in general, into CI's structure considering they'll be called both on demand and in the background?


P.S. - I'll be displaying the returned data straight to a page and in some cases storing them to the database (temporarily, of course).
Reply
#2

I am not sure about best practice, but I would put the code for each API into a library, which you can then use in any way you want. However when the API changes, you need only update the one library file.

Hope that helps,

Paul.
Reply
#3

Question is to general, needs a book to answer it; Here is one good: "building apis you won't hate" Wink
Reply




Theme © iAndrew 2016 - Forum software by © MyBB