PHP <> API

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

PHP <> API

Post by malcolmboston »

Havent really looked into it yet but i was told at work yesterday that we will now be getting all our data through an available API to us, basically im looking to find ways of reading, communicating and utilising API's with PHP.

can anyone provide me with some links please?

Thanks
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

bump
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Not wanting to sound flippant, but that depends entirely on the API. Any application has, per definitionem, an Application Program Interface.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

An API can be anything.

It could be as simple (but hard to use) as "Scrape the html of the webpage, and do with it what you will".

It could be as complex (but easy to use) as "We will send all data via XML on a specific port using a specific DTD".

It could even entail SOAP, socket communications, or even email. It all depends on the application.

When people say they will give you an API, they usually mean "We are going to be consistent about how my app will communicate with your app", which is an excellent start. Of course, from there..
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

ah, ok cool

I was just a little worried as we are no longer going to be getting our data from a database but from a 3rd party API with millions of pieces of data and i have not worked directly with API's before so was a little 'scared'
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

with a lot of luck you will get some good documentation on how to use the API.

with a little luck you will get some documentation on how to use the API.

or with no luck you will get **** all and only a phone number to call on how to use the API and the person on the other end doesn't speak english as their native tongue. (makes communicating complex ideas difficult).

I working with the third at the moment. :(
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Can you count on a consistent API? You could have a big problem if it changes regularly with a lot of code to update each time. You can isolate this by encapsulating the API (Adapter? Or Facade? I keep getting them mixed up) so that at least you just have one class to edit rather than the entire code base.
Post Reply