WEBVTT 00:02.510 --> 00:07.720 Now dead the rest of the scandal over application is completed before starting to be the single page 00:07.730 --> 00:08.340 front end. 00:08.350 --> 00:09.110 We have a future. 00:09.110 --> 00:09.540 Yes. 00:09.920 --> 00:15.200 I thought you'd be a good idea to show you how you can already use all the services provided by the 00:15.200 --> 00:17.740 application using postman. 00:17.810 --> 00:22.070 Postman is a powerful and complete API development environment. 00:22.070 --> 00:27.340 It's a professional client that you can use to communicate with and test your API. 00:27.710 --> 00:35.840 And it's very useful especially while developing its use by more than 200000 companies and I'm pretty 00:35.840 --> 00:38.770 sure you know more than a couple of them. 00:38.840 --> 00:44.580 We have PayPal Coursera Shopify Adobe Twitter and so on. 00:44.600 --> 00:50.960 One of the really great things about the rest api is and about the API first approach is that as we 00:50.960 --> 00:57.590 said we can use the rest and points to provide access from all sorts of different clients and so before 00:57.590 --> 01:00.570 starting to build that browser single page front end. 01:00.640 --> 01:07.040 We are not going to use that arrest API we've postman considering that we are also allowing token authentication 01:07.450 --> 01:09.710 if we have not used the postman so far. 01:09.750 --> 01:16.490 During the course is just because Django framework is so amazing that it provides us the browser able 01:16.550 --> 01:17.200 API. 01:17.360 --> 01:21.080 So it's not strictly needed for you to learn how to use post. 01:21.110 --> 01:27.870 However if you wish to you can click on get started and download the free version of the client. 01:27.920 --> 01:33.440 I am currently only Linux but of course you can find all the download links for your favorite operating 01:33.440 --> 01:40.230 system was installed open the program and you should find yourself in front of a very similar window. 01:40.250 --> 01:43.420 We are not going to use all of Postman's functionalities. 01:43.430 --> 01:47.330 They are really a lot and we simply don't need all of them. 01:47.330 --> 01:53.840 You should however know the basics of its interface as you can see are we have a text input that we 01:53.840 --> 01:58.010 can use to write down which we are real and point to to communicate with. 01:58.040 --> 02:03.560 Then we have a drop down menu where we can select the kind of age to request that we want to perform. 02:04.070 --> 02:06.390 Yeah we have a send button. 02:06.560 --> 02:12.420 A save button that you can use to save all the parameters of the request for later use usage. 02:12.420 --> 02:19.310 Then we can define several query parameters in a form like fashion let's say and we can select the type 02:19.310 --> 02:21.860 of authorization that we want to use. 02:21.860 --> 02:25.670 We can define the address for the request and the body. 02:25.670 --> 02:27.770 So first of all let's create an account. 02:27.790 --> 02:34.040 I'm going to make a post request and of course let's also grab the registration and bind them yet in 02:34.040 --> 02:37.010 the other Elsner by file of the project. 02:37.040 --> 02:45.180 I'm going to copy API the rest off registration and you also need of course to run the development server. 02:45.180 --> 02:49.110 So let's go back to postman going to past this year. 02:49.110 --> 02:52.700 And of course we also need the address of our development server. 02:52.840 --> 02:55.860 So specifically this one 03:00.390 --> 03:06.990 so we're going to make a post request to this and find and considering that we want to register an account. 03:07.080 --> 03:13.890 We will have to pass some data here you can choose how you want to send your data for example form data 03:14.520 --> 03:21.890 or maybe you need to send some binary data specifically we need to send a Jesus or a raw and yeah we 03:21.890 --> 03:23.630 select Jason. 03:23.760 --> 03:29.030 And yeah I'm going to paste a Jason like the one we've used in the previous lesson to register in your 03:29.030 --> 03:30.300 account of your arrest. 03:30.620 --> 03:39.090 So now let's press send it to actually send this post to request to our End Point the registration was 03:39.090 --> 03:44.460 successful and we know that because you are getting back are talking and we're going to need to authenticate 03:44.550 --> 03:53.300 all the other requests and using these token we can now make a GET request to another point of our application. 03:53.310 --> 03:58.630 So specifically we can get a list of all the questions in our database. 03:58.770 --> 04:05.880 We know the endpoint to be API is less questions so let's go back to postmen just going to paste these 04:06.450 --> 04:13.250 like so and from me I'm going to copy this part of the endpoint this way. 04:13.330 --> 04:19.600 So we want to make a GET request that we know that we need to be authorized to actually retrieve some 04:19.600 --> 04:20.670 data from this endpoint. 04:20.680 --> 04:22.000 So let's go to. 04:22.200 --> 04:35.730 And yet we can write authorization India token space and we just copy and paste this token so Sandor 04:36.780 --> 04:40.520 as you can see we have not clearly answer any questions yet. 04:40.790 --> 04:44.180 And that's because of course we are logged in. 04:44.420 --> 04:56.220 We have a newly created account so Excel API user just going to copy the other like so authorization. 04:56.730 --> 04:57.210 And that is 05:00.740 --> 05:07.660 authorization so Sander and of course love Dean as rest test. 05:07.760 --> 05:15.500 So let's answer the first question let's make it post request. 05:15.600 --> 05:21.020 Define Yeah there's so and. 05:21.130 --> 05:29.190 Of course authorization it's no go to Buddy row type Jason. 05:29.370 --> 05:35.140 And we know that we need content first. 05:35.310 --> 05:49.080 That's where we arrest all cups so we know the end point to be closed API then questions. 05:49.440 --> 05:55.440 Then we need of course the slug of the question that we want to answer 05:58.080 --> 06:01.240 paste and then what is the answer. 06:01.410 --> 06:07.680 So let's send disposed to request with discontent as Jason said. 06:07.960 --> 06:11.470 And actually the field was called Body not content. 06:11.510 --> 06:15.320 So send it and we have now answered the question. 06:15.350 --> 06:21.560 So if we make another get request here we now get user s answered true. 06:21.860 --> 06:28.850 As you can see postman is a very powerful tool and more importantly everything in the rest api is working 06:28.970 --> 06:30.320 as expected. 06:30.320 --> 06:32.660 Even using token authentication. 06:32.660 --> 06:37.820 So in the next lesson we can finally start to develop the front end aspects of our application.