1

I recently had an interview where I was asked to connect to the companies API and download a certain number of files onto my computer. I'm a student who's fairly new to programming, and I had no clue what an API was, let alone connect to one.

My Questions are:

What is an API?

and

What are some resources for me to learn how to work with API's? (I use PHP).

Thanks so much!

Kira
  • 549
  • 8
  • 24
  • 2
    http://en.wikipedia.org/wiki/Application_programming_interface – thetaiko Mar 16 '11 at 20:58
  • Joshua Bloch's excellent slides are a must read : http://lcsd05.cs.tamu.edu/slides/keynote.pdf – Spike Gronim Mar 16 '11 at 20:59
  • Resisting the urge to ask why you didn't try typing the letters A, P, and I into the search box at wikipedia.org, see this question and its answers: http://stackoverflow.com/q/4292715/238688 – Dan J Mar 16 '11 at 21:00
  • I remember searching for API when I first came across the name, and after reading wikipedia among others, I was still very confused. – The Muffin Man Mar 16 '11 at 21:15

1 Answers1

2

Lets say that I'm a company and I have products. I want to allow other people to display my products on their web site. How can I do this without giving them my database username and password and leaving a note that says "Please don't delete anything." ?

For brevity I could write a function/method that someone could invoke that returns a list of products. This method will ask that it is given some information, such as a category name. I could then write a separate method for add product if I wanted to allow it.

In other words, an API is an interface in which you can work with someone elses application in a secure manner. They control what you can and cannot do.

The Muffin Man
  • 19,585
  • 30
  • 119
  • 191
  • Wow that explains a lot. I tried looking up API in various other sources but most places describe the HOW very clearly but seldom the WHY. Which was why I was still confused. Thanks so much! – Kira Mar 17 '11 at 04:20