Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3441392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:32:50+00:00 2026-05-18T08:32:50+00:00

What I want and have I’m willing to create an API , I already

  • 0

What I want and have

I’m willing to create an API, I already know what does an API stands for.
I use PHP as a server side language.

However I don’t really understand how an API works from scratch, and how can I enable users to use my API after I created it.

What I think and know

Well right now I think that with an API I enable developers to reach my database and request queries. But then why should I create a full language for it? Why can’t they use PHP or any other server side language?

As I saw, companies who crates API’s for their site, they require a registration to give to developers an API KEY. Does the developers log in to database trough this API KEY? And if yes, then why they don’t have a password too? If I know somebody’s API KEY I can use it or what?

And as I read/heard XML is related somehow to API’s, but why and how?

Also please consider in your answers that I don’t want to use any frameworks or something like that, I want to make it in scratch so I want to understand how it works from A to Z.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:32:51+00:00Added an answer on May 18, 2026 at 8:32 am

    An API is really just methods that you publicly expose. Say, for example, you have a blog site. You want your members to be able to post a blog entry without actually coming to your site – logging in, filling out a form, etc..
    Perhaps they want to create an Android/IPhone app to post to your cool blog site. You can allow them to do that.

    Create an API for this:

        <?php
            function createBlogEntry(memberEmailAddress, memberPassWord, BlogTitle, BlogBody)
            {
    
               //Here you would usually call an internal (or not publicly exposed) method that
               //contains the actual logic to insert. Like Jim's answer states, you just want 
               //people to be able to performan action in your system, you don't want them to see HOW you do it.
    
              encapsulatedBlogCreation(memberEmailAddress, memberPassWord, BlogTitle, BlogBody);  
    
    
               //This is where API's get tricky. I need to return to the user the result of
               // the save so that my user knows what happens. In my API documentation, I 
               //tellthe user 0 = Created Successfully. If this is a READ operation
               //just return the result. Most modern programming languages also have
               //a way to capture an HTTP response - so dealing with the return is their responsibility
    
                return 0;
            }
     ?>
    

    A couple things:

    • In my API, I didn’t need a developer Key, I allowed the user to pass in their login credentials. An API key does the same thing, it uniquely identifies a request and links it to a user in the system.
    • This API doesn’t use XML. This is about as simple as an api gets. This can be called by sending an HTTP request which can be done with any modern programming language. Say I put the above code in a file called blog.php and put it in the root of my blogsite. I would call it like:

    *http://myblogsite.com/blog.php?memberEmailAddress=myEmal@example.com&memberPassWord=myPass&BlogTitle=Title-of-post&BlogBody=the_blog_post_is_here*

    One thing you need to understand, is that there has to be a need for an API. You can expose a method to create a blog entry, but if no one knows about it or uses it – it’s worthless. API’s need to be documented, advertised, and provide a benefit to potential users.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simllar question like here: static-method-invocation , but in PHP. Simply, I want
I am trying to create a jquery plugin, and I want have the following
In my project I have many folders. I certainly know I want have changes
i want have an image and i want to set it as a background
want to have a Hyperlink-Button in a gridView in which I can display a
I have want to save a form in Symfony2, based on a form type,
I want to have a java app running, using a function/method (with as little
I want to have the ListItems to extend with their orange background the full
I want to have a similar tool in Emacs as the following in Vim
I want to have a tree in memory, where each node can have multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.