DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

GET calls, the redirect is specified through a 302 status
code, and for any non-GET calls, the redirects are
specified with 307 or 308 status codes. When you specify
the -I option for curl, only the headers of the response
are displayed to the user. At this point, you need to run
the curl command again but this time specify the
resource as
https://n149.meraki.com/api/v0/organizations, remove
the -I flag, and add an Accept header to specify that the
response to the call should be in JSON format. The
command should look like this:


Click here to view code image


curl -X GET \
--url
'https://n149.meraki.com/api/v0/organizations' \
-H 'X-Cisco-Meraki-API-Key:
15da0c6ffff295f16267f88f98694cf29a86ed87'\
-H 'Accept: application/json'

The response in this case contains the ID of the DevNet
Sandbox organization in JSON format:


Click here to view code image


[
{
"name" : "DevNet Sandbox",
"id" : "549236"
}
]

Now let’s look at how you can obtain the organization ID
for the Cisco DevNet Sandbox Meraki account by using
Postman. As mentioned in Chapter 7, Postman is a
popular tool used to explore APIs and create custom
requests; it has extensive built-in support for different
authentication mechanisms, headers, parameters,
collections, environments, and so on. By default,

Free download pdf