Anda di halaman 1dari 4

Application Protocol Interface (API) for

Universiti Teknologi Malaysia


written by misterpah
February 2014
1 WHY ?
Lets face it. There are alot of online application in Universiti Teknologi Malaysia
(UTM). Most of them uses the same information as other system with seper-
ated databases. For example, student named misterpah have a prole stored in
system A, System B and System C. Because these systems doesnt talk to each
other, the student needs to update all of the 3 system with new informations.
Why should he ? Its the same information were talking here.
2 HOW TO SOLVE ?
The answer is to make the system(s) talk to each other. Were not talking
about socket programming. If the system follow a certain guidelines, Your
systems informations can be access by ANY OTHER SYSTEMS, ANY OTHER
PROGRAMMING LANGUAGES, on ANY DEVICES. There were no needs to
integrate and combine databases, merging tables or new databases view. There
were no special server conguration needed.
3 IS THERE ANYBENEFIT OF DOINGTHIS?
Im pretty sure there are alot of benet. These are the benet i can think of :
1. Less similar database to maintain.
2. Only one data per user. Other additional data are stored in their own
database.
3. Users wont have to register more than once.
4. New system wont have to clone student/sta databases.
5. System admin controls which data it wants to expose.
1
6. ASP can talk to PHP, Javascript, Python, .NET, Java or any other lan-
guage which have access to the internet
7. You can integrate a desktop application, mobile application or (with cer-
tain degree of knowledge) embedded computer with your system.
4 IS THERE ANY DISADVANTAGE TO THIS
METHOD?
1. External system can only get data from the other Systems API .
2. External system cant INSERT/UPDATE any data inside anothers sys-
tem.
5 HOW TO DO THIS?
Its quite simple really. The theory is :
Listen to the specic HTTP GET parameter, and expose (accord-
ingly) the data on the page, with JSON format, and with mimetype
application/JSON.
Simple stu, right? If you wants to learn more about this, its called RESTful
API HTTP methods, and well be only using the GET parameter as for security
reasons.
6 IS THERE ANYEXAMPLE WE COULDFOL-
LOW ?
In this article, Ill be explain how to make a systems API using PHP program-
ming Language and another example Javascript. Of course, this method can
be reproduced on any other suitable programming language. The example will
show 2 sides of programming. The rst example is the API side (gure 1), and
the second is the retrieve part (PHP - gure 2 , Javascript - gure 3).
7 AVAILABLE API
We at Webteam (corporate aairs UTM) have developed (and uses) several API
for our system. It have been used in the UTM frontpage, Mobile Application
and the UTM Large screen called IBoard. You may uses our data as you like
(as its a non-destructive access). You may view the documentation here :
http://corporateaairs.utm.my/webteam/api/
2
Figure 1: PHP API ( http://pastebin.com/Wd4W6jgN )
Figure 2: Retrieving data from API using PHP ( http://pastebin.com/9yjLiV8k
)
3
Figure 3: Retrieving data from API using Javascript (
http://pastebin.com/GrVEy8kc )
If you know or developed an API on one of UTM system(s) , we encourage
you to submit it to us, so we can index them accordingly. Additionally we can
include your API within our API, so your API call will starts with :
http://www.utm.my/api?type=<YOUR_API_HERE>
To be included within this page, you must follow certain guidelines to ease other
developer to use your API.
8 SUMMARY
This article is written to educate & encourage system developers to develop API
for their systems. Its up to the developer if they wants to implement API or
not.
4

Anda mungkin juga menyukai