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
96
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
38
Building Infrastructure for the Next Generation of Successful African Ventures - Africa's Talking
ianjuma
0
100
Change Management: Building a CI/CD Pipeline
ianjuma
0
130
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
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
3k
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
370
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
170
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
420
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
490
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
210
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
310
AWSに止められる覚悟してますか?
morizo_1984
2
420
App Intentsのビルドプロセスを支える技術
kntkymt
0
460
アクセシビリティから考える情報設計
high_g_engineer
0
420
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Typedesign – Prime Four
hannesfritz
42
3.2k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
490
The Curious Case for Waylosing
cassininazir
1
540
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Amusing Abliteration
ianozsvald
1
320
How Software Deployment tools have changed in the past 20 years
geshan
2
34k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Paper Plane
katiecoart
PRO
4
53k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
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()