Alright friends, so let's walk through the solution name.
So the first thing I will do is to load up Postman,
and I will go and create a new request, okay?
So here we go.
So the very first thing that I'm going to have to do
is I'm going to have to log in, and I will do this
by going to the DevNet Sandbox address.
And the actual end point is going to be
J_security_check as we saw within the skill.
Now remember, the actual method I'm going to have to use here
is going to be a post request.
And at this point here, I'm going to have to go to the body,
make sure it's x www.form_urlencoded. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
make sure it's x www.form_urlencoded.
And the key here is going to be J_userName.
And the value right now is going to be DevNet user.
And the password will be J_password.
And as we saw within the skill, the current password,
as I recorded, is this right here.
Now I'm going to go to the headers tab.
I'll say the content type, and I'll give it the value
of application, and I'll say x www.form_urlencoded.
And now I will send off this particular request.
So now I get this OK as we see within the headers down here. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So now I get this OK as we see within the headers down here.
I'm going to have the cookie set.
Because of this, like I say, when it comes to creating
a new request, as we can do right here,
the cookies should be stored automatically
via postman as we can see right here.
So if that's now done, we want to now get the CSRF token.
Now this time, the end point is going to be
forward slash data service, forward slash client,
forward slash token as we saw within the skill.
The method this time is going to be a get request,
not a post request.
As we know, the cookie will automatically be set
via postman, so we don't have to worry about this. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
via postman, so we don't have to worry about this.
So if I just hit sends, I'm going to get back
this particular token, so I'll just copy this right here,
and now I'll create my new request.
Now remember for the actual request,
the target endpoint is going to be data service,
device, statistics, we want to consult a documentation
to ensure we use the correct HTTP method.
So the first thing I will do is put in this endpoint
of device statistics, or device stats, should I say.
So let's go to the documentation,
like this link here.
If we go to the API reference, as we saw within the skill,
we're going to say forward slash data service. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
we're going to say forward slash data service.
We already know this, but what we're looking for
is if I just search for forward slash device,
here we have it right here, this is going to be
a get request we have to send.
So let's go back to postman.
For this particular request, let's go to our headers.
What we're going to say here is X, XSRF, token,
and then I'm going to paste in that token value
we just got.
As we know, the cookies should still already be saved
within postman, makes things a little bit easier for us.
And if I now hit send, we actually do get a successful
request for device statistics. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
request for device statistics.
Okay, moving on.
So the next thing we're going to do is to connect
to the DevNet Always on Sandbox for Catalyst Center
and return information about sites within Catalyst Center.
To do this, we're going to have to consult the documentation.
So the first thing we'll do is create a new request.
Here we go.
Remember, the first time we're going to have to do
is to get that token.
So what I will do is type in the address of the DevNet
Sandbox for DNA Center and then target the
auth token endpoint.
We're going to then set the authorization to be
basic authentication.
And the username right now is DevNet user WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the username right now is DevNet user
and the password is Cisco 123 exclamation mark.
As we can see right here.
Let's go to the headers.
We'll see the content type.
It's going to be application forward slash JSON.
And we're going to make sure that this is a
post request, remember.
So if we click send, now we get our token.
So let's copy all of this.
Now, before we go any further, we're going to have to
target the sites within Catalyst Center.
To do this, we're going to consult the documentation.
So let's check this out.
So if we search for Catalyst Centers Rest API Docs, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So if we search for Catalyst Centers Rest API Docs,
let's go and click this link here.
Now, then the left hand side, we're going to try to find
information relating to sites.
And we can see this option here.
So let's click this.
And now as we know, we can go and look at the end points
and methods used.
So we have these particular options.
So any combination of these is going to be quite just fine.
In my case here, let's keep it quite simple.
Let's just get information by targeting this.
This particular end point with the get request.
So we've got a new request once again.
There is a DevNet URL.
And let's just add on what we got from the documentation. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And let's just add on what we got from the documentation.
Just copy you and make sure we set it to a get request,
which is what we can see right here.
Now in the headers here, remember what we're going to
have to specify.
We're going to say X of token.
And then paste in the value of this token right here.
So paste you in.
Now, if this is now done, I should be able to send off
the request.
And as we can see here, we get the 200 response coming back
to us right there.
Now very briefly, if you wanted to do this via Python,
well, what you could have done is actually
kind of cheated a little bit. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
kind of cheated a little bit.
And if we just reuse the same scripts that we had within
the scale, but make slight modifications, let's go in here.
So say for example, this one for DNA sensor,
we go through the same process, provide the username
password with basic authentication, get our token,
and then pass in the token to the header of X of token.
Only difference is that the end point here is going to change.
So if I just change this here to the information that we got
right there, and just delete this portion here and just say
print the result.
If I save this and I run the script, as we can see right here, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
If I save this and I run the script, as we can see right here,
we do get a valid response.
Similarly, if I go back and modify my SD1 script,
let me get copy of this one here.
Same thing we saw before, we get the authentication cookie,
we get this ESRF token, pass in with this header.
The only difference here is we're going to modify this
particular end point to be stats.
So save this, Python 3, script 3, top py,
and as we can see, we get a response.
So friends, that is us for our validation challenge.
I hope it's been informative for you, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I hope it's been informative for you,
and I'd like to thank you for viewing.