---
title: API Methods Overview
slug: api-methods-overview
docTags: 
createdAt: 2024-06-27T10:34:40.331Z
---

**message(device\_id, data) -> onMessage(device\_id, data)**

Send a message from the screen to a specific controller:

::Image[]{src="https://api.archbee.com/api/optimize/eODGJqzvP6Walum1Gn5N9/bxkFc6aAy40sL8YXvkZqU_image.png" size="50" width="462" height="220" position="center" darkWidth="462" darkHeight="220" showCaption="false"}

:::BlockQuote
The screen always has the device\_id = **0**. All other device\_ids should be seen as random.
We recommend to use the constant *AirConsole.SCREEN&#x20;*&#x69;nstead of 0
:::

Send a message from a controller to the screen:

::Image[]{src="https://api.archbee.com/api/optimize/eODGJqzvP6Walum1Gn5N9/dFCN14YsBSBy9vdc6nQ1S_image.png" size="70" width="462" height="261" position="center" darkWidth="462" darkHeight="261" showCaption="false"}

***broadcast(data) -> onMessage(device\_id, data)***

Send a message from the screen to all controllers:

::Image[]{src="https://api.archbee.com/api/optimize/eODGJqzvP6Walum1Gn5N9/h9Ys5zY24bzfiWqUDWVsA_image.png" size="70" width="462" height="220" position="center" darkWidth="462" darkHeight="220" showCaption="false"}

***setCustomDeviceStateProperty(key, value) -> onCustomDeviceStateChange(device\_id, data)***

A device sets it's custom data property and triggers the<font color="#eb144c">`onCustomDeviceStateChange()`</font>method on the other devices.

![](https://api.archbee.com/api/optimize/eODGJqzvP6Walum1Gn5N9/OtBESg3w2VOU5Ks5yu2QP_image.png)

***setActivePlayers(max\_players)***

The screen sets maximum two devices as active players and triggers the<font color="#eb144c">`onActivePlayersChange()`</font>method on the first two devices.

![](https://api.archbee.com/api/optimize/eODGJqzvP6Walum1Gn5N9/cbQTGHbUSBYZ8ys3kYM7p_image.png)

