> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stmlink.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# ISMeetingEngine engine API

> Engine-level C++ API of the SMeeting Windows SDK: global init and version functions, engine settings and event handler, login and logout, meeting management HTTP APIs, creating and leaving ISMeetingChannel objects, device enumeration, log upload, IM, and resource drive APIs.

`ISMeetingEngine` is the SDK engine object. It handles engine-level capabilities such as the login session, the meeting management HTTP APIs, the channel object lifecycle, device enumeration, IM, and the resource drive.

All in-meeting operations and media objects are on [ISMeetingChannel](/en/meeting/windows/api-reference/smeeting-channel).

***

## Global functions

### Initialize the engine

```cpp theme={null}
SMEETING_API StatusCode SMEETING_CALL SMeetingEngine_Init(ISMeetingEngine** meet);
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| meet | ISMeetingEngine\*\* | Output pointer to the engine object |

**Returns**

`StatusCode` - Error code

### Get the SDK version

```cpp theme={null}
SMEETING_API StatusCode SMEETING_CALL SMeetingEngine_Version(std::string& s);
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| s | std::string& | Output version string |

**Returns**

`StatusCode` - Error code

### Get an error code description

```cpp theme={null}
SMEETING_API void SMEETING_CALL SMeetingEngine_GetStatusMsg(StatusCode code, char* msg);
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| code | StatusCode | Error code |
| msg | char\* | Output buffer for the error description |

***

## Engine settings and callbacks

### Get the engine settings object

```cpp theme={null}
virtual StatusCode getSetting(ISMeetingSetting** sett) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| sett | ISMeetingSetting\*\* | Output pointer to the settings object |

**Returns**

`StatusCode` - Error code

### Set the engine event handler

```cpp theme={null}
virtual StatusCode setEventHandler(ISMeetingEngineEvent* e) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| e | ISMeetingEngineEvent\* | Event handler object |

**Returns**

`StatusCode` - Error code

***

## Login and logout APIs

### Log in

```cpp theme={null}
virtual StatusCode login(std::string token, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| token | std::string | Login token |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Log out

```cpp theme={null}
virtual StatusCode logout(Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get your own info

```cpp theme={null}
virtual StatusCode getSelf(Callback back) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get the device list

```cpp theme={null}
virtual StatusCode listAgent(std::vector<int> type, int page, std::string find_key = "", Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| type | `std::vector<int>` | List of device types |
| page | int | Page number |
| find\_key | std::string | Search keyword |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

***

## Meeting management APIs

### Create a meeting

```cpp theme={null}
virtual StatusCode createRoom(SMeetingCreateMeetingModel model, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| model | SMeetingCreateMeetingModel | Room configuration model |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Update room info

```cpp theme={null}
virtual StatusCode updateRoom(SMeetingCreateMeetingModel model, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| model | SMeetingCreateMeetingModel | Room configuration model |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Update the background and attachments

```cpp theme={null}
virtual StatusCode updateBgAndAttach(std::string meeting_id, std::string background, std::vector<SMeetingMeetingAttachments>, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| meeting\_id | std::string | Meeting ID |
| background | std::string | Background URL |
| attachments | `std::vector<SMeetingMeetingAttachments>` | List of attachments |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get ongoing meetings

```cpp theme={null}
virtual StatusCode attendeeRoom(int page, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| page | int | Page number |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get past meetings

```cpp theme={null}
virtual StatusCode attendedRoom(int page, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| page | int | Page number |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get meeting details

```cpp theme={null}
virtual StatusCode detailRoom(std::string meeting_id, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| meeting\_id | std::string | Meeting ID |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Cancel a meeting

```cpp theme={null}
virtual StatusCode cancelRoom(std::string meeting_id, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| meeting\_id | std::string | Meeting ID |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get the meeting member list

```cpp theme={null}
virtual StatusCode participantRoom(std::string meeting_id, int page, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| meeting\_id | std::string | Meeting ID |
| page | int | Page number |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

***

## Meeting channel APIs

### Create a channel object

```cpp theme={null}
virtual StatusCode createChannel(std::string roomno, ISMeetingChannel** ch) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| roomno | std::string | Room number |
| ch | ISMeetingChannel\*\* | Output pointer to the channel object |

`createChannel` only creates the channel object and does **not** enter the meeting right away. After it returns, call `ISMeetingChannel::enter()` to actually enter the meeting.

**Returns**

`StatusCode` - Error code

### Create a channel object by meeting ID

```cpp theme={null}
virtual StatusCode createChannelByMeetingId(std::string meetingid, ISMeetingChannel** ch) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| meetingid | std::string | Meeting ID |
| ch | ISMeetingChannel\*\* | Output pointer to the channel object |

**Returns**

`StatusCode` - Error code

### Leave a channel

```cpp theme={null}
virtual StatusCode leaveChannel(std::string channelId, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| channelId | std::string | Channel ID, that is, the room number you passed to `createChannel` |
| back | Callback | Asynchronous callback |

After you exit, the channel object is destroyed; don't use the original `ISMeetingChannel*` pointer again.

**Returns**

`StatusCode` - Error code

### Leave all channels

```cpp theme={null}
virtual StatusCode leaveAllChannel(Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Get the current channel ID list

```cpp theme={null}
virtual StatusCode getChannelIds(std::string& s) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| s | std::string& | Output list of channel IDs as a JSON array |

**Returns**

`StatusCode` - Error code

***

## Device enumeration APIs

### Get the video device list

```cpp theme={null}
virtual StatusCode getEnumVideo(std::string& dev) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| dev | std::string& | Output video devices as a JSON string |

**Returns**

`StatusCode` - Error code

### Get the screen list

```cpp theme={null}
virtual StatusCode getEnumScreen(std::string& dev) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| dev | std::string& | Output screens as a JSON string |

**Returns**

`StatusCode` - Error code

### Get the audio device list

```cpp theme={null}
virtual StatusCode getEnumAudio(std::string& dev) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| dev | std::string& | Output audio devices as a JSON string |

**Returns**

`StatusCode` - Error code

### Get the speaker list

```cpp theme={null}
virtual StatusCode getEnumSpeaker(std::string& dev) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| dev | std::string& | Output speakers as a JSON string |

**Returns**

`StatusCode` - Error code

***

## Log and IM APIs

### Upload a log

```cpp theme={null}
virtual StatusCode addUploadLog(const char* type, const char* msg) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| type | const char\* | Log type |
| msg | const char\* | Log content |

**Returns**

`StatusCode` - Error code

### Enable IM

```cpp theme={null}
virtual StatusCode enableIm(Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Disable IM

```cpp theme={null}
virtual void disableIm(Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| back | Callback | Asynchronous callback |

***

## Cloud storage and resource management APIs

### Presigned upload

```cpp theme={null}
virtual StatusCode presignedPutObject(std::string type, std::string meeting_id, std::string ext, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| type | std::string | File type |
| meeting\_id | std::string | Meeting ID |
| ext | std::string | File extension |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Presigned download

```cpp theme={null}
virtual StatusCode presignedGetObject(std::string id, std::string res_key, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| id | std::string | Resource ID |
| res\_key | std::string | Resource key |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### List resources

```cpp theme={null}
virtual StatusCode resourcesList(std::string parent_id, std::string meeting_id, std::string res_name, int page, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| parent\_id | std::string | Parent resource ID |
| meeting\_id | std::string | Meeting ID |
| res\_name | std::string | Resource name |
| page | int | Page number |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Create a resource

```cpp theme={null}
virtual StatusCode resourcesCreate(SMeetingResourcesModel* mode, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| mode | SMeetingResourcesModel\* | Resource model |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Rename a resource

```cpp theme={null}
virtual StatusCode resourcesRename(std::string id, std::string res_key, std::string res_name, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| id | std::string | Resource ID |
| res\_key | std::string | Resource key |
| res\_name | std::string | New resource name |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Move a resource

```cpp theme={null}
virtual StatusCode resourcesMoveto(std::string id, std::string res_key, std::string parent_id, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| id | std::string | Resource ID |
| res\_key | std::string | Resource key |
| parent\_id | std::string | Target parent resource ID |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Delete a resource

```cpp theme={null}
virtual StatusCode resourcesRemove(std::string id, std::string res_key, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| id | std::string | Resource ID |
| res\_key | std::string | Resource key |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

### Set the meeting background

```cpp theme={null}
virtual StatusCode resourcesMeetingBg(std::string id, Callback back = NULL) = 0;
```

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| id | std::string | Resource ID |
| back | Callback | Asynchronous callback |

**Returns**

`StatusCode` - Error code

***

## Release API

### Release the engine

```cpp theme={null}
virtual void del() = 0;
```
