Asset Manager API to Manage Users

The Users resource in the REST API allows you to operate on users. This resource supports listing, creating, deleting, and modifying users.

The user object

Attribute Type Description
id integer Globally unique identifier of each user. Each user is given an id automatically
name string(40) Log in name of the user. This is how user will log in to CLI/GUI
fullName string(40)

Full ame of the user. This is a descriptive property of the user.

superuser boolean If set to true, this is what grants superuser privileges

List of users

  • Returns a list of all users for the Asset Manager box

  • HTTP Request

  • GET /api/rest/management/users

curl -k -v "https://Asset Manager_CC_IP/api/rest/management/users?fmt=json" \
-H "Authorization: Bearer API-KEY"

URL Params (optional): fmt={json | xml}

Show fields of a user

  • Returns fields of a single user

  • HTTP Request

  • GET /api/rest/management/user/{user_name}

  • where user_name = name of the user

curl -k -v "https://Asset Manager_CC_IP/api/rest/management/user/username?fmt=json" \
-H "Authorization: Bearer API-KEY"

URL Params (optional): fmt={json | xml}

Create a new user

  • HTTP Request

  • POST /api/rest/management/user/add

curl https://Asset Manager_CC_IP/api/rest/management/user/add \
-X POST \
-H "Authorization: Bearer API-KEY" \
-H 'Content-Type: application/xml' \
-d '<addUser_request><user><name>testUser</name><fullName>API Test User</fullName><password>abcd.123</password><superuser>{true}</superuser><roles><role><name>Manager</name><organization><name>Organization1</name></organization></role></roles></user></addUser_request>'

Modify fields of a user

  • HTTP Request

  • POST /api/rest/management/user/update

curl https://Asset Manager_CC_IP/api/rest/management/user/update\
-X POST \
-H "Authorization: Bearer API-KEY" \
-H 'Content-Type: application/xml' \
-d '<updateUser_request><user><name>testUser</name><fullName>API Test User Update</fullName><password>abcd.123</password><superuser>{false}</superuser><roles><role><name>Viewer</name><organization><name>Organization1</name></organization></role></roles></user></updateUser_request>'

Delete a user

  • HTTP Request

  • DELETE /api/rest/management/user/{user_name}

curl -k -v "https://Asset Manager_CC_IP/api/rest/management/user/username" \
-H "Authorization: Bearer API-KEY"

Create API Key for a user

  • Returns the API key requested for the given user.

  • HTTP Request

  • GET /api/rest/management/user/{user_name}/apikey?create=true

curl -k -v "https://Asset Manager_CC_IP/api/rest/management/user/username/apikey?fmt=json|xml?create=tr" \
-H "Authorization: Bearer API-KEY"   

URL Params (optional): fmt={json | xml}

Enable API Key for a user

  • HTTP Request

  • GET /api/rest/management/user/{user_name}/apikey?enable=true

Note: Make sure that the API key has been generated for the user before one can enable or disable the key.

 curl -k -v https://Asset Manager_CC_IP/api/rest/management/user/fa/apikey?enable=true -k \
-H "Authorization: Bearer API-KEY"

Disable API Key for a user

  • HTTP Request

  • GET /api/rest/management/user/{user_name}/apikey?enable=false

Note: Make sure that the API key has been generated for the user before one can enable or disable the key.

curl -k -v https://Asset Manager_CC_IP/api/rest/management/user/fa/apikey?enable=false -k \
-H "Authorization: Bearer API-KEY"

Delete API Key for a user

  • Deletes the API key requested for the given user.

  • HTTP Request

  • DELETE /api/rest/management/user/{user_name}/apikey

curl -k -v "https://Asset Manager_CC_IP/api/rest/management/user/username?apikey" \
-H "Authorization: Bearer API-KEY"

URL Params (optional): fmt={json | xml}