Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Intro to Flask and AT API's
Search
Ian Juma
October 15, 2016
Programming
98
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Flask and AT API's
Flask introduction; AfricasTalking API's introduction
Ian Juma
October 15, 2016
More Decks by Ian Juma
See All by Ian Juma
Scaling notifications; notification-service V2
ianjuma
0
40
Building Infrastructure for the Next Generation of Successful African Ventures - Africa's Talking
ianjuma
0
110
Change Management: Building a CI/CD Pipeline
ianjuma
0
140
Ian J, Salama A.B
ianjuma
0
120
Innovation
ianjuma
0
150
Asynchronous Python with gevent and asyncIO
ianjuma
1
2.5k
Scaling AfricasTalking - DevCraft nairobi
ianjuma
0
270
Other Decks in Programming
See All in Programming
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
golang-bob.pdf
iwatsukayura
0
130
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
480
Domain-Driven Transformation
hschwentner
2
2.3k
R8 の設定見直しでアプリサイズ削減
andpad
0
220
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
610
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Typedesign – Prime Four
hannesfritz
42
3.2k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Odyssey Design
rkendrick25
PRO
2
870
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
The Curious Case for Waylosing
cassininazir
1
570
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
550
Transcript
API’s with Flask Python, Flask, API’s, AT API’s
whoami @IanJuma github.com/ianjuma medium.com/@IanJuma
API
What’s an API A contract between two pieces of software
or services
Setup Python 2.7 / 3. PIP Flask ngrok (local tunneling)
Sample project
Why Flask Simple Un-opinionated Minimal 100% WSGI Lots of extensions
Class based views
Flask API from flask import Flask app = Flask(__name__) @app.route("/api")
def resource(): # perform task return "resource" if __name__ == "__main__": app.run()
API methods from flask import Flask app = Flask(__name__) @app.route("/api”,
methods=[’POST’, ‘GET’, ‘DELETE’, ‘PUT’]) def resource(): # perform task return "resource" if __name__ == "__main__": app.run()
methods... GET - fetch a resource POST - add a
resource DELETE - remove a resource PUT - update a resource HEAD - fetch information about a resource without fetching the resource (options)
Library text API from flask import Flask app = Flask(__name__)
@app.route("/library/api") def resource(): # fetch text from harry potter return harry_potter if __name__ == "__main__": app.run()
Code ... Deep dive
Send SMS from AfricasTalkingGateway import AfricasTalkingGateway # gateway instance gateway
= AfricasTalkingGateway(username, apikey) # send message gateway.sendMessage("+254 703567XXX", "hello...")
Send Airtime from AfricasTalkingGateway import AfricasTalkingGateway # gateway instance gateway
= AfricasTalkingGateway(username, apikey) # send message gateway.sendAirtime("+254 703567XXX", "amount")
Making a voice call gateway = AfricasTalkingGateway(username, apikey) results =
gateway.call(callFrom, callTo)
Handling a call from flask import Flask app = Flask(__name__)
@app.route("/voice/api") def voice(): res = '<Response><Say>"hi, I am testing"</Say></Response>' return res if __name__ == "__main__": app.run()