Skip to content
Advertisement

How to create API

I’m finding a lot of tutorials on how to implement APIs but how does one actually create one? For example, I want to query movie quotes from my DB and also insert new ones via an API. I know PHP and MySQL but what am I missing to make an API? I read about the REST method and it seems easy but I can’t find a step-by-step guide.

Can someone please share an example or some steps to creating a simple API?

Advertisement

Answer

Worth doing Sarfraz’s article to understand design and then the mechanics/plumbing. Once you understand what your API looks like, definitely go back an evaluate REST frameworks available for PHP or whatever language you’re working with. Friends don’t let friends right their own rest plumbing in 2010.

Beyond just making it send and receive xml/json/etc., the idea of what makes a good API is something many have considered–worth reading up on imo. People who are smarter than me have said that great APIs that are designed with the way developers user them in mind, first and foremost… from there they work backwards into a black box their consumers shouldn’t have to care about.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement