Webhook: Python

9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.14
List Price:  €64.60
You save:  €18.46
£39.56
List Price:  £55.40
You save:  £15.83
CA$67.95
List Price:  CA$95.14
You save:  CA$27.18
A$76.57
List Price:  A$107.21
You save:  A$30.63
S$67.34
List Price:  S$94.29
You save:  S$26.94
HK$391.09
List Price:  HK$547.55
You save:  HK$156.46
CHF 45.27
List Price:  CHF 63.39
You save:  CHF 18.11
NOK kr538.11
List Price:  NOK kr753.41
You save:  NOK kr215.29
DKK kr344.20
List Price:  DKK kr481.90
You save:  DKK kr137.70
NZ$83.23
List Price:  NZ$116.54
You save:  NZ$33.30
د.إ183.57
List Price:  د.إ257.02
You save:  د.إ73.44
৳5,499.56
List Price:  ৳7,699.83
You save:  ৳2,200.26
₹4,167.10
List Price:  ₹5,834.28
You save:  ₹1,667.17
RM236.60
List Price:  RM331.26
You save:  RM94.66
₦69,821.03
List Price:  ₦97,755.03
You save:  ₦27,934
₨13,934.82
List Price:  ₨19,509.87
You save:  ₨5,575.04
฿1,818.68
List Price:  ฿2,546.30
You save:  ฿727.62
₺1,611.24
List Price:  ₺2,255.86
You save:  ₺644.62
B$248.81
List Price:  B$348.35
You save:  B$99.54
R944.09
List Price:  R1,321.80
You save:  R377.71
Лв90.32
List Price:  Лв126.46
You save:  Лв36.13
₩67,464.25
List Price:  ₩94,455.35
You save:  ₩26,991.10
₪183.01
List Price:  ₪256.23
You save:  ₪73.22
₱2,812.31
List Price:  ₱3,937.46
You save:  ₱1,125.14
¥7,558.63
List Price:  ¥10,582.69
You save:  ¥3,024.06
MX$831.44
List Price:  MX$1,164.09
You save:  MX$332.64
QR182.70
List Price:  QR255.79
You save:  QR73.09
P686.44
List Price:  P961.07
You save:  P274.63
KSh6,573.68
List Price:  KSh9,203.68
You save:  KSh2,630
E£2,361.53
List Price:  E£3,306.33
You save:  E£944.80
ብር2,846.98
List Price:  ብር3,986
You save:  ብር1,139.02
Kz41,802.18
List Price:  Kz58,526.40
You save:  Kz16,724.22
CLP$49,007.19
List Price:  CLP$68,613.99
You save:  CLP$19,606.80
CN¥361.21
List Price:  CN¥505.72
You save:  CN¥144.51
RD$2,963.72
List Price:  RD$4,149.44
You save:  RD$1,185.72
DA6,734.30
List Price:  DA9,428.56
You save:  DA2,694.26
FJ$112.61
List Price:  FJ$157.67
You save:  FJ$45.05
Q390.88
List Price:  Q547.27
You save:  Q156.38
GY$10,492.79
List Price:  GY$14,690.75
You save:  GY$4,197.95
ISK kr6,908.11
List Price:  ISK kr9,671.91
You save:  ISK kr2,763.80
DH505.23
List Price:  DH707.37
You save:  DH202.13
L881.81
List Price:  L1,234.61
You save:  L352.79
ден2,838.22
List Price:  ден3,973.74
You save:  ден1,135.51
MOP$403.79
List Price:  MOP$565.34
You save:  MOP$161.54
N$947.89
List Price:  N$1,327.13
You save:  N$379.23
C$1,844.42
List Price:  C$2,582.33
You save:  C$737.91
रु6,678.27
List Price:  रु9,350.11
You save:  रु2,671.84
S/185.49
List Price:  S/259.70
You save:  S/74.21
K191.78
List Price:  K268.50
You save:  K76.72
SAR187.49
List Price:  SAR262.50
You save:  SAR75.01
ZK1,274.10
List Price:  ZK1,783.85
You save:  ZK509.74
L229.39
List Price:  L321.17
You save:  L91.77
Kč1,167.07
List Price:  Kč1,633.99
You save:  Kč466.92
Ft18,210.93
List Price:  Ft25,496.77
You save:  Ft7,285.83
SEK kr529.69
List Price:  SEK kr741.62
You save:  SEK kr211.92
ARS$42,828.93
List Price:  ARS$59,963.93
You save:  ARS$17,134.99
Bs347.51
List Price:  Bs486.54
You save:  Bs139.03
COP$194,817.51
List Price:  COP$272,760.10
You save:  COP$77,942.59
₡25,252.30
List Price:  ₡35,355.24
You save:  ₡10,102.94
L1,237.04
List Price:  L1,731.96
You save:  L494.91
₲368,282.43
List Price:  ₲515,624.88
You save:  ₲147,342.44
$U1,890.31
List Price:  $U2,646.58
You save:  $U756.27
zł199.06
List Price:  zł278.71
You save:  zł79.64
Already have an account? Log In

Transcript

Otherwise, welcome to the nn session of the API dot a tutorial for beginners. In this session, we will create a book using the Python. For this I am already installed the a Python and flask two, I will use the flask for creating the API. Here is a simple file that I was created. In this file I am going to create a root node true within the parentheses right to slurs Kelsey, which will listen for the push method equal to post define the Kelsey request a call to Request Lord to get underscore Jason right. Silent equal to true force equal to true and open the air is a from the requests for that try the dq door get there is an attendee our both parameter for that right the number one equal to reserved door yeah get Farah meters not yet number one and we need to convert it to the integer for that right the end it copied for the number two after these create variable names speech, which contain the text message, while they tried to you some off zero and one is to Lord formate within that when you do pass the parameter, it will be number one number two and the So for number one and number two that is created creator wherever have the response which contain the speech speech and the display tax.

Again it condemned the speech and converted to the Jason code right the array is equal to JSON dot DME and within that we need to pass the response. intent will be the fourth article today make the response in the response which contain the JSON data and change the content type of the art for that right dr dot headers and contain them equal to application for slash Jason, and return at the end, Savage. And now I'm going to teach in the local environment for that. Open the command prompt. Our app is shutting on the port number five, three below, copy the URL and paste in the postman write the Kelsey. And change to the POST requests and the body or the type Jason is the example and click on the Send.

Here we got the answer. After this, we need to deploy the app on the Google Cloud for this we need to create the additional file the first reason The app dot yamo file which we are created in previous lesson two. Let's switch to the folder, create a new file name app dot tmo. Open it with the sublime. Here we need to write the runtime will be the Python. And while mine will be the flex entry point will be g unicorn hyphen V and port number and specify the runtime config and specify the Python version three, sandwich and create a new file name record mine dot txt in which we need to specify the all the required actions done with the version, we require the flask of the 0.101 and G unicorn with the 19 point 6.0 sailboat file.

And now I am going to open the new command from from which we will perform the deployment. For this we need to write the G Cloud any we need to reinitialize the configuration so we can use the same account and same project and now, I'm going to write the G Cloud App deploy. It will ask to verify the services while we are going to deploy. It was the same so I am going to write the why. After some time it got the success message. Use the Browse command to open the our app in the browser.

For that, try the G Cloud App, browse and open the Kelsey route. Got the method is not allowed because it was a push method and we are sending the get request from the browser. Let's send why the postman here we got the same output let updated with the current fulfillment, seaweed and the same the same requests and here we got the sum of 10 2030 and now we will taste with the another value some of 90 and 70 we got the 160 which is the right answer. Let's see what we are learning this lesson. First of all, we created the route in the our Python file in which we perform the addition of those two numbers and return it as a Jason Then we created the app dot yamo file, in which we ask specify the PHP as a runtime and specify the three as a Python version.

We also created the requirement or txt file in which we ask ossify the flask and the G unicorn. Unlike the previous s and we use the G Cloud deploy command to deploy your application. Thanks for watching, have a nice day. If you have any doubt feel free to contact me

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.