Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,545 members, 7,809,001 topics. Date: Thursday, 25 April 2024 at 08:53 PM

Concept Of API From Scratch For Beginners - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Concept Of API From Scratch For Beginners (1062 Views)

Part 2 Of API Building Featuring The Use Of Axios / Learn Basic Concept Of Coding And Quickly Adopt Any Language Of Your Choice / What Is The Significance Of API Integration In Travel Website (2) (3) (4)

(1) (Reply)

Concept Of API From Scratch For Beginners by Nobody: 1:09pm On Mar 29, 2017
Basics of how APIs are created


gateway for more secure deployment of your application . All u need to know is soap, restful APIs, json and XML to implement them using any programming language.

example of an hosted api endpoints
api.example.com/item_list


A script was hosted to form the url to make multiple user use the api and safeguard the app.
The gateway script needs to be hosted.
let take 5 things into consideration
1. the gateway URL (hosted script of API)
2. json /xml
3. restful api/soap
4. response
5. redirection
These 5 points need to be written using paper and a pen before implementation.



Examples of APIs Gateway




NGINX API Gateway

Amazon API Gateway

strongloop API Gateway

php


<?php $url = 'https://api.example.com/;
$key=gejdjehhejej;
$ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Header: value')); CURLOPT_RETURNTRANSFER, true);

$curl_setopt($ch, CURLOPT_URL, $url);


    $result = curl_exec($ch);

    curl_close($ch);

    $result = json_decode($result)
}
?>






Note that there are get, post, delete, update and add request so numerous using HTTP connection (stream)or curl to utilize the data from the api endpoint . you can test ur api using a tool called postman to test your api on developmental stage.

Another method is web scraping using Spinn3r or ParseHub to get data from your website .

1 Like

(1) (Reply)

Best SMS Gateway For Developers. / Do You Have Valid Nigerian Phone Numbers? / I Noticed This One This Board. . . . .

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.