How to create web api to extract oracle data using php

We have oracle database installed and would like to share our data with others. I would like to develop a simple web service that provide other application to pull data from oracle database for their own use.

I want to use php to start with because this language is the one that I am familiar with compare to any other language. I had developed few interfaces in php to do (create, read, update & delete) CRUD functionalities. We are using Apache as our web server.

For web api, honestly this is something new for me. I need to know how to do the following, assuming extracting employee table from sample table of oracle database (SCOTT account/schema) - (copying data to new table)

1. Create web-api in php to extract employee table (all columns) and output in JSON format.
2. Create php to call this web-api to read extracted employee record (JSON format) and save it to new_employee table under same schema.
3. How to include authentication to this web-api ? so that only specific client can access to this service.

Please don't give me bunch of links unless it really really help me to do specific task as above. I consider myself as beginner to this.  I have read a lot but seems does not giving me better understanding on how to do it, especially using php.

Thanks in advance.
VW 63654Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Walter RitzelSenior Software EngineerCommented:
Unfortunately, links will be required to do this explanation.
The links below are a good start:

They explain in detail how to create the web api in PHP.

Now, this is an ebook very interesting about developing web apis:

Besides that, I can provide to you an example of a web api in Python.
Ray PaseurCommented:
Have a look at this article.  I've been through the process and written it up!

Today, this would be a little different (technology is always advancing).  I might consider a PHP framework like Laravel or Slim.  I don't know Slim very well, but I'm quite familiar with Laravel and it's very talented in the API space.  Also, I would not use XML return values today - JSON is a better transport mechanism.  PHP has JSON functions that can package arrays and objects for over-the-web transport.

But having said that, the API concept is all about performance.  You may want to get closer to the "bare metal" implementation if you find the framework impedes performance.  Frameworks are supposed to make programming easier, and this usually comes at some expense in performance.  Consider cacheing the responses with ReDiS or memcacheD if performance is an issue.

If you have to send binary-safe data, learn about base64 encoding.

Authentication is usually a combination of IP address, HTTP referrer, and API key.  The article covers some of this.

You will need some background in how HTTP request/response protocols work.

That's about it.  If you read those resources and still have specific questions about how to get started, please post back and we will try to help.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VW 63654Author Commented:
Thanks for giving me all the links.

Ray, I like the article that you send. Very basic and brief intro on API.
I will have a look first and trying to find out where can I make a quick start.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Applications

From novice to tech pro — start learning today.