From the course: Introduction to Web APIs
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Filter the response with parameters - REST Tutorial
From the course: Introduction to Web APIs
Filter the response with parameters
- [Instructor] The base URL allows us to connect to the API and get a response full of data, but we can filter that data using parameters. You really can think of parameters just like filters use all the time on websites. The API's documentation should provide you with the parameters or options available to you. Typically, the options allow you to narrowly specify the data you get or organize the way you get the data. Let's look at the H+Sports documentation to see the parameters and what they do. The first parameter here is quantity or QTY. It says we can use any integer value to reduce the number of products we get in our response. We can also set how the products are ordered. ID is the default that we've seen, but it could be name or description or by price. There's an ID parameter so we can select a very specific product. We can sort the products by ascending or descending order. And there's also page and format…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
API documentation2m 23s
-
(Locked)
Make a request to the API2m 36s
-
(Locked)
Filter the response with parameters3m 54s
-
(Locked)
Access data in the response2m 38s
-
(Locked)
Use the response data in HTML1m 47s
-
(Locked)
Loop through the response data4m 28s
-
(Locked)
Challenge: Display data on a webpage42s
-
(Locked)
Solution: Display data on a webpage1m 41s
-
(Locked)
-
-
-
-