1 00:00:00,539 --> 00:00:02,370 So now that you know a bit more about 2 00:00:02,370 --> 00:00:04,230 GET calls and how to approach tests of 3 00:00:04,230 --> 00:00:05,490 them, I want to give you a hands-on 4 00:00:05,490 --> 00:00:08,160 testing challenge. So in this video I'm 5 00:00:08,160 --> 00:00:10,290 gonna introduce this find the secret 6 00:00:10,290 --> 00:00:12,600 testing challenge, and we're gonna put 7 00:00:12,600 --> 00:00:13,760 what we've been learning into practice. 8 00:00:13,760 --> 00:00:16,260 There's nothing quite like doing 9 00:00:16,260 --> 00:00:18,510 something for helping you to learn it. So 10 00:00:18,510 --> 00:00:20,039 for this challenge you'll need to have 11 00:00:20,039 --> 00:00:22,199 followed the instructions on the install 12 00:00:22,199 --> 00:00:25,320 and set up the API challenges video, so 13 00:00:25,320 --> 00:00:26,880 that you have everything ready to go. Aand 14 00:00:26,880 --> 00:00:29,160 as I said this challenge is called find 15 00:00:29,160 --> 00:00:31,619 the secret. So I'm gonna switch over to 16 00:00:31,619 --> 00:00:33,119 the command prompt here, and if you 17 00:00:33,119 --> 00:00:36,269 navigate to this directory at the 18 00:00:36,269 --> 00:00:38,519 command prompt, and if you want to change 19 00:00:38,519 --> 00:00:40,319 directories in a command prompt you can 20 00:00:40,319 --> 00:00:42,749 just use CD and then put the directory 21 00:00:42,749 --> 00:00:45,600 name and you'll change directories into 22 00:00:45,600 --> 00:00:48,179 there. So we assume that you've changed 23 00:00:48,179 --> 00:00:50,159 directories and you're in the directory 24 00:00:50,159 --> 00:00:51,299 where you've checked out the challenge. 25 00:00:51,299 --> 00:00:53,609 Now to start up the challenge we just 26 00:00:53,609 --> 00:00:56,699 call node, and then we call the server 27 00:00:56,699 --> 00:00:59,069 name that were interested in. So in this 28 00:00:59,069 --> 00:01:02,100 case we're gonna do find the secret 29 00:01:02,100 --> 00:01:05,879 server a s, and then we'll hit enter to 30 00:01:05,879 --> 00:01:07,860 start that server up. And now we can see 31 00:01:07,860 --> 00:01:10,410 it tells us it's running and it is set 32 00:01:10,410 --> 00:01:14,910 up on localhost 3000. So we'll copy that, 33 00:01:14,910 --> 00:01:18,770 and we'll take it over to Postman and 34 00:01:18,770 --> 00:01:22,110 put it in Postman. And then I just want 35 00:01:22,110 --> 00:01:24,600 to show you what I'm looking at here, so 36 00:01:24,600 --> 00:01:29,070 we'll go to profile and we'll do slash 37 00:01:29,070 --> 00:01:31,290 one, so we'll look at profile one, and 38 00:01:31,290 --> 00:01:34,410 we'll send this request to the server 39 00:01:34,410 --> 00:01:35,880 that we have, and you can see it returns 40 00:01:35,880 --> 00:01:38,640 an unauthorized. So for this challenge 41 00:01:38,640 --> 00:01:42,000 this profile is a hidden profile, you're 42 00:01:42,000 --> 00:01:44,130 not authorized to see it, but there is a 43 00:01:44,130 --> 00:01:46,770 way that you're able to still see it 44 00:01:46,770 --> 00:01:48,030 even though you're not supposed to be 45 00:01:48,030 --> 00:01:49,800 authorized. So for this challenge you 46 00:01:49,800 --> 00:01:51,480 need to poke around at this API and try 47 00:01:51,480 --> 00:01:54,510 and figure out what that way is. Now to 48 00:01:54,510 --> 00:01:56,640 help you along the way there's some 49 00:01:56,640 --> 00:02:00,030 documentation available, and it's on the 50 00:02:00,030 --> 00:02:02,190 GitHub repository where you got the 51 00:02:02,190 --> 00:02:05,010 challenges from. So on my username slash 52 00:02:05,010 --> 00:02:08,008 API testing challenges, and if you scroll 53 00:02:08,008 --> 00:02:10,619 down here there's some documentation. So 54 00:02:10,619 --> 00:02:12,568 we can click on find the secret, and it 55 00:02:12,568 --> 00:02:14,460 shows us the documentation that 56 00:02:14,460 --> 00:02:16,680 available, tells us what the problem is 57 00:02:16,680 --> 00:02:18,210 that we're trying to solve, and then 58 00:02:18,210 --> 00:02:19,920 shows what routes we have available. So 59 00:02:19,920 --> 00:02:22,680 you can do GET on blog posts on comments 60 00:02:22,680 --> 00:02:24,540 and profiles, and as well as on 61 00:02:24,540 --> 00:02:26,850 individual items for each of those. And 62 00:02:26,850 --> 00:02:29,190 then there's also these relationship 63 00:02:29,190 --> 00:02:32,430 items here, so you can do parameters as 64 00:02:32,430 --> 00:02:33,810 we talked about in the last video, you 65 00:02:33,810 --> 00:02:37,710 can embed comments here like this, you 66 00:02:37,710 --> 00:02:40,920 can also expand use expand to include 67 00:02:40,920 --> 00:02:44,550 parent resources. So with these commands 68 00:02:44,550 --> 00:02:46,710 you should be able to find a way to get 69 00:02:46,710 --> 00:02:49,920 that secret profile. In the next video, 70 00:02:49,920 --> 00:02:52,740 we're going to walk through the solution 71 00:02:52,740 --> 00:02:54,510 to this challenge and show you how I 72 00:02:54,510 --> 00:02:56,520 went about solving it. But before you do 73 00:02:56,520 --> 00:02:58,620 that really take the time, try this out, 74 00:02:58,620 --> 00:03:00,600 try to figure it out because part of the 75 00:03:00,600 --> 00:03:02,130 process of learning something is 76 00:03:02,130 --> 00:03:03,900 actually trying it. So I'd really 77 00:03:03,900 --> 00:03:06,390 encourage you don't just look at the 78 00:03:06,390 --> 00:03:08,580 solution video without trying it first. 79 00:03:08,580 --> 00:03:11,610 And when you're doing this, just use API 80 00:03:11,610 --> 00:03:13,350 commands to figure it out, the you have 81 00:03:13,350 --> 00:03:15,300 access of course of the server code and 82 00:03:15,300 --> 00:03:17,580 stuff like that, but try just exploring 83 00:03:17,580 --> 00:03:19,860 the API with the commands that you're 84 00:03:19,860 --> 00:03:21,780 given in the documentation I showed, to 85 00:03:21,780 --> 00:03:23,130 see if you can figure out a way to get 86 00:03:23,130 --> 00:03:28,130 that hidden profile, have fun.