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 response with parameters - REST Tutorial
From the course: Introduction to Web APIs
Filter response with parameters
- [Instructor] Okay, time to get more specific. Let's get random GIFs of something we're really interested in. For me, that's going to be squirrels. Some see them as pest, some, me, see them as adorable little acrobats. Let's look at the documentation for the random endpoint. It describes the parameters available for this endpoint. Again, the documentation for any API should clearly explain the available parameters, what they do, and examples of how to use them. We have the API key, the tag, and rating, and the docs do a good job of showing how to use them. We're not going to be using the ID parameter. Then the documentation also shows us an example of a successful response that we saw earlier and we see how we get the data object and the med object. Okay, let's go into our code and add the tag parameter so we can filter the type of random GIFs we get. Remember, we already had the question mark to denote parameters,…
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)
Authentication with an API key4m 42s
-
(Locked)
Make a request to the Giphy API4m 13s
-
(Locked)
Filter response with parameters2m 9s
-
(Locked)
Access data in the response2m 2s
-
(Locked)
Use the response data in HTML1m 15s
-
(Locked)
Challenge: Explore the Giphy API1m 24s
-
(Locked)
Solution: Explore the Giphy API1m 50s
-
(Locked)
-
-
-