From f992dac69731b3aac473076cf32df0af6fdeb841 Mon Sep 17 00:00:00 2001 From: haoxiuwen Date: Mon, 2 Dec 2024 10:46:41 +0800 Subject: [PATCH] modify --- .../agora_chat_restful_contact.md | 5 ++-- .../agora_chat_restful_global_mute.md | 22 +++++++++------ .../agora_chat_restful_message.md | 2 +- .../agora_chat_restful_presence.md | 28 +++++++++++++------ .../agora_chat_restful_user_attributes.md | 17 ++++++----- 5 files changed, 47 insertions(+), 27 deletions(-) diff --git a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_contact.md b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_contact.md index 8dc2f8d8454..5308dea44ad 100644 --- a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_contact.md +++ b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_contact.md @@ -374,7 +374,7 @@ The request body is a JSON object, which contains the following fields: | Field | Type | Description | Required | | :-------- | :--------- | :------------------------------------------------ | :------- | -| `usernames` | An array of usernames | The usernames to be added to the block list, such as ["user1", "user2"]. You can pass in a maximum of 50 user IDs each time. | Yes | +| `usernames` | Array | The usernames to be added to the block list, such as ["user1", "user2"]. You can pass in a maximum of 50 user IDs each time. | Yes | ### HTTP response @@ -443,7 +443,7 @@ For other parameters and detailed descriptions, see [Common parameters](#param). | `pageSize` | Number | The number of users on the block list that you expect to retrieve on each page. The value range is [1,50]. | No | | `cursor` | String | Where to start getting data. | No | -
If neither `pageSize` nor `cursor` is specified, the server returns the block list of up to 500 users that are added most recently. If `pageSize` is specified and `cursor` is ignored, the server returns the block list of up to 50 users are added most recently.
+
If neither `pageSize` nor `cursor` is specified, the server returns the block list of up to 500 users that are added most recently. If `pageSize` is specified and `cursor` is ignored, the server returns the block list of up to 50 users that are added most recently.
#### Request header @@ -483,6 +483,7 @@ curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer {YourAppToke "uri": "http://XXXX/XXXX/XXXX/users/user1/blocks/users", "timestamp": 1542599978751, "entities": [], + "cursor": "MTA5OTAwMzMwNDUzNTA2ODY1NA==", "count": 2, "action": "get", "data": [ diff --git a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_global_mute.md b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_global_mute.md index a1a7f38640d..27439538bf1 100644 --- a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_global_mute.md +++ b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_global_mute.md @@ -53,7 +53,7 @@ For each App Key, the call frequency limit of this method is 100 per second. ### HTTP request ```http -POST https://{host}/{orgName}/{appName}/mutes +POST https://{host}/{org_name}/{app_name}/mutes ``` #### Path parameter @@ -74,6 +74,7 @@ For parameters and the detailed descriptions, see [Commom parameters](#param). | Parameter | Type | Description | | --- | --- | --- | | `Content-Type` | String | The content type. Set is as `application/json`. | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or admin, in the format of `Bearer ${YourAppToken}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | ### HTTP response @@ -96,6 +97,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer curl -L -X POST 'https://XXXX/XXXX/XXXX/mutes' \ -H 'Authorization: Bearer {YourAppToken}' \ -H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ --data-raw '{ "username": "XXXX", "chat": 100, @@ -147,7 +149,8 @@ For other parameters and the detailed descriptions, see [Commom parameters](#par | Parameter | Type | Description | | --- | --- | --- | | `Content-Type` | String | The content type. Set is as `application/json`. | -| `Authorization` | String | The authentication token of the user or admin, in the format of `Bearer ${YourAppToken}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | +| `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${token}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes | ### HTTP response @@ -158,7 +161,7 @@ If the returned HTTP status code is `200`, the request succeeds, and the respons | `userid` | String | The user ID whose global-mute settings you want to query. | | `chat` | Number | The remaining time that this user is muted in one-to-one chats, in seconds. The maximum value is 2,147,483,647. | | `groupchat` | Number | The remaining time that this user is muted in group chats, in seconds. The maximum value is 2,147,483,647. | -| `chatroom` | Number | The remaining time that this user is muted in group rooms, in seconds. The maximum value is 2,147,483,647. | +| `chatroom` | Number | The remaining time that this user is muted in chat rooms, in seconds. The maximum value is 2,147,483,647. | | `unixtime` | Number | The Unix timestamp of the current operation. | For other fields and detailed descriptions, see [Common parameters](#param). @@ -172,7 +175,8 @@ If the returned HTTP status code is not `200`, the request fails. You can refer ```shell curl -L -X GET 'https://XXXX/XXXX/XXXX/mutes/{username}' \ -H 'Authorization: Bearer {YourAppToken}' \ --H 'Content-Type: application/json' +-H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ ``` #### Response example @@ -206,7 +210,7 @@ For each App Key, the call frequency limit of this method is 100 per second. ### HTTP request ```http -GET https://{host}/{orgName}/{appName}/mutes +GET https://{host}/{org_name}/{app_name}/mutes ``` #### Path parameter @@ -218,13 +222,14 @@ For parameters and the detailed descriptions, see [Common parameters](#param). | Parameter | Type | Description | | --- | --- | --- | | `Content-Type` | String | The content type. Set is as `application/json`. | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or admin, in the format of `Bearer ${YourAppToken}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | #### Query parameter | Parameter | Type | Required | Description | | --- | --- | --- | --- | -| `pageNum` | Number | No | The number of pages for querying the globally muted users in the app. | +| `pageNum` | Number | No | The number of page for querying the globally muted users in the app. | | `pageSize` | Number | No | The number of data entries on each page. The value range is [1,50]. | ### HTTP response @@ -236,7 +241,7 @@ If the returned HTTP status code is `200`, the request succeeds, and the respons | `username` | String | The user ID whose global-mute settings you want to query. | | `chat` | Number | The remaining time that this user is muted in one-to-one chats, in seconds. The maximum value is 2,147,483,647. | | `groupchat` | Number | The remaining time that this user is muted in group chats, in seconds. The maximum value is 2,147,483,647. | -| `chatroom` | Number | The remaining time that this user is muted in group rooms, in seconds. The maximum value is 2,147,483,647. | +| `chatroom` | Number | The remaining time that this user is muted in chat rooms, in seconds. The maximum value is 2,147,483,647. | | `unixtime` | Number | The Unix timestamp of the current operation. | For other fields and detailed descriptions, see [Common parameters](#param). @@ -250,7 +255,8 @@ If the returned HTTP status code is not `200`, the request fails. You can refer ```shell curl -L -X GET 'https://XXXX/XXXX/XXXX/mutes?pageNum=1&pageSize=10' \ -H 'Authorization: Bearer {YourAppToken}' \ --H 'Content-Type: application/json' +-H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ ``` #### Response example diff --git a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_message.md b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_message.md index d092750faa6..4bc021603e0 100644 --- a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_message.md +++ b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_message.md @@ -91,7 +91,7 @@ The request body is a JSON object, which contains the following parameters: | Parameter | Type | Description | Required | | --- | --- | --- | --- | | `from` | String | The username of the message sender. If you do not set this field, the Chat server takes the `admin` as the sender. If you set it as the empty string "", this request fails. | No | -| `to` | Array | An array of the usernames of the message recipient. For each request, you can send a message to a maximum of 600 users. Within one minute, you can send messages to a maximum of 6,000 users. | Yes | +| `to` | Array | An array of the usernames of the message recipient. For each request, you can send a message to a maximum of 600 users. Within one minute, you can send 6,000 messages. | Yes | | `type` | String | The message type: | Yes | | `body` | JSON | The message content. For different message types, this parameter contains different fields. For details, see [Body of different message types](#body). | Yes | | `roam_ignore_users` | List | No | Which users cannot obtain such message when they pull messages from the server. A maximum of 20 users can be passed in each time. | diff --git a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_presence.md b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_presence.md index 559d5450d57..3eea1512cc4 100644 --- a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_presence.md +++ b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_presence.md @@ -55,6 +55,7 @@ For the descriptions of the other path parameters, see [Common Parameters](#para | Parameter | Type | Description | Required | |:---------------| :------ | :------- |:------------------| | `Content-Type` | String | The content type. Set it to `application/json`. | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${token}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes | #### Request body @@ -79,10 +80,11 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example -```json +```shell curl -X POST 'http://XXXX/XXXX/XXXX/users/c1/presence/android_123423453246/0' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ -d '{"ext":"123"}' ``` @@ -118,6 +120,7 @@ For the descriptions of the other path parameters, see [Common Parameters](#para | Parameter | Type | Description | Required | |:---------------| :------ | :------- |:------------------| | `Content-Type` | String | The content type. Set it to `application/json`. | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${token}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes | #### Request body @@ -136,7 +139,7 @@ If the returned HTTP status code is `200`, the request succeeds, and the data fi | :------- |:-------------|:-------------| | `result` | JSON | Whether the subscription succeeds. If successful, the presence statuses of the users return; otherwise, you can troubleshoot according to the returned reasons. | | `uid` | String | The unique login account of the user. | -| `last_time` | Number | The Unix timestamp when the user was last online, in seconds. | +| `last_time` | Number | The Unix timestamp when the user was last online, in seconds. The server records the time when the subscribed user logs in or out. | | `expiry` | Number | The Unix timestamp when the subscription expires, in seconds. | | `ext` | String | The extension information of the presence status. | | `status` | JSON | The presence statuses on multiple devices of the user. | @@ -147,10 +150,11 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example -```json +```shell curl -X POST 'http://XXXX/XXXX/XXXX/users/wzy/presence/1000' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ -d '{"usernames":["c2","c3"]}' ``` @@ -188,6 +192,7 @@ For other parameters and descriptions, see [Common Parameters](#param). | Parameter | Type | Description | Required | |:---------------| :------ | :------- |:------------------| | `Content-Type` | String | The content type. Set it to `application/json`. | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${token}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes | #### Request body @@ -216,10 +221,11 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example -```json +```shell curl -X POST 'http://XXXX/XXXX/XXXX/users/wzy/presence' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ -d '{"usernames":["c2","c3"]}' ``` @@ -268,6 +274,7 @@ For other parameters and descriptions, see [Common Parameters](#param). | Parameter | Type | Description | Required | |:---------------| :------ | :------- |:------------------| | `Content-Type` | String | The content type. Set it to `application/json`. | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${token}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes | #### Request body @@ -292,10 +299,11 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example -```json +```shell curl -X DELETE 'http://XXXX/XXXX/XXXX/users/wzy/presence' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ +-H 'Accept: application/json' \ -d '["c1"]' ``` @@ -314,14 +322,14 @@ For each App Key, the call frequency limit of this method is 50 per second. ### HTTP request ```http -GET https://{host}/{org_name}/{app_name}/users/{uid}/presence/sublist?pageNum=1&pageSize=100 +GET https://{host}/{org_name}/{app_name}/users/{uid}/presence/sublist?pageNum={pagenumber}&pageSize={pagesize} ``` #### Path parameter | Parameter | Type | Description | Required | |:---------------| :------ | :------- |:------------------| -| `uid` | String | The user for which the subscriptions are retrieved. | Yes | +| `uid` | String | The user for which the subscriptions are retrieved. If the user ID you passed in does not exist or the user does not subscribe to the presence status of any users, an empty list is returned. | Yes | For other parameters and descriptions, see [Common Parameters](#param). @@ -337,6 +345,7 @@ For other parameters and descriptions, see [Common Parameters](#param). | Parameter | Type | Description | Required | |:---------------| :------ | :------- |:------------------| | `Content-Type` | String | The content type. Set it to `application/json`. | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or administrator, in the format of `Bearer ${token}`, where `Bearer` is a fixed character, followed by an English space, and then the obtained token value. | Yes | ### HTTP response @@ -359,10 +368,11 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example -```json +```shell curl -X GET 'http://XXXX/XXXX/XXXX/users/wzy/presence/sublist?pageNum=1&pageSize=100' \ -H 'Authorization: Bearer ' \ --H 'Content-Type: application/json' +-H 'Content-Type: application/json' \ +-H 'Accept: application/json' ``` #### Response example diff --git a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_user_attributes.md b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_user_attributes.md index ac5ca57fcf7..53bd1b7beda 100644 --- a/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_user_attributes.md +++ b/en-US/markdown/agora-chat/RESTful API Reference/agora_chat_restful_user_attributes.md @@ -1,4 +1,4 @@ -User attributes refers to the label information added for the user, including key-value pairs. +User attributes refers to the user information, including user nickname, avatar, email address, mobile numbers, sex, signature, and birth date. The user attributes are added as key-value pairs. This page shows how to call Agora Chat RESTful APIs to manage user attributes, including adding, deleting, modifying, and retrieving user attributes. @@ -73,7 +73,7 @@ For the parameters and detailed descriptions, see [Common parameters](#param). #### Request body -The request body is in the format of JSON String. The request body contains the following fields: +The request body is in the format of `www-form-urlencoded`. The request body contains the following fields: | Field | Type | Description | Required | | :------ | :----- | :----- | :------- | @@ -152,7 +152,7 @@ For the parameters and detailed descriptions, see [Common parameters](#param). | Parameter | Type | Description | Required | | :-------------- | :----- | :--------------------- | :------- | -| `Content-Type` | String | `application/json` | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or admin, 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 @@ -175,7 +175,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer ```shell # Replace {YourAppToken} with the app token generated in your server. -curl -X GET -H 'Authorization: Bearer {YourAppToken}' -H 'Content-Type: application/json''http://XXXX/XXXX/XXXX/metadata/user/XXXX' +curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer {YourAppToken}''http://XXXX/XXXX/XXXX/metadata/user/XXXX' ``` #### Response example @@ -213,6 +213,7 @@ For the parameters and detailed descriptions, see [Common parameters](#param). | Parameter | Type | Description | Required | | :-------------- | :----- | :--------------------- | :------- | | `Content-Type` | String | `application/json` | Yes | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or admin, 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 @@ -244,7 +245,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer ```shell # Replace {YourAppToken} with the app token generated in your server. -curl -X POST -H 'Authorization: Bearer {YourAppToken}' -H 'Content-Type: application/json' -d '{ +curl -X POST -H 'Accept: application/json' -H 'Authorization: Bearer {YourAppToken}' -H 'Content-Type: application/json' -d '{ "properties": [ "avatar", "ext", @@ -304,6 +305,7 @@ For the parameters and detailed descriptions, see [Common parameters](#param). | Parameter | Type | Description | Required | | :-------------- | :----- | :--------------------- | :------- | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or admin, 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 @@ -325,7 +327,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example ```shell -curl -X GET -H 'Authorization: Bearer {YourAppToken}''http://XXXX/XXXX/XXXX/metadata/user/capacity' +curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer {YourAppToken}''http://XXXX/XXXX/XXXX/metadata/user/capacity' ``` #### Response example @@ -358,6 +360,7 @@ For the parameters and detailed descriptions, see [Common parameters](#param). | Parameter | Type | Description | Required | | :-------------- | :----- | :--------------------- | :------- | +| `Accept` | String | The parameter type. Set it as `application/json`. | Yes | | `Authorization` | String | The authentication token of the user or admin, 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 @@ -379,7 +382,7 @@ If the returned HTTP status code is not `200`, the request fails. You can refer #### Request example ```shell -curl -X DELETE -H 'Authorization: Bearer {YourAppToken}' 'http://XXXX/XXXX/XXXX/metadata/user/XXXX' +curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer {YourAppToken}' 'http://XXXX/XXXX/XXXX/metadata/user/XXXX' ``` #### Response example