Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intro to Flask and AT API's
Search
Ian Juma
October 15, 2016
Programming
0
76
Intro to Flask and AT API's
Flask introduction; AfricasTalking API's introduction
Ian Juma
October 15, 2016
Tweet
Share
More Decks by Ian Juma
See All by Ian Juma
Scaling notifications; notification-service V2
ianjuma
0
28
Building Infrastructure for the Next Generation of Successful African Ventures - Africa's Talking
ianjuma
0
87
Change Management: Building a CI/CD Pipeline
ianjuma
0
120
Ian J, Salama A.B
ianjuma
0
100
Innovation
ianjuma
0
140
Asynchronous Python with gevent and asyncIO
ianjuma
1
2.4k
Scaling AfricasTalking - DevCraft nairobi
ianjuma
0
250
Other Decks in Programming
See All in Programming
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
140
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
180
Discover Metal 4
rei315
2
110
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
670
Goで作る、開発・CI環境
sin392
0
190
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
640
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
580
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.9k
PipeCDのプラグイン化で目指すところ
warashi
1
250
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
3
360
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
370
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
130
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
Being A Developer After 40
akosma
90
590k
Building Applications with DynamoDB
mza
95
6.5k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Making Projects Easy
brettharned
116
6.3k
Scaling GitHub
holman
459
140k
Adopting Sorbet at Scale
ufuk
77
9.4k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
240
Bash Introduction
62gerente
614
210k
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()