Developing on the AloAshbei Platform<br />A technical session with the AloAshbei registered developers.<br />17th July, 20...
Who Am I?<br />2<br />Abu AshrafMasnun<br />Business Student at KU<br />PHP & Python Developer<br />
3<br />Contained<br />REST APIs<br />Common Mistakes<br />Integration  Possibilities<br />Mobilizing the Web<br />
4<br />REST APIs<br />User makes a request to the REST API.<br />User receives JSON response.<br />Related SOAP API  is ca...
5<br />How to use REST APIs?<br />1. Get the URL for a specific API.<br />2. Gather the required parameters.<br />3. Make ...
6<br />REST APIs Code Sample<br /><?php<br /><?php$a['registrationID'] = "masnun";  $a['password'] = "******";   $a['sourc...
<?php<br />7<br />Parsing JSON Response<br /><?php$dataObject = json_decode($result); echo $dataObject->SendSMSResponse->s...
8<br />Detailed Docs on REST APIs<br />For documentation and API specific code samples:<br />http://masnun.com/aloashbei/<...
9<br />Common Mistakes<br />While Working with the APIs<br />1.  Not editing the WSDL file.<br />2.  Missing out one or mo...
10<br />Integrations<br />Python<br />PHP<br />SoapClient<br />REST APIs<br />
11<br />Integration : PHP<br /><?php$soap = new SoapClient("http://localhost/gp/wsdl/WebService_GP_ADP_BizTalk_LBS_Orchest...
12<br />Integration : Python<br />Python aims to combine "remarkable power with very clear syntax"<br />Wikipedia<br />PyQ...
13<br />Python & REST APIs<br />import urllib, json<br />req = {<br />		"registrationID":"masnun",<br />		"password":“****...
14<br />Python & REST APIs: Output<br />C:UsersmaSnunDesktop>rest.py<br />OK<br />23.780268<br />90.407782<br />C:UsersmaS...
15<br />Google App Engine<br /><ul><li> Dynamic web serving, with full support for common web technologies
 Persistent storage with queries, sorting and transactions.
 Automatic scaling and load balancing.
 APIs for authenticating users and sending email using Google Accounts.
 A fully featured local development environment that simulates Google App Engine on your computer.
Scheduled tasks for triggering events at specified times and regular intervals</li></ul>FREE<br />
Upcoming SlideShare
Loading in …5
×

Developing on the aloashbei platform

1,170 views

Published on

My slides at the AloAshbei developers meet on 17th July, 2010.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,170
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Developing on the aloashbei platform

  1. 1. Developing on the AloAshbei Platform<br />A technical session with the AloAshbei registered developers.<br />17th July, 2010<br />
  2. 2. Who Am I?<br />2<br />Abu AshrafMasnun<br />Business Student at KU<br />PHP & Python Developer<br />
  3. 3. 3<br />Contained<br />REST APIs<br />Common Mistakes<br />Integration Possibilities<br />Mobilizing the Web<br />
  4. 4. 4<br />REST APIs<br />User makes a request to the REST API.<br />User receives JSON response.<br />Related SOAP API is called on the server.<br />A HTTP POST call is all you need.<br />Doesn’t require you to play with WSDL files.<br />Implement with almost any programming language.<br />
  5. 5. 5<br />How to use REST APIs?<br />1. Get the URL for a specific API.<br />2. Gather the required parameters.<br />3. Make a HTTP POST call to the URL.<br />4. Parse the JSON response.<br />Let’s see!<br />Can this be any simpler ?<br />
  6. 6. 6<br />REST APIs Code Sample<br /><?php<br /><?php$a['registrationID'] = "masnun"; $a['password'] = "******"; $a['sourceMsisdn'] = '8801711******'; <br />$a['destinationMsisdn'] = '8801711******'; $a['smsPort'] = 7424; $a['msgType'] = 4; $a['charge'] = 2.00; $a['chargedParty'] = '8801711******'; $a['contentArea'] = 'gpgp_psms'; $a['msgContent'] = 'Hello GP API!'; $ch = curl_init("http://masnun.com/aloashbei/sms/send"); curl_setopt($ch, CURLOPT_POST, 1); $data = ""; foreach($a as $k => $v) { $data.= "$k=$v&"; } curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); var_dump($result); ?><br />
  7. 7. <?php<br />7<br />Parsing JSON Response<br /><?php$dataObject = json_decode($result); echo $dataObject->SendSMSResponse->status; ?><br />
  8. 8. 8<br />Detailed Docs on REST APIs<br />For documentation and API specific code samples:<br />http://masnun.com/aloashbei/<br />
  9. 9. 9<br />Common Mistakes<br />While Working with the APIs<br />1. Not editing the WSDL file.<br />2. Missing out one or more parameter.<br />3. Wrong Request Name.<br />4. Miss-matching parameters.<br />5. Others.<br />Look into the docs. Use the Wiki or Forums.<br />And how to resolve them?<br />
  10. 10. 10<br />Integrations<br />Python<br />PHP<br />SoapClient<br />REST APIs<br />
  11. 11. 11<br />Integration : PHP<br /><?php$soap = new SoapClient("http://localhost/gp/wsdl/WebService_GP_ADP_BizTalk_LBS_Orchestration.asmx"); $a['registrationID'] = "masnun"; $a['msisdn'] = '8801711******'; $a['password'] = “******"; try {     var_dump( $soap->requestLocation( array ("LBSRequest" => $a) ) ); } catch (Exception $e) {      var_dump($e->getMessage());   } ?> <br />
  12. 12. 12<br />Integration : Python<br />Python aims to combine "remarkable power with very clear syntax"<br />Wikipedia<br />PyQT<br />Django / Google App Engine<br />GUI Apps<br />Web Apps<br />
  13. 13. 13<br />Python & REST APIs<br />import urllib, json<br />req = {<br /> "registrationID":"masnun",<br /> "password":“******",<br /> "msisdn":"8801711******"<br /> }<br />url = "http://masnun.com/aloashbei/location/get"<br />input = urllib.urlopen(url,urllib.urlencode(req)).read()<br />data = json.loads(input)<br />print data['LBSResponse']['Status']<br />print data['LBSResponse']['Latitude']<br />print data['LBSResponse']['Longitude']<br />
  14. 14. 14<br />Python & REST APIs: Output<br />C:UsersmaSnunDesktop>rest.py<br />OK<br />23.780268<br />90.407782<br />C:UsersmaSnunDesktop><br />
  15. 15. 15<br />Google App Engine<br /><ul><li> Dynamic web serving, with full support for common web technologies
  16. 16. Persistent storage with queries, sorting and transactions.
  17. 17. Automatic scaling and load balancing.
  18. 18. APIs for authenticating users and sending email using Google Accounts.
  19. 19. A fully featured local development environment that simulates Google App Engine on your computer.
  20. 20. Scheduled tasks for triggering events at specified times and regular intervals</li></ul>FREE<br />
  21. 21. 16<br />Mobilizing The Web<br />Why mobilize your web applications?<br />
  22. 22. 17<br />Common Challenges in Mobile Web App Development<br />
  23. 23. 18<br />Possibilities on the Mobile Web<br />Messaging/Social Applications.<br />Online Mobile Games.<br />News and Information.<br />Remote control over devices.<br />Content Sharing Services.<br />Possibilities are endless.<br />Let your imagination drive you!<br />
  24. 24. 19<br />Any Queries?<br />
  25. 25. 20<br />Thank You!<br />

×