SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
HTTP/1.1 201 Created
Allow: POST, OPTIONS
Connection: keep-alive
Content-Type: application/json
Date: Tue, 21 Jun 2016 05:42:44 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Frame-Options: SAMEORIGIN
transfer-encoding: chunked
[
{
"callid": "a4963d84-1a9c-4fc7-9ac0-a9dc582168e9"
}
]
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
import requests
payload = {
'message': "Hello from Xoxzo",
'recipient': "+818012345678",
'sender': "818011112222"
}
req_res = requests.post(
"https://api.xoxzo.com/sms/messages/",
data=payload,
auth=("xxx", "yyy"))
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
xc = XoxzoClient(sid=“xxx",
auth_token="yyy")
result = xc.send_sms(
message = "Hello from Xoxzo",
recipient = "+818012345678",
sender = "818011112222")
import os
from slackbot.bot import respond_to, listen_to
from xoxzo.cloudpy import XoxzoClient
sid = os.environ.get("XOXZO_API_SID")
auth_token = os.environ.get("XOXZO_API_AUTH_TOKEN")
@listen_to('(.*) (.*) ')
def hello(message, phonnum, msg):
message.reply('%s %s ' % (phonnum, msg))
xc = XoxzoClient(sid=sid, auth_token=auth_token)
result = xc.call_tts_playback(
tts_message=msg,
tts_lang='ja',
recipient="+81" + phonnum[1:],
caller="+815012345678")
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門
初心者のためのPythonによるWebAPI活用方入門

Más contenido relacionado

Was ist angesagt?

You've Got Fail
You've Got FailYou've Got Fail
You've Got FailJames Boyd
 
Concept of BlockChain & Decentralized Application
Concept of BlockChain & Decentralized ApplicationConcept of BlockChain & Decentralized Application
Concept of BlockChain & Decentralized ApplicationSeiji Takahashi
 
Working with web_services
Working with web_servicesWorking with web_services
Working with web_servicesLorna Mitchell
 
Ethernet Shield
Ethernet ShieldEthernet Shield
Ethernet ShieldTinker
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingSteve Rhoades
 
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for DummiesBartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for DummiesBusiness Link Krakow
 
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...NoNameCon
 
log_client.txt
log_client.txtlog_client.txt
log_client.txtsptlove2
 

Was ist angesagt? (9)

Poodle
PoodlePoodle
Poodle
 
You've Got Fail
You've Got FailYou've Got Fail
You've Got Fail
 
Concept of BlockChain & Decentralized Application
Concept of BlockChain & Decentralized ApplicationConcept of BlockChain & Decentralized Application
Concept of BlockChain & Decentralized Application
 
Working with web_services
Working with web_servicesWorking with web_services
Working with web_services
 
Ethernet Shield
Ethernet ShieldEthernet Shield
Ethernet Shield
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
 
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for DummiesBartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
 
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
 
log_client.txt
log_client.txtlog_client.txt
log_client.txt
 

Mehr von Xoxzo Inc.

人間のためのpython #stapy68 2021-04-14
人間のためのpython #stapy68 2021-04-14人間のためのpython #stapy68 2021-04-14
人間のためのpython #stapy68 2021-04-14Xoxzo Inc.
 
Goto statement considered harmful - LearnDay@Xoxzo #17
Goto statement considered harmful - LearnDay@Xoxzo #17Goto statement considered harmful - LearnDay@Xoxzo #17
Goto statement considered harmful - LearnDay@Xoxzo #17Xoxzo Inc.
 
A very short history on drunkenness - LearnDay@Xoxzo #14
A very short history on drunkenness - LearnDay@Xoxzo #14A very short history on drunkenness - LearnDay@Xoxzo #14
A very short history on drunkenness - LearnDay@Xoxzo #14Xoxzo Inc.
 
PyCon JP 2019 LT - 「ありがとう」と言おう
PyCon JP 2019 LT - 「ありがとう」と言おうPyCon JP 2019 LT - 「ありがとう」と言おう
PyCon JP 2019 LT - 「ありがとう」と言おうXoxzo Inc.
 
USB Hacking - LearnDay@Xoxzo #11
USB Hacking -  LearnDay@Xoxzo #11USB Hacking -  LearnDay@Xoxzo #11
USB Hacking - LearnDay@Xoxzo #11Xoxzo Inc.
 
How to run a design sprint - LearnDay@Xoxzo #9
How to run a design sprint - LearnDay@Xoxzo #9How to run a design sprint - LearnDay@Xoxzo #9
How to run a design sprint - LearnDay@Xoxzo #9Xoxzo Inc.
 
Lightning Talk: PyCon Thailand 2019
Lightning Talk: PyCon Thailand 2019Lightning Talk: PyCon Thailand 2019
Lightning Talk: PyCon Thailand 2019Xoxzo Inc.
 
The Culture Map - LearnDay@Xoxzo #8
The Culture Map - LearnDay@Xoxzo #8The Culture Map - LearnDay@Xoxzo #8
The Culture Map - LearnDay@Xoxzo #8Xoxzo Inc.
 
Linear algebra power of abstraction - LearnDay@Xoxzo #5
Linear algebra power of abstraction - LearnDay@Xoxzo #5Linear algebra power of abstraction - LearnDay@Xoxzo #5
Linear algebra power of abstraction - LearnDay@Xoxzo #5Xoxzo Inc.
 
The Takumi Method - LearnDay@Xoxzo #1
The Takumi Method - LearnDay@Xoxzo #1The Takumi Method - LearnDay@Xoxzo #1
The Takumi Method - LearnDay@Xoxzo #1Xoxzo Inc.
 
Django osc2018-okinawa
Django osc2018-okinawaDjango osc2018-okinawa
Django osc2018-okinawaXoxzo Inc.
 
Working in a Fully Remote Organization: Challenges and How We Made it Work - ...
Working in a Fully Remote Organization: Challenges and How We Made it Work - ...Working in a Fully Remote Organization: Challenges and How We Made it Work - ...
Working in a Fully Remote Organization: Challenges and How We Made it Work - ...Xoxzo Inc.
 
JomLaunch 5.0 Sep 2017 by Iqbal Abdullah
JomLaunch 5.0 Sep 2017 by Iqbal AbdullahJomLaunch 5.0 Sep 2017 by Iqbal Abdullah
JomLaunch 5.0 Sep 2017 by Iqbal AbdullahXoxzo Inc.
 
Introduction to Data Analysis
Introduction to Data AnalysisIntroduction to Data Analysis
Introduction to Data AnalysisXoxzo Inc.
 
djangoのmigrationはどう動いているか
djangoのmigrationはどう動いているかdjangoのmigrationはどう動いているか
djangoのmigrationはどう動いているかXoxzo Inc.
 
PyCon APAC 2017
PyCon APAC 2017PyCon APAC 2017
PyCon APAC 2017Xoxzo Inc.
 
Pythonの隠れた武器
Pythonの隠れた武器Pythonの隠れた武器
Pythonの隠れた武器Xoxzo Inc.
 
The Secret Weapon Of Python
The Secret Weapon Of PythonThe Secret Weapon Of Python
The Secret Weapon Of PythonXoxzo Inc.
 

Mehr von Xoxzo Inc. (18)

人間のためのpython #stapy68 2021-04-14
人間のためのpython #stapy68 2021-04-14人間のためのpython #stapy68 2021-04-14
人間のためのpython #stapy68 2021-04-14
 
Goto statement considered harmful - LearnDay@Xoxzo #17
Goto statement considered harmful - LearnDay@Xoxzo #17Goto statement considered harmful - LearnDay@Xoxzo #17
Goto statement considered harmful - LearnDay@Xoxzo #17
 
A very short history on drunkenness - LearnDay@Xoxzo #14
A very short history on drunkenness - LearnDay@Xoxzo #14A very short history on drunkenness - LearnDay@Xoxzo #14
A very short history on drunkenness - LearnDay@Xoxzo #14
 
PyCon JP 2019 LT - 「ありがとう」と言おう
PyCon JP 2019 LT - 「ありがとう」と言おうPyCon JP 2019 LT - 「ありがとう」と言おう
PyCon JP 2019 LT - 「ありがとう」と言おう
 
USB Hacking - LearnDay@Xoxzo #11
USB Hacking -  LearnDay@Xoxzo #11USB Hacking -  LearnDay@Xoxzo #11
USB Hacking - LearnDay@Xoxzo #11
 
How to run a design sprint - LearnDay@Xoxzo #9
How to run a design sprint - LearnDay@Xoxzo #9How to run a design sprint - LearnDay@Xoxzo #9
How to run a design sprint - LearnDay@Xoxzo #9
 
Lightning Talk: PyCon Thailand 2019
Lightning Talk: PyCon Thailand 2019Lightning Talk: PyCon Thailand 2019
Lightning Talk: PyCon Thailand 2019
 
The Culture Map - LearnDay@Xoxzo #8
The Culture Map - LearnDay@Xoxzo #8The Culture Map - LearnDay@Xoxzo #8
The Culture Map - LearnDay@Xoxzo #8
 
Linear algebra power of abstraction - LearnDay@Xoxzo #5
Linear algebra power of abstraction - LearnDay@Xoxzo #5Linear algebra power of abstraction - LearnDay@Xoxzo #5
Linear algebra power of abstraction - LearnDay@Xoxzo #5
 
The Takumi Method - LearnDay@Xoxzo #1
The Takumi Method - LearnDay@Xoxzo #1The Takumi Method - LearnDay@Xoxzo #1
The Takumi Method - LearnDay@Xoxzo #1
 
Django osc2018-okinawa
Django osc2018-okinawaDjango osc2018-okinawa
Django osc2018-okinawa
 
Working in a Fully Remote Organization: Challenges and How We Made it Work - ...
Working in a Fully Remote Organization: Challenges and How We Made it Work - ...Working in a Fully Remote Organization: Challenges and How We Made it Work - ...
Working in a Fully Remote Organization: Challenges and How We Made it Work - ...
 
JomLaunch 5.0 Sep 2017 by Iqbal Abdullah
JomLaunch 5.0 Sep 2017 by Iqbal AbdullahJomLaunch 5.0 Sep 2017 by Iqbal Abdullah
JomLaunch 5.0 Sep 2017 by Iqbal Abdullah
 
Introduction to Data Analysis
Introduction to Data AnalysisIntroduction to Data Analysis
Introduction to Data Analysis
 
djangoのmigrationはどう動いているか
djangoのmigrationはどう動いているかdjangoのmigrationはどう動いているか
djangoのmigrationはどう動いているか
 
PyCon APAC 2017
PyCon APAC 2017PyCon APAC 2017
PyCon APAC 2017
 
Pythonの隠れた武器
Pythonの隠れた武器Pythonの隠れた武器
Pythonの隠れた武器
 
The Secret Weapon Of Python
The Secret Weapon Of PythonThe Secret Weapon Of Python
The Secret Weapon Of Python
 

Último

Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondTungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondContinuent
 
Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019Eric Johnson
 
Google-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdfGoogle-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdfMaria Adalfio
 
如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?krc0yvm5
 
overview of Virtualization, concept of Virtualization
overview of Virtualization, concept of Virtualizationoverview of Virtualization, concept of Virtualization
overview of Virtualization, concept of VirtualizationRajan yadav
 
Generalities about NFT , as a new technology
Generalities about NFT , as a new technologyGeneralities about NFT , as a new technology
Generalities about NFT , as a new technologysoufianbouktaib1
 
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC
 
Benefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptxBenefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptxlibertyuae uae
 
SQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptxSQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptxJustineGarcia32
 
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...hasimatwork
 

Último (10)

Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondTungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
 
Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019
 
Google-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdfGoogle-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdf
 
如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?
 
overview of Virtualization, concept of Virtualization
overview of Virtualization, concept of Virtualizationoverview of Virtualization, concept of Virtualization
overview of Virtualization, concept of Virtualization
 
Generalities about NFT , as a new technology
Generalities about NFT , as a new technologyGeneralities about NFT , as a new technology
Generalities about NFT , as a new technology
 
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
 
Benefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptxBenefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptx
 
SQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptxSQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptx
 
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
 

初心者のためのPythonによるWebAPI活用方入門

  • 29. HTTP/1.1 201 Created Allow: POST, OPTIONS Connection: keep-alive Content-Type: application/json Date: Tue, 21 Jun 2016 05:42:44 GMT Server: Apache/2.4.7 (Ubuntu) X-Frame-Options: SAMEORIGIN transfer-encoding: chunked [ { "callid": "a4963d84-1a9c-4fc7-9ac0-a9dc582168e9" } ]
  • 41. import requests payload = { 'message': "Hello from Xoxzo", 'recipient': "+818012345678", 'sender': "818011112222" } req_res = requests.post( "https://api.xoxzo.com/sms/messages/", data=payload, auth=("xxx", "yyy"))
  • 44. xc = XoxzoClient(sid=“xxx", auth_token="yyy") result = xc.send_sms( message = "Hello from Xoxzo", recipient = "+818012345678", sender = "818011112222")
  • 45. import os from slackbot.bot import respond_to, listen_to from xoxzo.cloudpy import XoxzoClient sid = os.environ.get("XOXZO_API_SID") auth_token = os.environ.get("XOXZO_API_AUTH_TOKEN") @listen_to('(.*) (.*) ') def hello(message, phonnum, msg): message.reply('%s %s ' % (phonnum, msg)) xc = XoxzoClient(sid=sid, auth_token=auth_token) result = xc.call_tts_playback( tts_message=msg, tts_lang='ja', recipient="+81" + phonnum[1:], caller="+815012345678")