User Management

User Management APIs are used to create and manage users in the Arista server.

JSON Table

Attribute Data Type Description
userId long System-generated unique ID for the user.
langId int The language selected by the user. All data on the AMC UI will be displayed in this language. Currently, the supported language is ENGLISH and the ID assigned to it is 0.
customerId long System-generated customer ID for an Mojo Cloud Services user account.
defaultPassword boolean This attribute is for future use. The default value is false.
loginId String Login ID of the user.
firstName String The first name of the user.
lastName String The last name of the user.
email String Email ID of the user.
role String Role assigned to the user account. The applicable values are:

  • VIEWER
  • OPERATOR
  • ADMINISTRATOR
  • SUPERUSER
timeZone String Time zone configured for the user account.
timeZonOffSetInMins int Time zone offset from UTC (in mins).
fontPref String Whether the system must support English-only or multi-byte characters. The applicable values are ENGLISH_ONLY and MULTILINGUAL.
passwdSettings application/json Password settings for the user.
passwdSettings/passwordExpires boolean A true or false value indicating that the password for this user can expire. If set to true, the ExpiryDateTime and ExpiryDaysInterval fields must be configured.
passwdSettings/passwordExpiryDateTime long Date and time when the password will expire.
passwdSettings/passwordExpiryDaysInterval long Number of days after which the password will expire.
passwdSettings/passwordExpiryWarningDays int If the password will expire, the number of days by which the user wil be shown a warning for password expiry.
logoutInterval int Minutes after which the user’s UI login session will expire.
allowedLocations application/json List of locations that the user can access.
allowedLocations/type String Location type. The only acceptable value is locallocationid.
allowedLocations/id int System-generated unique ID of the location.
userLockedState String Applicable values are:

  • NOT_LOCKED – User is not locked.
  • USER_LOCKED – User account has been locked.
  • USER_LOCKED_CUSTOMER – User account has been locked because the corresponding customer account has been locked.
userType String User type. The applicable values are:

  • LOCAL – username and password configured on the AMC server are used for logging in.
  • LDAP – LDAP authentication is used for logging in.
  • RADIUS – radius server authentication is used for logging in.
  • API – key ID-value pair as defined in Mojo One/Mojo Launchpad is used for logging in.
allowAccessMgmt boolean A true or false value indicating whether the user has access to the Wi-Fi management functionality.
allowSecurityMgmt boolean A true or false value indicating whether the user has access to the WIPS management functionality.
temporaryLockDateTime long Duration for which the user account is temporarily locked due to incorrect login attempts.
serviceOrSupportUser boolean For internal use only.
userLanguage application/json Language details of the user.
userLanguage/langId int System-generated unique ID for the user language.
userLanguage/langCode String Language-specific display labels fetched from the property files. For example, en for English, ja for Japanese, zh for Chinese, etc.
userLanguage/name String Display name of the user language.
userLanguage/systemLanguage boolean A true or false value indicating whether the specified language is defined in the system. True indicates that the language is a system language.
userLanguage/supported boolean A true or false value indicating whether the specified language is configured for the user in the AMC server.
userLanguage/defaultLanguage boolean A true or false value indicating whether the language is a default language for the user. If the user is created without assigning a language, the default language is used.
userLanguage/countryCode String Country code associated with the user language. For example, US for English, CN for China, TW for Taiwan, etc.
passwordChangeEnforced boolean Whether the user must change password.
userDefinedFields application/json A list of JSON values that include the name-value pairs of custom fields defined for a user.

Copy Sample JSON
Sample JSON
{
   "userId":1,
   "langId":0,
   "customerId":-1,
   "defaultPassword":false,
   "loginId":"admin",
   "firstName":"System",
   "lastName":"Superuser",
   "email":"",
   "role":"SUPERUSER",
   "timeZone":"America/New_York",
   "timezonOffSetInMins":0,
   "fontPref":"ENGLISH_ONLY",
   "passwdSettings":{
       "passwordExpires":false,
       "passwordExpiryDateTime":0,
       "passwordExpiryDaysInterval":365,
       "passwordExpiryWarningDays":15
   },
   "logoutInterval":-1,
   "allowedLocations":[{
        "type":"locallocationid",
        "id":0
   }],
   "userLockedState":"NOT_LOCKED",
   "userType":"LOCAL",
   "allowAccessMgmt":true,
   "allowSecurityMgmt":true,
   "temporaryLockDateTime":0,
   "serviceOrSupportUser":false
   "userLanguage": {
        "langId": 0,
        "langCode": "en",
        "name": "English",
        "systemLanguage": true,
        "supported": true,
        "defaultLanguage": true,
        "countryCode": "US"
   },
   "passwordChangeEnforced": false,
   "userDefinedFields":null
},
{
   "userId":2,
   "langId":0,
   "customerId":10,
   "defaultPassword":false,
   "loginId":"test",
   "firstName":"test",
   "lastName":"test",
   "email":"test@test.com",
   "role":"POWERUSER",
   "timeZone":"America/New_York",
   "timezonOffSetInMins":0,
   "fontPref":"ENGLISH_ONLY",
   "passwdSettings":{
       "passwordExpires":false,
       "passwordExpiryDateTime":0,
       "passwordExpiryDaysInterval":60,
       "passwordExpiryWarningDays":15
    },
    "logoutInterval":-1,
    "allowedLocations":[{
            "type":"locallocationid",
            "id":13
    }],
    "userLockedState":"NOT_LOCKED",
    "userType":"LOCAL",
    "allowAccessMgmt":true,
    "allowSecurityMgmt":true,
    "temporaryLockDateTime":0,
    "serviceOrSupportUser":false
    "userLanguage": {
        "langId": 0,
        "langCode": "en",
        "name": "English",
        "systemLanguage": true,
        "supported": true,
        "defaultLanguage": true,
        "countryCode": "US"
    },
    "passwordChangeEnforced": false,
    "userDefinedFields":null
}
API Calls

V5/users

V5/users/customfields

V5/users/current

/V3/users/features

V5/users

V5/users

V5/users/ownpassword

V5/users/{userid}

Get Users

Description Retrieves the list of all the users created in the Arista Server. If you are an Arista Cloud Services customer, then this API call retrieves the list of all the users created in the customer account.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/users
Sample code
GET https://training.mojonetworks.com/new/webservice/V5/users
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the list of users. The response is in the application/json format.

Get Custom Fields for Users

Description Retrieves custom fields for users.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/users/customfields
Sample code
GET https://training.mojonetworks.com/new/webservice/v3/users/customfields
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the custom fields defined for users. The response is in the application/json format. The following list describes the contents of the response body.

    • id

      Unique ID for the field in the database. It is an integer value.

    • name

      Name of the Field. It is a String value.

A sample response JSON is as follows:

[{
   "id":1,
   "name":"Notes"
},
{
   "id":2,
   "name":"Department"
},
{
   "id":3,
   "name":"Company name"
}]

Get Current Logged In User

Description Retrieves the information about the current logged in user from the Arista Server.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/users/current
Sample code
GET https://training.mojonetworks.com/new/webservice/v5/users/current
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the current user. The response is in the application/json format.

Get User’s System Features

Description Fetches a list of system features available to currently logged in user.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/users/features
Sample code
GET https://training.mojonetworks.com/new/webservice/V5/users/features
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains a list of system features available to currently logged in user. The response is in the application/json format.

A sample response JSON is as follows:

[
    "REPORTS_CREATION",
    "SENSOR_PLACEMENT",
    "SHARED_REPORTS",
    "SWARM_DISABLED",
    "WIFI",
    "MANAGELOGS",
    "AP_PLACEMENT",
    "SHOW_UPGRADE_FOR_SENSOR",
    "SENSOR_IMPORT",
    "PERFORMANCE_MONITORING",
    "ACCOUNT_LOCKING",
    "IN_BROWSER_MESSAGING",
    "HA",
]

Add User

Description Creates a user account in the Arista Server. If you are an Arista Cloud Services customer, then this API call creates a user in your customer account.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
PUT <Base_URL>/users
Sample code
PUT https://training.mojonetworks.com/new/webservice/v5/users
Request Body This API call requires the details of the user to be created, which is passed as parameters in the request body. The parameters are passed in the application/json format.

A sample request body is as follows:

{
	"user": {
		"loginId": "testv123@atn.com",
		"firstName": "testv123",
		"lastName": "testv123",
		"email": "testv@atn123.com",
		"role": "SUPERUSER",
		"timeZone": "Asia/Kolkata",
		"allowedLocations": [{
			"type": "locallocationid",
			"id": 0
		}],
		"userType": "LOCAL",
		"passwdSettings": {
			"passwordExpires": "False"
		}
	},
	"password": "welcome"
}
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the created user. The response is in the application/json format.

Modify User

Description Modifies the details of a user account in the Arista Server. If you are an Arista Cloud Services customer, then this API call modifies the details of a user in the customer account.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
POST <Base_URL>/users
Sample code
POST https://training.mojonetworks.com/new/webservice/V5/users
Request Body This API call requires the details of the user to be modified, which is passed to the user parameter in the request body. The details are passed in the application/json format.

A sample request body is as follows:

{
	"user": {
		"loginId": "testv123@atn.com",
		"firstName": "testv123",
		"lastName": "testv123",
		"email": "testv@atn123.com",
		"role": "SUPERUSER",
		"timeZone": "Asia/Kolkata",
		"allowedLocations": [{
			"type": "locallocationid",
			"id": 0
		}],
		"userType": "LOCAL",
		"passwdSettings": {
			"passwordExpires": "False"
		}
	},
	"password": "welcome"
}
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the modified user. The response is in the application/json format.

Change Own Password

Description Modifies the password of the logged-in user.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
POST <Base_URL>/users/ownpassword
Sample code
POST https://training.mojonetworks.com/new/webservice/v5/users/ownpassword
Request Body This API call requires the existing and new password for the user account, which is passed as parameters in the request body. The parameters are passed in the application/json format.

A sample request body is as follows:

{
   "newPassword": "P@ssW0rd",
   "oldPassword": "W3lc0me!"
}
Response Body If the API call is successful, the HTTP response status is 200. The response body contains a true or false value indicating if the password is modified. The response is in the application/json format.

Delete User

Description Deletes a list of users from the Arista Server. If you are an Arista Cloud Services customer, then this API call deletes a list of users created in your customer account.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
DELETE <Base_URL>/users/{userid}
  • userid

    The ID of the user you want to delete. It takes an integer value.

Sample code
 DELETE https://training.mojonetworks.com/new/webservice/V5/users/4
Request Body This API does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 204. The response body does not contain any information.