"roleId": "0000ffff0000000000000035"
}
],
"domainId": "0000ffff0000000000000090"
}, {
"id": "59f17f9e0e00001701000326",
"username": "max-schemamgr",
"password": "******",
"firstName": "firstName",
"lastName": "lastName",
"phoneNumber": "34343442234",
"accountStatus": "active",
"needsPasswordUpdate": false,
"roles": [{
"roleId": "0000ffff0000000000000033"
}
],
"domainId": "0000ffff0000000000000090"
}, {
"id": "59f17f6b120000eb00bf0d10",
"username": "max-sitemgr",
"password": "******",
"firstName": "firstName",
"lastName": "lastName",
"phoneNumber": "3838833838",
"accountStatus": "active",
"needsPasswordUpdate": false,
"roles": [{
"roleId": "0000ffff0000000000000032"
}
],
"domainId": "0000ffff0000000000000090"
}
]
}
Modifying Examples and Making Changes to the Fabric
In addition to being able to retrieve information about your Multi-Site environment using the REST API, you
can use it to make changes.
For instance, if instead of viewing the users, you create one in the GUI, you can then copy the call as an
example, modify it, and then use the modified call in your 3rd party script to create or update user accounts.
Below is a sample cURL command to create a user along with the XML POST contents:
curl "https://172.31.187.59/api/v1/users" -H "Origin: https://172.31.187.59" -H
"Accept-Encoding: gzip, deflate, br" -H "Accept-Language: en-US,en;q=0.9" -H "Authorization:
Bearer
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1Mzg3Njk1NzAsImlhdCI6MTUzODc2ODM3MCwiaXNzIjoiMThhNWM3MWNiNmM1NGMwNmFjNDIzYTI5ZWNiNWI5NzAiLCJ1c2VySWQiOiIwMDAwZmZmZjAwMDAwMDAwMDAwMDAwMjAiLCJ1c2VybmFtZSI6ImFkbWluIiwicGVybWlzc2lvbnMiOlsidmlldy1zaXRlcyIsIm1hbmFnZS1zaXRlcyIsInZpZXctdGVuYW50cyIsIm1hbmFnZS10ZW5hbnRzIiwidmlldy10ZW5hbnQtc2NoZW1hcyIsIm1hbmFnZS10ZW5hbnQtc2NoZW1hcyIsInZpZXctc2NoZW1hcyIsIm1hbmFnZS1zY2hlbWFzIiwidmlldy11c2VycyIsIm1hbmFnZS11c2VycyIsInZpZXctcm9sZXMiLCJtYW5hZ2Utcm9sZXMiLCJ2aWV3LWxhYmVscyIsIm1hbmFnZS1sYWJlbHMiLCJwbGF0Zm9ybS1sb2dzIiwiYmFja3VwLWRiIiwidmlldy1hbGwtYXVkaXQtcmVjb3JkcyIsIm1hbmFnZS1hdWRpdC1yZWNvcmRzIl19.CNs-nM3V73CBcYRBHqgfwtx3tAW5a9wsnMHqkKDGjDE"
-H "Content-Type: application/json" -H "Accept: application/json" -H "Referer:
https://172.31.187.59/users/create" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64;
x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" -H
"Connection: keep-alive" -H "DNT: 1" --data-binary
"^{^\^"lastName^\^":^\^"lastName^\^",^\^"needsPasswordUpdate^\^":true,^\^"username^\^":^\^"newUserName^\^",^\^"phoneNumber^\^":^\^"1234567890^\^",^\^"emailAddress^\^":^\^"email^@domain.com^\^",^\^"id^\^":^\^"^\^",^\^"firstName^\^":^\^"firstName^\^",^\^"confirmPassword^\^":^\^"passw0rd^#^\^",^\^"password^\^":^\^"passw0rd^#^\^",^\^"accountStatus^\^":^\^"active^\^",^\^"roles^\^":^[^{^\^"roleId^\^":^\^"0000ffff0000000000000031^\^"^},^{^\^"roleId^\^":^\^"0000ffff0000000000000032^\^"^}^]^}"
--compressed --insecure
And this is the contents of the POST call to create a user:
{
"id": "5bb7be240f00008206d3f137",
"username": "newUserName",
"password": "******",
Cisco Nexus Dashboard Orchestrator REST API Configuration Guide, Release 3.5(x)
24
Using the REST API
Using In-Browser DevTools to Work with REST API Calls