So now that you know a bit more about
GET calls and how to approach tests of
them, I want to give you a hands-on
testing challenge. So in this video I'm
gonna introduce this find the secret
testing challenge, and we're gonna put
what we've been learning into practice.
There's nothing quite like doing
something for helping you to learn it. So
for this challenge you'll need to have
followed the instructions on the install
and set up the API challenges video, so
that you have everything ready to go. Aand
as I said this challenge is called find
the secret. So I'm gonna switch over to
the command prompt here, and if you
navigate to this directory at the
command prompt, and if you want to change
directories in a command prompt you can
just use CD and then put the directory
name and you'll change directories into
there. So we assume that you've changed
directories and you're in the directory
where you've checked out the challenge.
Now to start up the challenge we just
call node, and then we call the server
name that were interested in. So in this
case we're gonna do find the secret
server a s, and then we'll hit enter to
start that server up. And now we can see
it tells us it's running and it is set
up on localhost 3000. So we'll copy that,
and we'll take it over to Postman and
put it in Postman. And then I just want
to show you what I'm looking at here, so
we'll go to profile and we'll do slash
one, so we'll look at profile one, and
we'll send this request to the server
that we have, and you can see it returns
an unauthorized. So for this challenge
this profile is a hidden profile, you're
not authorized to see it, but there is a
way that you're able to still see it
even though you're not supposed to be
authorized. So for this challenge you
need to poke around at this API and try
and figure out what that way is. Now to
help you along the way there's some
documentation available, and it's on the
GitHub repository where you got the
challenges from. So on my username slash
API testing challenges, and if you scroll
down here there's some documentation. So
we can click on find the secret, and it
shows us the documentation that
available, tells us what the problem is
that we're trying to solve, and then
shows what routes we have available. So
you can do GET on blog posts on comments
and profiles, and as well as on
individual items for each of those. And
then there's also these relationship
items here, so you can do parameters as
we talked about in the last video, you
can embed comments here like this, you
can also expand use expand to include
parent resources. So with these commands
you should be able to find a way to get
that secret profile. In the next video,
we're going to walk through the solution
to this challenge and show you how I
went about solving it. But before you do
that really take the time, try this out,
try to figure it out because part of the
process of learning something is
actually trying it. So I'd really
encourage you don't just look at the
solution video without trying it first.
And when you're doing this, just use API
commands to figure it out, the you have
access of course of the server code and
stuff like that, but try just exploring
the API with the commands that you're
given in the documentation I showed, to
see if you can figure out a way to get
that hidden profile, have fun.