Local User
9 operations. Call any of them with omada_call_operation (or, in full tool mode, as a tool named by its operationId).
| Operation | Method | Summary |
|---|---|---|
| downloadLocalUsers | GET | Download local user file (excel or csv) by localhost |
| uploadLocalUsers | POST | Upload local user file (excel or csv) by localhost |
| getLocalUsers | GET | Get local user list |
| createLocalUser | POST | Create a new local user |
| deleteLocalUser | DELETE | Delete an existing localuser |
| getLocalUser | GET | Get a local user for given localuserId |
| modifyLocalUser | POST | Modify an existing localuser |
| clearLocalUserDynamicMac | POST | Clear dynamic mac |
| deleteSelectedLocalUsers | POST | Batch delete local users |
downloadLocalUsers
GET /openapi/v1/{omadacId}/sites/{siteId}/files/hotspot/local-users
Download local user file (excel or csv) by localhost
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
portals | query | string | yes | Portal ids of the portals to download local user file from. |
searchKey | query | string | no | Fuzzy query parameters, support field name,username |
fileType | query | string | yes | Local user file format: csv or xlsx. |
// omada_call_operation
{
"operationId": "downloadLocalUsers",
"params": {
"siteId": "<siteId>",
"portals": "<portals>",
"fileType": "<fileType>"
}
}Details, permissions and error codes
Download local user file (excel or csv) by localhost.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1 - Something went wrong. Please try again later or contact our technical support.
-1001 - Invalid request parameters.
-33000 - This site does not exist.
uploadLocalUsers
POST /openapi/v1/{omadacId}/sites/{siteId}/files/hotspot/local-users
Upload local user file (excel or csv) by localhost
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
Request body — application/json (optional)
| Field | Type | Required | Description |
|---|---|---|---|
config | HotspotPortalsOpenApiVO | yes | Bound portal ID list,need to specify Content-Type of this form part as application/json. |
file | string (binary) | yes |
// omada_call_operation
{
"operationId": "uploadLocalUsers",
"params": {
"siteId": "<siteId>"
},
"body": "{...}"
}Details, permissions and error codes
Upload local user file (excel or csv) by localhost.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1 - Something went wrong. Please try again later or contact our technical support.
-1001 - Invalid request parameters.
-1005 - Operation forbidden.
-1200 - You have been logged out of the controller. This may have been caused by web application switching, data restore, reboot, session timeout or disabled cloud access. Please try to log in again later.
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-33712 - This file is empty.
-42037 - Please select at least one portal before creating local users.
-7131 - Controller ID not exist.
getLocalUsers
GET /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers
Get local user list
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
page | query | integer | no | Start page number. Start from 1. (default 1) |
pageSize | query | integer | no | Number of entries per page. It should be within the range of 1–1000. (default 100) |
sorts.name | query | string | no | Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect |
searchKey | query | string | no | Fuzzy query parameters, support field user_name |
// omada_call_operation
{
"operationId": "getLocalUsers",
"params": {
"siteId": "<siteId>"
}
}Details, permissions and error codes
Get local user list in a site with the given omadacId, siteId, params.
The interface requires one of the permissions:
Site Hotspot Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
createLocalUser
POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers
Create a new local user
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
Request body — application/json (required) — schema CreateLocalUserOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
userName | string | yes | User name should contain 1 to 128 ASCII visible characters, with no spaces at the beginning and end, and spaces in the middle, cannot be changed after creation. |
password | string | yes | Password should contain 1 to 128 characters. |
enable | boolean | yes | Whether to enable. |
expirationTime | integer | yes | Expiration timestamp. Unit:ms. |
bindingType | integer | yes | MAC binding type should be a value as follows: 0: no binding; 1: static binding; 2: dynamic binding. |
macAddress | string | no | Mac address,the value is only available when the macType is static binding or dynamic binding. |
maxUsers | integer | no | The maximum number of users online at the same time when the MAC binding type is No Binding. It cannot be modified after initialization. MaxUsers should be within the range of 1–2048. |
name | string | no | Name should contain 1 to 128 characters, with no spaces at the beginning and end, and spaces in the middle |
phone | string | no | Phone number should contain 1 to 20 characters. |
rateLimit | RateLimitOpenApiVO | yes | (RateLimitOpenApiVO not expanded; call omada_get_schema "RateLimitOpenApiVO") |
trafficLimitEnable | boolean | yes | Whether to enable traffic limit. |
trafficLimit | integer | no | Traffic limit in MB. It should be within the range of 1–10485760. |
trafficLimitFrequency | integer | no | Frequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly. |
portals | array<string> | yes | Bound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface |
logout | boolean | no | local user logout. enable local user logout |
applyToAllPortals | boolean | no | Is the localuser effective for all portals, including all newly created portals |
dailyLimitEnable | boolean | no | Whether to enable localuser daily time limit |
dailyLimit | DailyAuthTimeOpenApiVO | no | (DailyAuthTimeOpenApiVO not expanded; call omada_get_schema "DailyAuthTimeOpenApiVO") |
// omada_call_operation
{
"operationId": "createLocalUser",
"params": {
"siteId": "<siteId>"
},
"body": "{...}"
}Details, permissions and error codes
Create a local user with the given params.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-42012 - The number of local users has reached the limit. New local users cannot be created.
-42013 - Local user already exists.
-42020 - The MAC address that is bound to the local user account is invalid.
-42037 - Please select at least one portal before creating local users.
-42039 - Failed to bind to the portals. Please select the portals with local user authentication enabled.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.
deleteLocalUser
DELETE /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}
Delete an existing localuser
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
id | path | string | yes | Local user ID |
// omada_call_operation
{
"operationId": "deleteLocalUser",
"params": {
"siteId": "<siteId>",
"id": "<id>"
}
}Details, permissions and error codes
Delete an existing local user with the given omadacId, siteId, localuserId.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.
getLocalUser
GET /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}
Get a local user for given localuserId
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
id | path | string | yes | local user ID |
// omada_call_operation
{
"operationId": "getLocalUser",
"params": {
"siteId": "<siteId>",
"id": "<id>"
}
}Details, permissions and error codes
Get a local user with the given omadacId, siteId, local user ID.
The interface requires one of the permissions:
Site Hotspot Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
modifyLocalUser
POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}
Modify an existing localuser
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
id | path | string | yes | Local user ID |
Request body — application/json (required) — schema ModifyLocalUserOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
password | string | yes | Password should contain 1 to 128 characters. |
enable | boolean | yes | Whether to enable. |
expirationTime | integer | yes | Expiration timestamp. Unit:ms. |
bindingType | integer | yes | MAC binding type should be a value as follows: 0: no binding; 1: static binding; 2: dynamic binding. |
macAddress | string | no | Mac address,the value is only available when the macType is static binding or dynamic binding. |
maxUsers | integer | no | The maximum number of users online at the same time when the MAC binding type is No Binding. It cannot be modified after initialization. MaxUsers should be within the range of 1–2048. |
name | string | no | Name should contain 1 to 128 characters, with no spaces at the beginning and end, and spaces in the middle |
phone | string | no | Phone number should contain 1 to 20 characters. |
rateLimit | RateLimitOpenApiVO | yes | (RateLimitOpenApiVO not expanded; call omada_get_schema "RateLimitOpenApiVO") |
trafficLimitEnable | boolean | yes | Whether to enable traffic limit. |
trafficLimit | integer | no | Traffic limit in MB. It should be within the range of 1–10485760. |
trafficLimitFrequency | integer | no | Frequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly. |
portals | array<string> | yes | Bound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface |
logout | boolean | no | local user logout. enable local user logout |
applyToAllPortals | boolean | no | Is the localuser effective for all portals, including all newly created portals |
// omada_call_operation
{
"operationId": "modifyLocalUser",
"params": {
"siteId": "<siteId>",
"id": "<id>"
},
"body": "{...}"
}Details, permissions and error codes
Modify an existing local user with the given omadacId, siteId, localuserId.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-42013 - Local user already exists.
-42020 - The MAC address that is bound to the local user account is invalid.
-42037 - Please select at least one portal before creating local users.
-42039 - Failed to bind to the portals. Please select the portals with local user authentication enabled.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.
clearLocalUserDynamicMac
POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}/clear-dynamic-mac
Clear dynamic mac
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
id | path | string | yes | Local user ID |
// omada_call_operation
{
"operationId": "clearLocalUserDynamicMac",
"params": {
"siteId": "<siteId>",
"id": "<id>"
}
}Details, permissions and error codes
Clear dynamic mac with the given omadacId, siteId, localuserId. The mac address binding type should be dynamic binding.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.
deleteSelectedLocalUsers
POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/batch/delete
Batch delete local users
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
Request body — application/json (required) — schema SelectLocalUsersOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
type | integer | yes | Select type. It should be a value as follows: 0: Represents selecting all localUsers, this selection does not pass parameter [ids]. 1: Parameter [ids] includes the IDs of the localUsers to be selected. 2: Parameter [ids] includes the IDs of the localUsers not to be selected |
ids | array<string> | no | IDs of localUsers to be deleted in batch operation |
// omada_call_operation
{
"operationId": "deleteSelectedLocalUsers",
"params": {
"siteId": "<siteId>"
},
"body": "{...}"
}Details, permissions and error codes
Delete multiple local users by operation type and the selected IDs.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.