Use API to retrieve data

4 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
€43.95
List Price:  €61.54
You save:  €17.58
£37.68
List Price:  £52.76
You save:  £15.07
CA$69.19
List Price:  CA$96.87
You save:  CA$27.68
A$78.24
List Price:  A$109.55
You save:  A$31.30
S$65.52
List Price:  S$91.73
You save:  S$26.21
HK$388.09
List Price:  HK$543.37
You save:  HK$155.27
CHF 40.91
List Price:  CHF 57.28
You save:  CHF 16.36
NOK kr523.52
List Price:  NOK kr732.97
You save:  NOK kr209.45
DKK kr328.20
List Price:  DKK kr459.51
You save:  DKK kr131.30
NZ$83.68
List Price:  NZ$117.16
You save:  NZ$33.48
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.45
৳6,070.18
List Price:  ৳8,498.75
You save:  ৳2,428.56
₹4,268.32
List Price:  ₹5,975.99
You save:  ₹1,707.67
RM220.33
List Price:  RM308.48
You save:  RM88.15
₦80,142.96
List Price:  ₦112,206.56
You save:  ₦32,063.60
₨14,016.83
List Price:  ₨19,624.68
You save:  ₨5,607.85
฿1,667.01
List Price:  ฿2,333.95
You save:  ฿666.94
₺1,900.62
List Price:  ₺2,661.02
You save:  ₺760.40
B$290.34
List Price:  B$406.50
You save:  B$116.16
R940.86
List Price:  R1,317.28
You save:  R376.42
Лв86.05
List Price:  Лв120.48
You save:  Лв34.42
₩70,905.31
List Price:  ₩99,273.11
You save:  ₩28,367.80
₪184.26
List Price:  ₪257.98
You save:  ₪73.72
₱2,834.15
List Price:  ₱3,968.04
You save:  ₱1,133.89
¥7,118.22
List Price:  ¥9,966.07
You save:  ¥2,847.85
MX$985.77
List Price:  MX$1,380.15
You save:  MX$394.38
QR182.09
List Price:  QR254.95
You save:  QR72.85
P688.64
List Price:  P964.16
You save:  P275.51
KSh6,481.70
List Price:  KSh9,074.90
You save:  KSh2,593.20
E£2,555.83
List Price:  E£3,578.37
You save:  E£1,022.53
ብር6,649.85
List Price:  ብር9,310.32
You save:  ብር2,660.47
Kz45,790.84
List Price:  Kz64,110.84
You save:  Kz18,320
CLP$48,373.32
List Price:  CLP$67,726.52
You save:  CLP$19,353.20
CN¥364.71
List Price:  CN¥510.63
You save:  CN¥145.91
RD$2,996.39
List Price:  RD$4,195.18
You save:  RD$1,198.79
DA6,631.10
List Price:  DA9,284.08
You save:  DA2,652.97
FJ$114.26
List Price:  FJ$159.98
You save:  FJ$45.71
Q384.82
List Price:  Q538.79
You save:  Q153.96
GY$10,480.73
List Price:  GY$14,673.87
You save:  GY$4,193.13
ISK kr6,379.22
List Price:  ISK kr8,931.42
You save:  ISK kr2,552.20
DH463.38
List Price:  DH648.77
You save:  DH185.39
L864.30
List Price:  L1,210.09
You save:  L345.79
ден2,707.45
List Price:  ден3,790.66
You save:  ден1,083.20
MOP$399.43
List Price:  MOP$559.24
You save:  MOP$159.80
N$942.65
List Price:  N$1,319.79
You save:  N$377.13
C$1,838.38
List Price:  C$2,573.88
You save:  C$735.50
रु6,823.79
List Price:  रु9,553.85
You save:  रु2,730.06
S/186.18
List Price:  S/260.67
You save:  S/74.48
K206.62
List Price:  K289.28
You save:  K82.66
SAR187.56
List Price:  SAR262.60
You save:  SAR75.04
ZK1,422.63
List Price:  ZK1,991.80
You save:  ZK569.16
L218.84
List Price:  L306.39
You save:  L87.55
Kč1,101.73
List Price:  Kč1,542.51
You save:  Kč440.78
Ft17,951.23
List Price:  Ft25,133.16
You save:  Ft7,181.93
SEK kr480.92
List Price:  SEK kr673.33
You save:  SEK kr192.40
ARS$56,887.12
List Price:  ARS$79,646.52
You save:  ARS$22,759.40
Bs345.25
List Price:  Bs483.39
You save:  Bs138.13
COP$215,093.33
List Price:  COP$301,147.88
You save:  COP$86,054.54
₡25,108.46
List Price:  ₡35,153.86
You save:  ₡10,045.39
L1,295.18
List Price:  L1,813.35
You save:  L518.17
₲399,918.13
List Price:  ₲559,917.39
You save:  ₲159,999.25
$U2,116.99
List Price:  $U2,963.96
You save:  $U846.96
zł188.07
List Price:  zł263.31
You save:  zł75.24
Already have an account? Log In

Transcript

Hello guys. Welcome to the 34th session of using Microsoft mood framework and cognitive services tutorials for beginners. In this session we will learn how to use news api.js API to retrieve news as per user entity in a trance and create a car. Let us switch to the studio. Here I have already created a new helper class using which will retrieve data and create a hero card. Here are model classes that require to retrieve data from API's.

I have created it from response generated by this API. Each response contains multiple articles. And each article has a source author, title, description, URL, image URL, publisher. And here is a method in which I'm generating attachment from New Article, which includes title, subtitle, image and button and create a method which takes contacts key and an integer value that indicates maximum cost to be displayed in this message. Use make message method to create a new message from context. Change Layout to carousel, generate URL for APA and describe it using the client and then deserialize it to news response.

After this, we are a look through and add each attachment to this message. In case of exception second error message to text and return this message. This record is same as above one, just add source name in the parameter and based on these generate URL for APA again same for this method to here I'm retrieving news based on the query that you sent us. Let's update our Lewis dialogue. So that integrates a result of this hyper First of all, add this hyper namespace. Create a static variable that holds a PhD in displaying data, use get headlines method, pass context T and number of cards.

In sources intend to use get news from source method. Past context key and Sozzani saving topical intent you use get news for topic method. Here pass query that uses under let's say we can run it create a new conversation, let Assange display only 10 cards. Here we got a look at containing 10 attachments. Each of them includes an image and link to the page. Letter sign display only two cards.

Here we got only two attachments. So it works as per our expectations. Now, I am going to return data based on the sources. So right show news from DC that all news is retrieved from TechCrunch that is try query based on topic to some recent news of Microsoft Hear all news are related to Microsoft. And now saying trading off Facebook. It includes all research related to Facebook.

Here is a first note that we have created which performs some real life operation. Let's see what we have learned in this session. Here we have used news API helper and obtain a car from it. We have passed contracts to static methods of this class, in which we have created a new message from context and we retrieve data from APA. And we also created attachments based on the response we caught and we return it at the end. Thanks for watching this video.

If you have any doubts, feel free to contact me Have a nice day.

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.