Trigger button action
1. API Description
This API is used to trigger button action.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/scene/set-switch-action
- V2.5.0 and below: POST [ip]/mwapi/set-switch-action
Administrator Rights | Logged-in |
---|---|
No | Yes |
2. Input Parameters
Name | Required | Type | Description |
---|---|---|---|
action | Yes | Int | Trigger the corresponding button on the device 0: Button 1; 1: Button 2; 2: Button 3; 3: Button 4; 4: Button 5 |
location | No | Int | Screen location PIP -- 1: Top Left, 2: Top Right, 3: Bottom Left, 4: Bottom Right SBS -- 1: Leftmost, 2: Left-center, 3: Center, 4: Center-right, 5: Rightmost |
sourceCollection | No | Int | Source combination 1: HDMI 1 + HDMI 2 2: HDMI 2 + HDMI 1 3: HDMI 1 + WEBCAM 4: WEBCAM + HDMI 1 5: HDMI 2 + WEBCAM 6: WEBCAM + HDMI 2 |
swap | No | Int | Swap image positions. When this value is 1, location and sourceCollection are invalid |
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
4. Example
Triggering button 1.
Input Example
{
"action": 0,
"location":1,
"sourceCollection":1,
"swap":0
}
Output Example
{
"status": 0,
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Status | Definition | Description |
---|---|---|
7 | MW_STATUS_INVALID_ARG | Missing required parameters |
9 | MW_STATUS_UNSUPPORTED | Operation is not allowed |
11 | MW_STATUS_DEVICE_BUSY | In scene editing mode, operation is not allowed |
31 | MW_STATUS_NOT_PERMITTED | The App is in pairing mode, and the operation is not allowed |