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

(andrew) #1

Figure 8-2 GET Networks REST API Call in
Postman


The body of the response contains exactly the same
information as before: a complete list of all the networks
that are part of the DevNet Sandbox organization.


Next, you can obtain a list of all devices that are part of
the network that has the name “DevNet Always On Read
Only” and ID L_646829496481099586. Much as in the
previous steps, you start by checking the API
documentation to find the API endpoint that will return
this data to you. The API resource that contains the
information you are looking for is
/networks/{networkId}/devices, as you can see from the
API documentation at the following link:
https://developer.cisco.com/meraki/api/#/rest/api-
endpoints/devices/get-network-devices. You add the
base URL for the DevNet Sandbox account,
https://n149.meraki.com/api/v0, and populate
{networkId} with the value you obtained in the previous
step. Combining all this information, the endpoint that
will return the information you are seeking is
https://n149.meraki.com/api/v0/networks/L_6468294
96481099586/devices. The curl command in this case is
as follows:


Click here to view code image


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

And the response from the API should be similar to the
one in Example 8-3.

Free download pdf