To use this function, you need to contact [support@agora.io](mailto:support@agora.io) to enable it.
-
```java
Conversation conversation = ChatClient.getInstance().chatManager().getConversation(username);
// Delete messages by timestamp
diff --git a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/flutter.mdx b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/flutter.mdx
index 1902d73ab..79bd3c51f 100644
--- a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/flutter.mdx
+++ b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/flutter.mdx
@@ -94,8 +94,6 @@ ChatCursorResult result =
Call `deleteRemoteMessagesBefore` or `deleteRemoteMessagesWithIds` to delete historical messages one way from the server. You can remove a maximum of 50 messages from the server each time. Once the messages are deleted, you can no longer retrieve them from the server. The deleted messages are automatically removed from your local device. Other chat users can still get the messages from the server.
-To use this function, you need to contact [support@agora.io](mailto:support@agora.io) to enable it.
-
```dart
try {
// Delete messages by timestamp
diff --git a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/ios.mdx b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/ios.mdx
index 46d503d63..de3f279f9 100644
--- a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/ios.mdx
+++ b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/ios.mdx
@@ -73,8 +73,6 @@ Refer to the following code example to get a list of pinned conversations from t
Call `removeMessagesFromServerWithTimeStamp` or `removeMessagesFromServerMessageIds` to delete historical messages one way from the server. You can remove a maximum of 50 messages from the server each time. Once the messages are deleted, you can no longer retrieve them from the server. The deleted messages are automatically removed from your local device. Other chat users can still get the messages from the server.
-To use this function, you need to contact [support@agora.io](mailto:support@agora.io) to enable it.
-
```objective-c
// Delete messages by timestamp
AgoraChatConversation* conversation = [AgoraChatClient.sharedClient.chatManager getConversationWithConvId:@"conversationId"];
diff --git a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/web.mdx b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/web.mdx
index 73e079219..be7ce51ce 100644
--- a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/web.mdx
+++ b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/web.mdx
@@ -76,8 +76,6 @@ connection.getServerPinnedConversations({pageSize:50, cursor: ''})
Call `removeHistoryMessages` to delete historical messages one way from the server. You can remove a maximum of 20 messages from the server each time. Once the messages are deleted, you can no longer retrieve them from the server. Other chat users can still get the messages from the server.
-To use this function, you need to contact [support@agora.io](mailto:support@agora.io) to enable it.
-
```javascript
// Delete messages by timestamp
connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', beforeTimeStamp: Date.now()})
diff --git a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/windows.mdx b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/windows.mdx
index bfd508d13..f1eb83d95 100644
--- a/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/windows.mdx
+++ b/shared/chat-sdk/client-api/messages/retrieve-messages/project-implementation/windows.mdx
@@ -130,8 +130,6 @@ SDKClient.Instance.ChatManager.GetConversationsFromServerWithCursor(pinOnly, cur
Call `RemoveMessagesFromServer` to delete historical messages one way from the server. You can remove a maximum of 50 messages from the server each time. Once the messages are deleted, you can no longer retrieve them from the server. The deleted messages are automatically removed from your local device. Other chat users can still get the messages from the server.
-To use this function, you need to contact [support@agora.io](mailto:support@agora.io) to enable it.
-
```csharp
SDKClient.Instance.ChatManager.RemoveMessagesFromServer(convId, ctype, time, new CallBack(
onSuccess: () =>
diff --git a/shared/chat-sdk/develop/offline-push/project-implementation/android.mdx b/shared/chat-sdk/develop/offline-push/project-implementation/android.mdx
index 887ebbda8..743438439 100644
--- a/shared/chat-sdk/develop/offline-push/project-implementation/android.mdx
+++ b/shared/chat-sdk/develop/offline-push/project-implementation/android.mdx
@@ -4,29 +4,29 @@
This section guides you through how to integrate FCM with Chat.
-### 1. Create an Android project in Firebase
+For devices using the Android system, if FCM and push services from other manufacturers are enabled at the same time, FCM push services will be used first.
-1. Log in to [Firebase console](https://console.firebase.google.com/), and click **Add project**.
+### 1. Create a project in Firebase
-2. In the **Create a project** page, enter a project name, and click **Create project**.
+1. Log in to the [Firebase console](https://console.firebase.google.com/) and [add a project](https://firebase.google.com/docs/android/setup/#create-firebase-project).
-You can toggle off **Enable Google Analytics for this project** if this option is not needed.
+1. [Register the application](https://firebase.google.com/docs/android/setup/#register-app) in the project.
-3. After the project is ready, click **Continue** to redirect to the project page, and click the **Android** icon to register an Android project.
+ In the **Download and then add config file** step of the **Add Firebase to your Android app** page, click **Download google-services.json** and put the file into your Android app module root directory.
-4. In the **Add Firebase to your Android app** page, perform the following operations:
- 1. In the **Register app** step, enter an Android package name, app nickname (optional), and debug signing certificate SHA-1 (optional), and click **Register app**.
- 2. In the **Download google-services.json** step, download `google-services.json`, move this file into your Android app module root directory, and click **Next**.
- 3. In the **Add Firebase SDK** step, modify your `build.gradle` files to use Firebase, and click **Next**.
- 4. In the **Next steps** step, click **Continue to console** to go back to the project page.
+ ![push_fcm_download_googleservice](/images/chat/push_fcm_download_googleservice.png)
-5. In the project page, click the Android project you have created.
+1. Query the sender ID. On the **Project settings** page, select the **Cloud Messaging** tab and view **Sender ID**. When uploading the FCM certificate to , set the certificate name to the FCM sender ID.
-6. In the **Project settings** page, select the **Cloud Messaging** tab, and locate the **Server key** and **Sender ID**.
+ ![push_fcm_senderid.png](/images/chat/push_fcm_senderid.png)
-![1649906356504](https://web-cdn.agora.io/docs-files/1649906356504)
+1. On the **Project settings** page, select the **Service accounts** tab and click **Generate new private key** to generate a JSON file. Save this file and upload it to when using the V1 certificate.
-### 2. Upload FCM certificate to Agora Console
+ ![push_fcm_private_key](/images/chat/push_fcm_private_key.png)
+
+### 2. Upload FCM certificate to
+
+After successfully logging into Chat, you can upload the FCM push certificate to :
1. Log in to , and click **Project Management** in the left navigation bar.
@@ -36,11 +36,41 @@ This section guides you through how to integrate FCM with Chat.
4. On the project config page, select **Features** > **Push Certificate** and click **Add Push Certificate**.
-5. In the pop-up window, select the **GOOGLE** tab, and configure the following fields:
- - **Certificate Name**: Fill in the [Sender ID](#token).
- - **Push Key**: Fill in the [Server Key](#token).
+5. In the pop-up window, select the **Google** tab, and configure the following fields:
+
+ ![push_fcm_add_certificate](/images/chat/push_fcm_add_certificate.png)
+
+ | Parameter | Type | Required | Description |
+ | :--------- | :----- | :------- | :----------------------- |
+ | **Certificate Type** | | No | Select whether to use a V1 certificate or a legacy certificate. - **V1**: Recommended. You need to configure a **Private Key**.
- **Legacy**: Will soon be deprecated. You need to configure a **Push Key**.
|
+ | **Private Key** | file | Yes | Click **Generate new private key** on the **Project settings** > **Service accounts** page of the [Firebase Console](https://console.firebase.google.com) to generate the `.json` file, then upload it to . |
+ | **Push Key** | String | Yes | FCM Server Key. Obtain the server key in the **Cloud Messaging API (Legacy)** area of the **Project settings** > **Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com).
**This parameter is only valid for legacy certificates.**|
+ | **Certificate Name** | String | Yes | The sender ID configured for the FCM. - For the new version of the certificate, you can find the sender ID on the **Project settings** > **Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com).
- For legacy certificates, go to the ***Project settings > Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com), and get the sender ID in the **Cloud Messaging API (Legacy)** area.
The certificate name is the only condition used by the Agora server to determine which push channel the target device uses, so ensure that the sender set when integrating FCM in Chat is consistent with what is set here. |
+ | **Sound** | String | No | The ringtone flag for when the receiver gets the push notification. |
+ | **Push Priority** | | No| Message delivery priority. See [Setting the priority of a message](https://firebase.google.cn/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message). |
+ | **Push Msg Type** | | No| The type of the message sent to the client through FCM. See [Message types](https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages): - **Data**: Data message, processed by the client application.
- **Notification**: Notification message, automatically processed by FCM SDK.
- **Both**: Notification messages and data messages can be sent through the FCM client.
|
+
+#### Switch from legacy to the V1 certificate
+
+The legacy HTTP or XMPP API is being retired on June 20, 2024. In view of this, switch to the latest FCM API (HTTP v1) version of the certificate as soon as possible. See [Firebase Console](https://console.firebase.google.com) for details.
+
+Make sure that the uploaded V1 certificate is available, as the legacy one will be deleted upon upload. If the new certificate is not available, the push will fail.
+
+Take the following steps to switch from the old to the new certificate:
+
+1. Click **Edit** in the **Action** column of the old certificate on the **Push Certificate** page.
+
+ ![push_fcm_oldcertificate_edit](/images/chat/push_fcm_oldcertificate_edit.png)
+
+1. In the **Google** tab of the **Edit Push Certificate** window, switch the **Certificate Type** to **V1**.
+
+ ![push_fcm_oldcertificate_switch](/images/chat/push_fcm_oldcertificate_switch.png)
+
+1. Click **Upload** to upload the locally saved V1 certificate file (.json).
+
+ ![push_fcm_newcertificate_upload](/images/chat/push_fcm_newcertificate_upload.png)
-
+1. Click **OK** to complete the switch.
### 3. Enable FCM in Chat
diff --git a/shared/chat-sdk/develop/offline-push/project-implementation/flutter.mdx b/shared/chat-sdk/develop/offline-push/project-implementation/flutter.mdx
index e5ff10a58..43883c673 100644
--- a/shared/chat-sdk/develop/offline-push/project-implementation/flutter.mdx
+++ b/shared/chat-sdk/develop/offline-push/project-implementation/flutter.mdx
@@ -4,26 +4,33 @@
This section guides you through how to integrate FCM with Chat.
-### 1. Create a Flutter project in Firebase
+### 1. Create a project in Firebase
-1. Log in to [Firebase console](https://console.firebase.google.com/), and click **Add project**.
+1. Log in to the [Firebase console](https://console.firebase.google.com/) and click **Add project**.
-2. In the **Create a project** page, enter a project name, and click **Create project**.
+1. In the **Create a project** page, enter a project name, and click **Create project**.
You can toggle off Enable Google Analytics for this project if this option is not needed.
-3. After the project is ready, click **Continue** to redirect to the project page, and click the **Flutter** icon and follow the **Firebase CLI** to setting your project.
+1. After the project is ready, click **Continue** to redirect to the project page. Then click the **Flutter** icon and follow the **Firebase CLI** to set your project.
-4. In the **Project settings** page, perform the following operations:
- - For Android apps, find the **Android apps** in **Your apps**, and set your Android app according to **See SDK instructions**.
- - For iOS apps, find the **Apple apps** in **Your apps**, and set your Apple app according to **See SDK instructions**.
+1. In the **Project settings** page, perform the following operations:
-5. In the project page, click the project you have created.
+ - For Android apps, find the **Android apps** in **Your apps**, and set your Android app according to the SDK instructions.
+ - For iOS apps, find the **Apple apps** in **Your apps**, and set your Apple app according to the SDK instructions.
-6. In the **Project settings** page, select the **Cloud Messaging** tab, and locate the **Server key** and **Sender ID**.
+1. In the project page, click the project you have created.
-![1649906356504](https://web-cdn.agora.io/docs-files/1649906356504)
+1. Query the sender ID. On the **Project settings** page, select the **Cloud Messaging** tab and view **Sender ID**. When uploading the FCM certificate to , set the certificate name to the FCM sender ID.
-### 2. Upload FCM certificate to Agora Console
+ ![push_fcm_senderid.png](/images/chat/push_fcm_senderid.png)
+
+1. On the **Project settings** page, select the **Service accounts** tab and click **Generate new private key** to generate a JSON file. Save this file and upload it to when using the V1 certificate.
+
+ ![push_fcm_private_key](/images/chat/push_fcm_private_key.png)
+
+### 2. Upload FCM certificate to
+
+After successfully logging into Chat, you can upload the FCM push certificate to :
1. Log in to , and click **Project Management** in the left navigation bar.
@@ -33,10 +40,42 @@ This section guides you through how to integrate FCM with Chat.
4. On the project config page, select **Features** > **Push Certificate** and click **Add Push Certificate**.
-5. In the pop-up window, select the **GOOGLE** tab, and configure the following fields:
- - **Certificate Name**: Fill in the [Sender ID](#token).
- - **Push Key**: Fill in the [Server Key](#token).
-
+5. In the pop-up window, select the **Google** tab, and configure the following fields:
+
+ ![push_fcm_add_certificate](/images/chat/push_fcm_add_certificate.png)
+
+ | Parameter | Type | Required | Description |
+ | :--------- | :----- | :------- | :----------------------- |
+ | **Certificate Type** | | No | Select whether to use a V1 certificate or a legacy certificate. - **V1**: Recommended. You need to configure a **Private Key**.
- **Legacy**: Will soon be deprecated. You need to configure a **Push Key**.
|
+ | **Private Key** | file | Yes | Click **Generate new private key** on the **Project settings** > **Service accounts** page of the [Firebase Console](https://console.firebase.google.com) to generate the `.json` file, then upload it to . |
+ | **Push Key** | String | Yes | FCM Server Key. Obtain the server key in the **Cloud Messaging API (Legacy)** area of the **Project settings** > **Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com).
**This parameter is only valid for legacy certificates.**|
+ | **Certificate Name** | String | Yes | The sender ID configured for the FCM. - For the new version of the certificate, you can find the sender ID on the **Project settings** > **Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com).
- For legacy certificates, go to the ***Project settings > Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com), and get the sender ID in the **Cloud Messaging API (Legacy)** area.
The certificate name is the only condition used by the Agora server to determine which push channel the target device uses, so ensure that the sender set when integrating FCM in Chat is consistent with what is set here. |
+ | **Sound** | String | No | The ringtone flag for when the receiver gets the push notification. |
+ | **Push Priority** | | No| Message delivery priority. See [Setting the priority of a message](https://firebase.google.cn/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message). |
+ | **Push Msg Type** | | No| The type of the message sent to the client through FCM. See [Message types](https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages): - **Data**: Data message, processed by the client application.
- **Notification**: Notification message, automatically processed by FCM SDK.
- **Both**: Notification messages and data messages can be sent through the FCM client.
|
+
+#### Switch from legacy to the V1 certificate
+
+The legacy HTTP or XMPP API is being retired on June 20, 2024. In view of this, switch to the latest FCM API (HTTP v1) version of the certificate as soon as possible. See [Firebase Console](https://console.firebase.google.com) for details.
+
+Make sure that the uploaded V1 certificate is available, as the legacy one will be deleted upon upload. If the new certificate is not available, the push will fail.
+
+Take the following steps to switch from the old to the new certificate:
+
+1. Click **Edit** in the **Action** column of the old certificate on the **Push Certificate** page.
+
+ ![push_fcm_oldcertificate_edit](/images/chat/push_fcm_oldcertificate_edit.png)
+
+1. In the **Google** tab of the **Edit Push Certificate** window, switch the **Certificate Type** to **V1**.
+
+ ![push_fcm_oldcertificate_switch](/images/chat/push_fcm_oldcertificate_switch.png)
+
+1. Click **Upload** to upload the locally saved V1 certificate file (.json).
+
+ ![push_fcm_newcertificate_upload](/images/chat/push_fcm_newcertificate_upload.png)
+
+1. Click **OK** to complete the switch.
+
### 3. Enable FCM in Chat
diff --git a/shared/chat-sdk/develop/offline-push/project-implementation/react-native.mdx b/shared/chat-sdk/develop/offline-push/project-implementation/react-native.mdx
index 44e554c62..8fe3dc0a4 100644
--- a/shared/chat-sdk/develop/offline-push/project-implementation/react-native.mdx
+++ b/shared/chat-sdk/develop/offline-push/project-implementation/react-native.mdx
@@ -8,21 +8,32 @@ This section guides you through how to integrate FCM with Chat.
1. Log in to [Firebase console](https://console.firebase.google.com/), and click **Add project**.
-2. On the **Create a project** page, enter a project name, and proceed with prompts. The `Sender Id` and `Server Key` are required for Cloud Messaging.
+1. On the **Create a project** page, enter a project name, and proceed with prompts.
-After the project is created, add an `iOS` application or an `Android` application according to the following steps:
+1. Query the sender ID. On the **Project settings** page, select the **Cloud Messaging** tab and view **Sender ID**. When uploading the FCM certificate to , set the certificate name to the FCM sender ID.
-- Add an `iOS` app
+ ![push_fcm_senderid.png](/images/chat/push_fcm_senderid.png)
+
+1. On the **Project settings** page, select the **Service accounts** tab and click **Generate new private key** to generate a JSON file. Save this file and upload it to when using the V1 certificate.
+
+ ![push_fcm_private_key](/images/chat/push_fcm_private_key.png)
+
+1. After the project is created, add an `iOS` application or an `Android` application according to the following steps:
+
+- Add an `iOS` app:
1. The package name is the same as that of the `iOS` app;
2. Once created, move the downloaded `GoogleService-Info.plist` file to the root directory of the `Xcode` project, and add it to all targets;
3. Upload the `APNs` certificate on the Cloud Messaging page.
-- Add an `Android` app
+- Add an `Android` app:
1. The package name is the same as that of the `Android` app;
2. Once created, move the downloaded `google-services.json` file to your module (application level) root directory.
+For detailed FCM configurations, you can see the [React Native Firebase document](https://rnfirebase.io/).
+
+### 2. Upload FCM certificate to
-### 2. Upload FCM certificate to Agora Console
+After successfully logging into Chat, you can upload the FCM push certificate to :
1. Log in to , and click **Project Management** in the left navigation bar.
@@ -33,10 +44,40 @@ After the project is created, add an `iOS` application or an `Android` applicati
4. On the project config page, select **Features** > **Push Certificate** and click **Add Push Certificate**.
5. In the pop-up window, select the **Google** tab, and configure the following fields:
- - **Certificate Name**: Fill in the [Sender ID](#token).
- - **Push Key**: Fill in the [Server Key](#token).
-
+ ![push_fcm_add_certificate](/images/chat/push_fcm_add_certificate.png)
+
+ | Parameter | Type | Required | Description |
+ | :--------- | :----- | :------- | :----------------------- |
+ | **Certificate Type** | | No | Select whether to use a V1 certificate or a legacy certificate. - **V1**: Recommended. You need to configure a **Private Key**.
- **Legacy**: Will soon be deprecated. You need to configure a **Push Key**.
|
+ | **Private Key** | file | Yes | Click **Generate new private key** on the **Project settings** > **Service accounts** page of the [Firebase Console](https://console.firebase.google.com) to generate the `.json` file, then upload it to . |
+ | **Push Key** | String | Yes | FCM Server Key. Obtain the server key in the **Cloud Messaging API (Legacy)** area of the **Project settings** > **Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com).
**This parameter is only valid for legacy certificates.**|
+ | **Certificate Name** | String | Yes | The sender ID configured for the FCM. - For the new version of the certificate, you can find the sender ID on the **Project settings** > **Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com).
- For legacy certificates, go to the ***Project settings > Cloud Messaging** page of the [Firebase Console](https://console.firebase.google.com), and get the sender ID in the **Cloud Messaging API (Legacy)** area.
The certificate name is the only condition used by the Agora server to determine which push channel the target device uses, so ensure that the sender set when integrating FCM in Chat is consistent with what is set here. |
+ | **Sound** | String | No | The ringtone flag for when the receiver gets the push notification. |
+ | **Push Priority** | | No| Message delivery priority. See [Setting the priority of a message](https://firebase.google.cn/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message). |
+ | **Push Msg Type** | | No| The type of the message sent to the client through FCM. See [Message types](https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages): - **Data**: Data message, processed by the client application.
- **Notification**: Notification message, automatically processed by FCM SDK.
- **Both**: Notification messages and data messages can be sent through the FCM client.
|
+
+#### Switch from legacy to the V1 certificate
+
+The legacy HTTP or XMPP API is being retired on June 20, 2024. In view of this, switch to the latest FCM API (HTTP v1) version of the certificate as soon as possible. See [Firebase Console](https://console.firebase.google.com) for details.
+
+Make sure that the uploaded V1 certificate is available, as the legacy one will be deleted upon upload. If the new certificate is not available, the push will fail.
+
+Take the following steps to switch from the old to the new certificate:
+
+1. Click **Edit** in the **Action** column of the old certificate on the **Push Certificate** page.
+
+ ![push_fcm_oldcertificate_edit](/images/chat/push_fcm_oldcertificate_edit.png)
+
+1. In the **Google** tab of the **Edit Push Certificate** window, switch the **Certificate Type** to **V1**.
+
+ ![push_fcm_oldcertificate_switch](/images/chat/push_fcm_oldcertificate_switch.png)
+
+1. Click **Upload** to upload the locally saved V1 certificate file (.json).
+
+ ![push_fcm_newcertificate_upload](/images/chat/push_fcm_newcertificate_upload.png)
+
+1. Click **OK** to complete the switch.
### 3. Enable FCM in Chat
diff --git a/shared/chat-sdk/reference/_callbacks-events.mdx b/shared/chat-sdk/reference/_callbacks-events.mdx
index 175d46121..aa01b1ab0 100644
--- a/shared/chat-sdk/reference/_callbacks-events.mdx
+++ b/shared/chat-sdk/reference/_callbacks-events.mdx
@@ -31,7 +31,7 @@ When a user logs in to the Chat app, the Chat server sends a callback to your ap
| Field | Data Type | Description |
| --- | --- | --- |
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `reason` | String | The reason that triggers the callback. `login` indicates that a user logs in to the app. |
| `security` | String | The signature in the callback request used to confirm whether this callback is sent from the Chat server. The signature is the MD5 hash of the `{callId} + {secret} + {timestamp}` string, where the value of `secret` can be found on .|
| `os` | String | The operating system of the device. Valid values: `ios`, `android`, `linux`, `win`, and `other.` |
@@ -65,7 +65,7 @@ When a user logs out of the Chat app, the Chat server sends a callback to your a
| Field | Data Type | Description |
| --- | --- | --- |
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `reason` | String | The reason that triggers the callback. `logout` indicates that a user logs out of the app. |
| `security` | String | The signature in the callback request used to confirm whether this callback is sent from the Chat server. The signature is the MD5 hash of the `{callId} + {secret} + {timestamp}` string, where the value of `secret` can be found on .|
| `os` | String | The operating system of the device. Valid values: `ios`, `android`, `linux`, `win`, and `other.` |
@@ -98,7 +98,7 @@ When a user logs out of the Chat app due to being kicked out by another device,
| Field | Data Type | Description |
| --- | --- | --- |
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `reason` | String | The reason that triggers the callback. `replaced` indicates that a user logs out of the app due to being kicked out by another device. |
| `security` | String | The signature in the callback request used to confirm whether this callback is sent from the Chat server. The signature is the MD5 hash of the `{callId} + {secret} + {timestamp}` string, where the value of `secret` can be found on .|
| `os` | String | The operating system of the device. Valid values: `ios`, `android`, `linux`, `win`, and `other.` |
@@ -119,7 +119,7 @@ When a user sends a message in a one-to-one chat, chat group, or chat room of th
```json
{
- "callId":"{appkey}_{file_uuid}",
+ "callId":"{appkey}_{uuid}",
"eventType":"chat_offline",
"timestamp":1600060847294,
"chat_type":"groupchat",
@@ -137,7 +137,7 @@ When a user sends a message in a one-to-one chat, chat group, or chat room of th
| Field | Data Type | Description |
| -- | -- | -- |
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `eventType` | String | The message type of the callback. - `chat`: Uplink messages. The messages that are about to be sent by the Chat server to end devices.
- `chat_offline`: Offline messages. The messages that are not sent by the Chat server as end users are offline.
|
| `timestamp` | Long | The Unix timestamp when the Chat server receives the callback event, in milliseconds. |
| `chat_type` | String | The type of chat. - `chat`: One-to-one chats.
- `groupchat`: Chat groups and chat rooms.
|
@@ -392,7 +392,7 @@ When a user recalls a message in a one-to-one chat, chat group, or chat room of
| Field | Data Type | Description |
| --- | --- | --- |
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `eventType` | String | The message type of the callback. - `chat`: Uplink messages. The messages that are about to be sent by the Chat server to end devices.
- `chat_offline`: Offline messages. The messages that are not sent by the Chat server as the end user is offline.
|
| `timestamp` | Long | The Unix timestamp when the Chat server receives the callback event, in milliseconds. |
| `chat_type` | String | The type of chat. - `chat`: One-to-one chats.
- `groupchat`: Chat groups and chat rooms.
|
@@ -1051,7 +1051,7 @@ When a user performs operations on the contacts in the Chat app, the Chat server
| Field | Data Type | Description |
| --- | --- | --- |
| `chat_type` | String | The type of the event. `roster` indicates an event occurred in user contacts. |
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `eventType` | String | The message type of the callback. - `chat`: Uplink messages. The messages that are about to be sent by the Chat server to end devices.
- `chat_offline`: Offline messages. The messages that are not sent by the Chat server as the end user is offline.
|
| `timestamp` | Long | The Unix timestamp when the Chat server receives the callback event, in milliseconds. |
| `from` | String | The user who operates the contact. |
@@ -1198,7 +1198,7 @@ When a user sends an receipt, the Chat server sends a callback to your app serve
| Field | Data Type | Description |
| :---------- | :------- | :----------------------------------------------------------- |
| `chat_type` | String | The type of the event. - `read_ack`: Read receipts.
- `delivery_ack`: Delivery receipts.
|
-| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{file_uuid}`, where the value of `file_uuid` is randomly generated. |
+| `callId` | String | The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated. |
| `security` | String | The signature in the callback request used to confirm whether this callback is sent from the Chat server. The signature is the MD5 hash of the `{callId} + {secret} + {timestamp}` string, where the value of `secret` can be found on .|
| `payload` | Object | The structure of the callback event that contains the following fields:- `ext`: The message extension field.
- `ack_message_id`: The message ID of the receipt callback.
- `bodies`: The message body.
|
| `host` | String | The domain name assigned by the Chat service to access RESTful APIs. |
@@ -1207,4 +1207,49 @@ When a user sends an receipt, the Chat server sends a callback to your app serve
| `to` | String | The ID of the user who receives the receipt. |
| `eventType` | String | The message type of the callback. - `chat`: Uplink messages. The messages that are about to be sent by the Chat server to end devices.
- `chat_offline`: Offline messages. The messages that are not sent by the Chat server as the end user is offline.
|
| `timestamp` | long | The Unix timestamp when the Chat server receives the callback event, in milliseconds. |
-| `msg_id` | String | The message ID of the receipt. |
\ No newline at end of file
+| `msg_id` | String | The message ID of the receipt. |
+
+## Content moderation result
+
+When the message moderation is complete, the Chat server sends the moderation result to your app server.
+
+The sample code is as follows:
+
+```json
+ {
+ "callId": "100220419126072#demo_54ae7e93-xxxx-xxxx-92f5-323e33187243",
+ "moderationResult": "PASS",
+ "providerResult": "PASS",
+ "security": "1f4857f120b2789b7d0abcd372c4f9e8",
+ "messageType": "txt",
+ "messageId": "1F4MX6iSdI7VFnN7Hm0vrcr3Uwr",
+ "targetType": "chat",
+ "appkey": "100220419126072#lydemo",
+ "source": {
+
+ },
+ "eventType": "moderation",
+ "from": "qa2",
+ "to": "qa1",
+ "url": "",
+ "msg": "Hello",
+ "timestamp": 1668766253245
+}
+```
+
+| Parameter | Type | Description |
+| :------------ | :----- | :----------------------------------------------- |
+| `callId` | String| The ID of the callback. The unique identifier assigned to each callback, in the format of `{appKey}_{uuid}`, where the value of `uuid` is randomly generated.|
+| `moderationResult` | String | The message handling result:
- `PASS`:Send the message.
- `REJECT`: Reject sending the message.
- `EXCHANGE`: Replace the sensitive content in the message.
- `RECALL`: Recall the voice or video that is sent. |
+| `providerResult` | String | The message moderation result:
- `PASS`: The message does not contain inappropriate content.
- `REVIEWED`:The message is suspected of containing inappropriate content.
- `REJECT`:The message contains inappropriate content. |
+| `security` | String | The signature in the callback request used to confirm whether this callback is sent from the Chat server. The signature is the MD5 hash of the `{callId} + {secret} + {timestamp}` string, where the value of secret can be found on . |
+| `messageType` | String | The message text:
- `txt`: Text message.
- `img`: Image message.
- `audio`: Voice message.
- `video`: Video message.
- `custom`: Custom message. |
+| `messageId` | String | Message ID. |
+| `targetType` | String | Conversation type:
- `chat: One-to-one chat.
- `groupchat`: Group chat.
- `chatroom`: Chat room. |
+| `appkey` | String | The key of the app. The unique identifier assigned to each app by the Chat service. |
+| `eventType` | String | The event type, which is `moderation` for the moderation service. |
+| `from` | String | The user ID of the message sender. |
+| `to` | String | The message recipient:
- One-to-one chat: User ID of the message recipient.
- Group chat: Group ID.
- Chat room: Chat room ID.|
+| `msg` | String | The content of the text message. This parameter is valid only when `messageType` is `txt`. |
+| `url` | String | The URL of the attachment message, like a voice, video, or image message. This parameter is valid only when `messageType` is `img`, `audio`, or `video`. |
+| `timestamp` | Number | The Unix timestamp when the Chat server receives the callback event, in milliseconds. |
\ No newline at end of file
diff --git a/shared/chat-sdk/reference/_http-status-codes.mdx b/shared/chat-sdk/reference/_http-status-codes.mdx
index 44e27dfd4..55f713b04 100644
--- a/shared/chat-sdk/reference/_http-status-codes.mdx
+++ b/shared/chat-sdk/reference/_http-status-codes.mdx
@@ -21,7 +21,6 @@ This status code indicates that the API request could not be understood by the s
| `400` | `illegal_argument` | "Entity 'user' requires a property named username." | The error message returned because the username is not specified when registering users. |
| `400` | `illegal_argument` | "Password or pin must provided." | The error message returned because the password is not specified when registering users. |
| `400` | `illegal_argument` | "New password is required. Old password is required." | The error message returned because the new password or old password is not provided when changing passwords. |
-| `400` | `illegal_argument` | "Group member `{username}` doesn’t exist." | The error message returned because the specified username does not exist when adding users to a chat group. |
| `400` | `illegal_argument` | "This is an invalid request." | The error message returned because the request URL, the request header, or the request body is invalid. |
| `400` | `illegal_argument` | "'From' can't be empty." | The error message returned because the sender is not specified when sending messages. |
| `400` | `illegal_argument` | "'Target_type' can only be 'users' or 'chatgroups' or 'chatrooms'." | The error message returned because the values other than `users`, `chatgroups`, or `chatrooms` is passed to `target_type` when sending messages |
@@ -73,7 +72,8 @@ This status code indicates that the specified resources of the API request could
| Status code | Error code | Error message | Description |
| :----- | :------------ | :----------------------------------------------------------- | :------------------------------------------------|
| `404` | `organization_application_not_found` | "Could not find application for `{org_url}` from URI: `{app_url}`/token." | The error message returned because the specified organization or application does not exist. |
-| `404` | `service_resource_not_found` | "Service resource not found." | The error message returned because the specified user, chat group, or chat room does not exist. |
+| `404` | `service_resource_not_found` | "Service resource not found." | The error message returned in one of the following scenarios: - The specified user does not exist when you call APIs related to the user system.
- The specified group does not exist when you call group-related APIs.
- The specified chat room does not exist when you call APIs related to the chat room.
|
+| `404` | `resource_not_found` | "username XXXX doesn't exist" | The specified user does not exist. For example, the user that you invite to join the group during group creation does not exist. |
| `404` | `service_resource_not_found` | "Service resource not found." | The error message returned because either the specified user being queried or removed does not exist, or dirty data blocks the proper read operation. To address the dirty read problem, you can pass in the UUID to delete the existing user and register with the same username again. |
| `404` | `storage_object_not_found` | "Failed to find chat message history download url for appkey: `{app_key}`, time: `{yyyymmddhh}`." | The error message returned because no chat history exists within the queried time period. To double check, [submit a ticket](https://agora-ticket.agora.io/) to Agora Support. |
@@ -88,7 +88,7 @@ This status code indicates that the API request is larger than the server can pr
| Status code | Error code | Error message | Description |
| :----- | :------------ | :----------------------------------------------------------- | :------------------------------------------------|
-| `413` | `Request Entity Too Large` | "Request Entity Too Large." | The error message returned because the size of the client request exceeds the maximum size limit of the server. For example, the message body exceeds 5 KB or the uploaded files exceed 10 MB. |
+| `413` | `Request Entity Too Large` | "Request Entity Too Large." | The error message returned because the size of the uploaded message attachment exceeds the upper limit. |
### 415 Unsupported Media Type
This status code indicates that the format of the API request is not supported by the server.
diff --git a/shared/chat-sdk/restful-api/_message-management.mdx b/shared/chat-sdk/restful-api/_message-management.mdx
index d8da30778..ac02b765e 100644
--- a/shared/chat-sdk/restful-api/_message-management.mdx
+++ b/shared/chat-sdk/restful-api/_message-management.mdx
@@ -1067,7 +1067,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
```shell
# Replace {YourAppToken} with the app token generated on your server, and the path of file with the local full path where the file to be uploaded is located
-curl -L -X POST 'https://XXXX/XXXX/XXXX/chatfiles' -H 'Authorization: Bearer ' -H 'Content-Type: multipart/form-data; boundary=---WebKitFormBoundary7MA4YWxkTrZu0gW' -H 'restrict-access: true' -F 'file="@/Users/test/9.2/agora/image/IMG_2953.JPG"'
+curl -X POST 'https://XXXX/XXXX/XXXX/chatfiles' -H 'Authorization: Bearer ' -H 'Content-Type: multipart/form-data; boundary=---WebKitFormBoundary7MA4YWxkTrZu0gW' -H 'restrict-access: true' -F 'file="@/Users/test/9.2/agora/image/IMG_2953.JPG"'
```
#### Response example
diff --git a/shared/chat-sdk/restful-api/_offline-push-configuration.mdx b/shared/chat-sdk/restful-api/_offline-push-configuration.mdx
index af9acc6b5..0e8aac0ad 100644
--- a/shared/chat-sdk/restful-api/_offline-push-configuration.mdx
+++ b/shared/chat-sdk/restful-api/_offline-push-configuration.mdx
@@ -57,12 +57,16 @@ For each App Key, the total call frequency limit of this method and the method t
### HTTP request
```html
-PUT https://{host}/{org_name}/{app_name}/users/{username}
+PUT https://{host}/{org_name}/{app_name}/users/{userId}
```
#### Path parameter
-For the descriptions of path parameters, see [Common Parameters](#request).
+| Parameter | Type | Description | Required |
+|:---------------| :------ | :------- |:------------------|
+| `userId` | String | The user ID of the current user. | Yes |
+
+For the descriptions of other path parameters, see [Common Parameters](#param).
#### Request header
@@ -141,17 +145,22 @@ For each App Key, the total call frequency limit of this method and the method t
### HTTP request
```html
-PUT https://{host}/{org_name}/{app_name}/users/{username}
+PUT https://{host}/{org_name}/{app_name}/users/{userId}
```
#### Path parameter
-For the descriptions of path parameters, see [Common Parameters](#request).
+| Parameter | Type | Description | Required |
+|:---------------| :------ | :------- |:------------------|
+| `userId` | String | The user ID of the current user. | Yes |
+
+For the descriptions of other path parameters, see [Common Parameters](#param).
#### Request header
| Parameter | Type | Description | Required |
| :----- | :----- | :------- | -------- |
+| `Content-Type` | String | The content type. Set it as `application/json`. | Yes |
| `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${YourAppToken}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes |
#### Request body
@@ -187,7 +196,10 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -X PUT -H "Authorization: Bearer " -i https://XXXX/XXXX/XXXX/users/a -d '{"notification_display_style": "1"}'
+curl -X PUT https://XXXX/XXXX/XXXX/users/XXXX \
+-H 'Content-Type: application/json' \
+-H "Authorization: Bearer " \
+-d '{"notification_display_style": "1"}'
```
#### Response example
@@ -197,7 +209,7 @@ curl -X PUT -H "Authorization: Bearer " -i https://XXXX/XXXX/XXXX/
"action" : "put",
"application" : "17d59e50-XXXX-XXXX-8092-0dc80c0f5e99",
"path" : "/users",
- "uri" : "https://XXXX/XXXX/XXXX/users",
+ "uri" : "https://XXXX/XXXX/XXXX/users/XXXX",
"entities" : [
{
"uuid" : "3b8c9890-XXXX-XXXX-9d88-f50bf55cafad",
@@ -234,6 +246,7 @@ PUT https://{host}/{org}/{app}/users/{username}/notification/{chattype}/{key}
| Parameter | Type | Description | Required |
| :----- | :----- | :------- | -------- |
+| `userId` | String | The user ID of the current user. | Yes |
| `chattype` | String | The type of the chat:`user`: One-to-one chats.`chatgroup`: Group chats. | Yes |
| `key` | String | The identifier of the chat:If `type` is set to `user`, `key` indicates the user ID of the peer user.If `type` is set to `chatgroup`, `key` indicates the ID of the chat group. | Yes |
@@ -279,10 +292,10 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -L -X PUT 'http://XXXX/XXXX/XXXX/users/{username}/notification/user/{key}' \
+curl -L -X PUT 'http://XXXX/XXXX/XXXX/users/XXXX/notification/user/XXXX' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
---data-raw '{
+-d '{
"type":"NONE",
"ignoreInterval":"21:30-08:00",
"ignoreDuration":86400000
@@ -294,7 +307,7 @@ curl -L -X PUT 'http://XXXX/XXXX/XXXX/users/{username}/notification/user/{key}'
```json
{
"path": "/users",
- "uri": "https://XXXX/XXXX/XXXX/users/notification/user/hxtest",
+ "uri": "https://XXXX/XXXX/XXXX/users/notification/user/XXXX",
"timestamp": 1647503749918,
"organization": "XXX",
"application": "17fe201b-XXXX-XXXX-83df-1ed1ebd7b227",
@@ -319,13 +332,14 @@ For each App Key, the call frequency limit of this method is 100 per second.
### HTTP request
```html
-GET https://{host}/{org_name}/{app_name}/users/{username}/notification/{chattype}/{key}
+GET https://{host}/{org_name}/{app_name}/users/{userId}/notification/{chattype}/{key}
```
#### Path parameter
| Parameter | Type | Description | Required |
| :----- | :----- | :------- | -------- |
+| `userId` | String | The user ID of the current user. | Yes |
| `chattype` | String | The type of the chat:`user`: One-to-one chats.`chatgroup`: Group chats. | Yes |
| `key` | String | The identifier of the chat:If `type` is set to `user`, `key` indicates the user ID of the peer user.If `type` is set to `chatgroup`, `key` indicates the ID of the chat group. | Yes |
@@ -358,7 +372,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -L -X GET 'https://XXXX/XXXX/XXXX/users/{username}/notification/chatgroup/{key}' \
+curl -L -X GET 'https://XXXX/XXXX/XXXX/users/XXXX/notification/chatgroup/XXXX' \
-H 'Authorization: Bearer '
```
@@ -392,11 +406,15 @@ For each App Key, the call frequency limit of this method is 100 per second.
### HTTP request
```html
-PUT https://{host}/{org_name}/{app_name}/users/{username}/notification/language
+PUT https://{host}/{org_name}/{app_name}/users/{userId}/notification/language
```
#### Path parameter
+| Parameter | Type | Description | Required |
+| :----- | :----- | :------- | -------- |
+| `userId` | String | The user ID of the current user. | Yes |
+
For the descriptions of path parameters, see [Common Parameters](#request).
#### Request header
@@ -431,10 +449,10 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -L -X PUT 'https://XXXX/XXXX/XXXX/users/{username}/notification/language' \
+curl -L -X PUT 'https://XXXX/XXXX/XXXX/users/XXXX/notification/language' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
---data-raw '{
+-d '{
"translationLanguage":"EU"
}'
```
@@ -444,7 +462,7 @@ curl -L -X PUT 'https://XXXX/XXXX/XXXX/users/{username}/notification/language' \
```json
{
"path": "/users",
- "uri": "https://XXXX/XXXX/XXXX/users/notification/language",
+ "uri": "https://XXXX/XXXX/XXXX/users/XXXX/notification/language",
"timestamp": 1648089630244,
"organization": "XXXX",
"application": "17fe201b-XXXX-XXXX-83df-1ed1ebd7b227",
@@ -467,18 +485,21 @@ For each App Key, the call frequency limit of this method is 100 per second.
### HTTP request
```html
-GET https://{host}/{org}/{app}/users/{username}/notification/language
+GET https://{host}/{org}/{app}/users/{userId}/notification/language
```
#### Path parameter
+| Parameter | Type | Description | Required |
+| :----- | :----- | :------- | -------- |
+| `userId` | String | The user ID of the current user. | Yes |
+
For the descriptions of path parameters, see [Common Parameters](#request).
#### Request header
| Parameter | Type | Description | Required |
| :----- | :----- | :------- | -------- |
-| `Content-Type` | String | The content type. Set it as `application/json`. | Yes |
| `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${YourAppToken}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes |
### HTTP response
@@ -500,7 +521,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -L -X GET 'https://XXXX/XXXX/XXXX/users/{username}/notification/language' \
+curl -L -X GET 'https://XXXX/XXXX/XXXX/users/XXXX/notification/language' \
-H 'Authorization: Bearer '
```
@@ -509,7 +530,7 @@ curl -L -X GET 'https://XXXX/XXXX/XXXX/users/{username}/notification/language' \
```json
{
"path": "/users",
- "uri": "https://XXXX/XXXX/XXXX/users/notification/language",
+ "uri": "https://XXXX/XXXX/XXXX/users/XXXX/notification/language",
"timestamp": 1648089630244,
"organization": "XXXX",
"application": "17fe201b-XXXX-XXXX-83df-1ed1ebd7b227",
@@ -580,7 +601,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
curl -X POST 'https://XXXX/XXXX/XXXX/notification/template' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
---data-raw '{
+-d '{
"name": "test7",
"title_pattern": "Hello,{0}",
"content_pattern": "Test,{0}"
@@ -658,7 +679,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -X GET 'https://XXXX/XXXX/XXXX/notification/template/{name}' \
+curl -X GET 'https://XXXX/XXXX/XXXX/notification/template/XXXX' \
-H 'Authorization: Bearer '
```
@@ -666,7 +687,7 @@ curl -X GET 'https://XXXX/XXXX/XXXX/notification/template/{name}' \
```json
{
- "uri": "https://XXXX/XXXX/XXXX/notification/template/test7",
+ "uri": "https://XXXX/XXXX/XXXX/notification/template/XXXX",
"timestamp": 1646989686393,
"organization": "XXXX",
"application": "17fe201b-XXXX-XXXX-83df-1ed1ebd7b227",
@@ -733,7 +754,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer
#### Request example
```bash
-curl -X DELETE 'https://XXXX/XXXX/XXXX/notification/template' \
+curl -X DELETE 'https://XXXX/XXXX/XXXX/notification/template/XXXX' \
-H 'Authorization: Bearer '
```
@@ -741,7 +762,7 @@ curl -X DELETE 'https://XXXX/XXXX/XXXX/notification/template' \
```json
{
- "uri": "https://XXXX/XXXX/XXXX/notification/template",
+ "uri": "https://XXXX/XXXX/XXXX/notification/template/XXXX",
"timestamp": 1646989686393,
"organization": "XXXX",
"application": "17fe201b-XXXX-XXXX-83df-1ed1ebd7b227",
diff --git a/shared/common/_restful-authentication.mdx b/shared/common/_restful-authentication.mdx
index d9fcf9ac7..6498e1f4b 100644
--- a/shared/common/_restful-authentication.mdx
+++ b/shared/common/_restful-authentication.mdx
@@ -11,7 +11,7 @@ Available REST authentication methods are:
- **Basic HTTP authentication**
- You need to generate a Base64-encoded credential with the Customer ID and Customer Secret provided by and pass the credential to the `Authorization` parameter in the request header.
+ You need to generate a Base64-encoded credential with the customer ID and customer secret provided by and pass the credential to the `Authorization` parameter in the request header.
@@ -20,6 +20,12 @@ Available REST authentication methods are:
+
+- **HMAC HTTP authentication**
+
+ You need to generate a signature through the HMAC-SHA256 algorithm and pass the signature and related information to the `Authorization` parameter in the request header. This option is recommended since it has a higher security level.
+
+
Implement authentication on the server; otherwise, you may encounter the risk of data leakage.
@@ -27,19 +33,19 @@ Implement authentication on the server; otherwise, you may encounter the risk of
### Generate Customer ID and Customer Secret
-To generate a set of Customer ID and Customer Secret, do the following:
+To generate a set of customer ID and customer secret, do the following:
1. In , click **Developer Toolkit** > **RESTful API**.
![RESTful API](/images/common/console-restful-api.png)
-2. Click **Add a Secret**. A set of Customer ID and Customer Secret is generated.
+2. Click **Add a secret**, and click **OK**. A set of customer ID and customer secret is generated.
3. Click **Download** in the **Customer Secret** column. Read the pop-up window carefully, and save the downloaded `key_and_secret.txt` file in a secure location.
-4. Use the Customer ID (key) and Customer Secret (secret) to generate a Base64-encoded credential, and pass the Base64-encoded credential to the `Authorization` parameter in the HTTP request header.
+4. Use the customer ID (key) and customer secret (secret) to generate a Base64-encoded credential, and pass the Base64-encoded credential to the `Authorization` parameter in the HTTP request header.
-You can download the Customer Secret from the only once. Be sure to keep it secure.
+You can download the customer secret from only once. Be sure to keep it secure.
### Basic authentication sample code
@@ -351,3 +357,60 @@ print(data.decode("utf-8"))`}
+
+
+## Implement HMAC HTTP authentication
+
+To implement HMAC HTTP authentication, you need the following information:
+
+- App ID
+- Customer ID and customer secret
+
+### HMAC authentication sample code
+
+The following sample code demonstrates how to generate the value of the `Authorization` field:
+
+```javascript
+const crypto = require('crypto');
+const http = require('http');
+
+// The app ID of your Agora project
+appid = ""
+// The customer ID obtained from the RESTful API of the Agora Console
+customer_username = ""
+// The customer secret obtained from the RESTful API of the Agora Console
+customer_secret = ""
+// Request package body
+data = ""
+
+function hashData(data) {
+ const hash = crypto.createHash('sha256');
+ hash.update(data);
+ return hash.digest('base64');
+}
+function signData(data) {
+ const hmac = crypto.createHmac('sha256', customer_secret);
+ hmac.update(data);
+ return hmac.digest('base64');
+}
+
+date = (new Date()).toUTCString();
+reqpath = `/cn/v1/projects/${appid}/rtls/ingress/appconfig`;
+reqline = `GET ${reqpath} HTTP/1.1`;
+// Calculate the SHA-256 hash
+bodySign = hashData(args.data);
+digest = `SHA-256=${bodySign}`;
+// Generate signature
+signingStr = `host: ${host}\ndate: ${date}\n${reqline}\ndigest: ${digest}`;
+sign = signData(signingStr);
+
+auth = `hmac username="${customer_username}", `
+auth += `algorithm="hmac-sha256", `
+auth += `headers="host date request-line digest", `
+auth += `signature="${sign}"`;
+
+console.log(`Authorization: ${auth}`);
+```
+
+
+
diff --git a/shared/extensions-marketplace/virtual-background.mdx b/shared/extensions-marketplace/virtual-background.mdx
index 9cb9278c3..20941b3c6 100644
--- a/shared/extensions-marketplace/virtual-background.mdx
+++ b/shared/extensions-marketplace/virtual-background.mdx
@@ -20,22 +20,23 @@ Try out the [online demo](https://webdemo-global.agora.io/index.html) for [Virtu
| Feature | Example |
| ---- | ---- |
-| Blurred background and image background | ![](https://web-cdn.agora.io/docs-files/1647325748630) |
+| Blurred background and image background | ![](/images/extensions-marketplace/blurred-background.jpg) |
| Video/Animated background | |
-| Portrait-in-picture | ![portrait-in-picture](/images/video-sdk/portrait-in-picture.png) Allows the presenter to use slides as the virtual background while superimposing their video. The effect is similar to a weather news cast on television, preventing interruptions during a layout toggle. |
+| Portrait-in-picture | ![portrait-in-picture](/images/extensions-marketplace/portrait-in-picture.jpg) Allows the presenter to use slides as the virtual background while superimposing their video. The effect is similar to a weather news cast on television, preventing interruptions during a layout toggle. |
| Feature | Example |
| ---- | ---- |
-| Blurred background and image background | ![](https://web-cdn.agora.io/docs-files/1647325748630) |
+| Blurred background and image background | ![](/images/extensions-marketplace/blurred-background.jpg) |
| Video/Animated background | |
-| Portrait-in-picture | ![portrait-in-picture](/images/video-sdk/portrait-in-picture.png) Allows the presenter to use slides as the virtual background while superimposing their video. The effect is similar to a weather news cast on television, preventing interruptions during a layout toggle. |
+| Portrait-in-picture | ![portrait-in-picture](/images/extensions-marketplace/portrait-in-picture.jpg) Allows the presenter to use slides as the virtual background while superimposing their video. The effect is similar to a weather news cast on television, preventing interruptions during a layout toggle. |
|Together Mode | ![together-mode](/images/video-sdk/together-mode.png) Allows the presenter to segment the portrait in the remote video, transmit it locally, and customize the display. |
+
Want to test ? Try the online demo.
diff --git a/shared/flexible-classroom/classroom-sdk/js.mdx b/shared/flexible-classroom/classroom-sdk/js.mdx
index 94ee776d2..c14ff64b2 100644
--- a/shared/flexible-classroom/classroom-sdk/js.mdx
+++ b/shared/flexible-classroom/classroom-sdk/js.mdx
@@ -116,6 +116,11 @@ export type ConfigParams = {
| `appId` | (Required) The Agora App ID. See [Get the Agora App ID](../get-started/manage-agora-account#get-the-app-id). |
| `region` | (Optional) The region where the classrooms is located. Agora recommends you set a region close to the region of the object storage service for your courseware or recording files, because cross-region transmission of large static resources can lead to delay. For example, if your S3 service is in North America, you should set this parameter to `NA`. All Smart Classroom clients must set the same area, otherwise they cannot communicate with each other. All clients must use the same region, otherwise, they may fail to communicate with each other. Flexible Classroom supports the following regions:`CN`: Mainland China`AP`: Asia Pacific`EU`: Europe`NA`: North America |
+### ListenerCallback
+
+```typescript
+export type ListenerCallback = (evt: AgoraEduClassroomEvent, ...args: unknown[]) => void;
+```
### LaunchOption
@@ -160,7 +165,7 @@ export type LaunchOption = {
| `roleType` | (Required) The role of the user in the classroom. See [`EduRoleTypeEnum`](#eduroletypeenum). |
| `roomType` | (Required) The classroom type. See [`EduRoomTypeEnum`](#eduroomtypeenum). |
| `roomServiceType` | (Optional) The service type of big classrooms. See [EduRoomServiceTypeEnum](#eduroomservicetypeenum). |
-| `listener` | (Required) The state of classroom launching.`ready`: The classroom is ready.`destroyed`: The classroom has been destroyed. |
+| `listener` | (Required) Classroom event callback, please refer to the event type for details. |
| `pretest` | (Required) Whether to enable the pre-class device test:`true`: Enable the pre-class device test. After this function is enabled, end users can see a page for the device test before entering the classroom. They can check whether their camera, microphone, and speaker can work properly.`false`: Disable the pre-class device test. |
| `language` | (Required) The UI language. See [`LanguageEnum`](#languageenum). |
| `startTime` | (Required) The start time (ms) of the class, determined by the first user joining the classroom. |
diff --git a/shared/flexible-classroom/integrate-flexible-classroom-fcr/web.mdx b/shared/flexible-classroom/integrate-flexible-classroom-fcr/web.mdx
index 5440550d5..9b6d45b54 100644
--- a/shared/flexible-classroom/integrate-flexible-classroom-fcr/web.mdx
+++ b/shared/flexible-classroom/integrate-flexible-classroom-fcr/web.mdx
@@ -86,7 +86,7 @@ If you are satisfied with the default UI of Cloud Classroom and do not want to c
userUuid: "user id",
userName: "user name",
roomUuid: "room id",
- roomType: 4, // Room type: 4 is for small classes, currently only small classes are supported.
+ roomType: 10, // Room type: 10 for Cloud Class.
roomName: "room name",
pretest: true, // Whether to enable pre-class equipment detection
token: "rtm token", // In a test environment, you can use temporary RTM Token; in a production or security environment, it is strongly recommended that you use a server-generated RTM Token.
@@ -124,84 +124,81 @@ If you are satisfied with the default UI of Cloud Classroom and do not want to c
```html
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+