Chat provides Platform API to manage groups in APP.
There is a limit on the number of groups created by a single APP, if you need to increase it, you can contact business to solve it according to your specific business.Only 500 groups can be joined by a single user ID
。
===== Group data structure =====
Field Name | Type | Description |
---|---|---|
id | String | Group ID, a unique identifier for the group, generated by the Chat server, equivalent to the Chat ID of a single user. |
name | String | The name of the group, created based on user input, string type. |
description | String | Group description, created based on user input, string type. |
public | Boolean | Group type: true: public group, false: private group. |
membersonly | Boolean | If or not the group owner or group administrator needs to approve to join the group. true: yes, false: no. |
allowinvites | Boolean | Whether to allow group members to invite others to join this group. true: Allow group members to invite people to join the group, false: Only the group owner can add people to the group. Since only private groups allow group members to invite people to join the group, this parameter should be set to true when the group is private. The default is false. |
maxusers | Integer | The maximum number of group members, set when creating the group, can be changed. |
affiliations_count | Integer | The total number of existing members. |
affiliations | Array | List of existing members, including owner and member. e.g.: "affiliations":[{"owner":"13800138001"},{"member":"v3y0kf9arx"},{"member":"xc6xrnbzci"}]. |
owner | String | The Chat letter ID of the group owner. e.g. {"owner":"13800138001"}. |
member | String | The group member's Chat letter ID. e.g.{"member":"xc6xrnbzci"}. |
invite_need_confirm | Boolean | Invite to join the group, if or not the invitee needs to confirm. If it is true, it means the invitee needs to be confirmed; if it is false, it means the invitee does not need to be confirmed, and the invitee will be added to the group directly. The default value of this field is true. |
custom | String | The extended information of the group. |
mute | Boolean | Indicates if the group is muted. true: yes, false: no. |
Group Roles
In addition to group owner and general group members, the group administrator role is added.
Group role permission range: group owner > group administrator > normal group members
- group owner has all the permissions of the group.
- Group administrator has the permission to manage blacklist, mute, etc.
- Group owner + administrator 100 in total, that is, the administrator can add up to 99
Platform API
The Platform APIs that are used in the IM group integration process The documentation is detailed and can be tested online by using the Platform API embedded in the documentation.
Manage Groups
Chat provides multiple interfaces to complete group-related integration, including the creation, acquisition, modification, deletion and other management functions for groups.
Name | Request | Description |
---|---|---|
Get all groups in the app (can be paginated) | /{org_name}/{app_name}/chatgroups | Get all groups under the app |
Get all groups that a user is in | /{app_name}/users/{username}/joined_chatgroups | Get all groups that a user is in based on their name |
Get group details | /{org_name}/{app_name}/chatgroups/{group_ids} | Get details of this group based on group ID |
Create a group | /{org_name}/{app_name}/chatgroups | Create a new group |
Modify group information | /{org_name}/{app_name}/chatgroups/{group_id} | Modify part of the group's information |
Delete a group | /{org_name}/{app_name}/chatgroups/{group_id} | Delete a group |
Get all the groups in the app (pagable)
Interface to get all the group information under the app in a paginated manner
HTTP Request
GET | /{org_name}/{app_name}/chatgroups |
---|
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
owner | The Chat letter ID of the group owner. e.g.{"owner": "user1}. |
groupid | Group ID |
affiliations | Number of current group members |
type | "group" group type |
last_modified | timestamp of the last modification |
groupname | Group name |
Request Example
First page
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups?limit=2'
Examples of possible returned results
Returns a value of 200, indicating that the acquisition of the group was successful
{
"action": "get",
"params": {
"limit": [
"2"
]
},
"uri": "https://a1.easecdn.com/chat-demo/testapp/chatgroups",
"entities": [],
"data": [
{
"owner": "chat-demo#testapp_user1",
"groupid": "100743775617286960",
"affiliations": 2,
"type": "group",
"last_modified": "1441021038124",
"groupname": "testgroup1"
},
{
"owner": "chat-demo#testapp_user2",
"groupid": "100973270123152176",
"affiliations": 1,
"type": "group",
"last_modified": "1441074471486",
"groupname": "testgroup2"
}
],
"timestamp": 1441094193812,
"duration": 14,
"cursor": "Y2hhdGdyb3VwczplYXNlbW9iLWRlbW8vY2hhdGRlbW91aV8z",
"count": 2
}
Return value 401, unauthorized [no token, token error, token expired ]
{
"error": "group_authorization",
"timestamp": 1542359035948,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
Second page
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups?limit=2&cursor=ZGNiMjRmNGY1YjczYjlhYTNkYjk1MDY2YmEyNzFmODQ6aW06Z3JvdXA6ZWFzZW1vYi1kZW1vI3Rlc3RhcHA6Mg'
Examples of possible returned results
Returns a value of 200, indicating that the acquisition of the group was successful
{
"action": "get",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"params": {
"cursor": [
"ZGNiMjRmNGY1YjczYjlhYTNkYjk1MDY2YmEyNzFmODQ6aW06Z3JvdXA6ZWFzZW1vYi1kZW1vI3Rlc3RhcHA6Mg"
],
"limit": [
"2"
]
},
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups",
"entities": [],
"data": [
{
"groupid": "66016467025921",
"groupname": "testgroup2",
"owner": "chat-demo#testapp_user2",
"affiliations": 1,
"lastModified": 1542356609540,
"type": "group",
"created": 1542356609540
},
{
"groupid": "66016480657410",
"groupname": "testgroup3",
"owner": "chat-demo#testapp_user3",
"affiliations": 1,
"lastModified": 1542356622235,
"type": "group",
"created": 1542356622235
}
],
"timestamp": 1542358693048,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp",
"cursor": "ZGNiMjRmNGY1YjczYjlhYTNkYjk1MDY2YmEyNzFmODQ6aW06Z3JvdXA6ZWFzZW1vYi1kZW1vI3Rlc3RhcHA6Mw",
"count": 2
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542358868326,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Get all groups that a user is a member of
Get all groups that a user has joined based on the user name interface
HTTP Request
GET | /{org_name}/{app_name}/users/{username}/joined_chatgroups |
---|
You need to fill in the {username} corresponding to the IM username you need to get when requesting.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
groupid | Group ID |
groupname | Group name |
Request Example
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/users/user1/joined_chatgroups'
Examples of possible returned results
Returns a value of 200, indicating that the acquisition of the group was successful
{
"action": "get",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/users/user1/joined_chatgroups",
"entities": [],
"data": [
{
"groupid": "66016455491585",
"groupname": "testgroup1"
},
{
"groupid": "66016467025921",
"groupname": "testgroup2"
},
],
"timestamp": 1542359565885,
"duration": 1,
"organization": "chat-demo",
"applicationName": "testapp",
"count": 2
}
Return value 404, this user does not exist
{
"error": "resource_not_found",
"timestamp": 1542359607100,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "username user20 doesn't exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542359664255,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Get group details
You can get the details of one or more groups. When fetching details of multiple groups, details of all existing groups will be returned, for non-existing groups, the response body returns “group id doesn’t exist”.
HTTP Request
GET | {org_name}/{app_name}/chatgroups/{group_ids} |
---|
You need to fill in the request with {group_ids}, the group ID you need to get.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
id | Group ID, a unique identifier for the group, generated by the Chat server, equivalent to the Chat user ID of a single user. |
name | The name of the group, created based on user input, string type. |
description | group description, created based on user input, string type. |
membersonly | Whether or not the group owner or group administrator needs to approve the group. true: yes, false: no. |
allowinvites | If or not allow group members to invite others to join this group. true: allow group members to invite people to join this group, false: only the group owner can add people to the group. |
maxusers | The maximum number of group members, set when creating the group, can be modified. |
owner | The ID of the group owner, for example: {"owner": "user1"}. |
created | timestamp of the group creation. |
affiliations_count | The total number of existing members. |
affiliations | List of existing members of affiliations, including owner and member. e.g."affiliations":[{"owner": "user1"},{"member":"user2"},{"member":"user3"}]. |
public | group type: true: public group, false: private group. |
Request example
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585'
Examples of possible returned results
Returns a value of 200, indicating success in getting group details
{
"action": "get",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585",
"entities": [],
"data": [
{
"id": "66016455491585",
"name": "testgroup1",
"description": "testgroup1",
"membersonly": false,
"allowinvites": false,
"maxusers": 200,
"owner": "user1",
"created": 1542356598609,
"custom": "",
"affiliations_count": 3,
"affiliations": [
{
"member": "user3"
},
{
"member": "user2"
},
{
"owner": "user1"
}
],
"public": true
}
],
"timestamp": 1542360200677,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp",
"count": 1
}
Return value 404, means this group ID does not exist
{
"error": "service_resource_not_found",
"timestamp": 1542360292539,
"duration": 0,
"exception": "com.easemob.group.exception.ServiceResourceNotFoundException",
"error_description": "do not find this group:6601645549158"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542360340446,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Create a group
Create a group and set the group name, group description, public/private group properties, maximum number of group members (including the group owner), whether approval is required to join the public group, the group owner, and the group members.
HTTP Request
POST | {org_name}/{app_name}/chatgroups |
---|
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
groupname | The name of the group, this attribute is required |
desc | group description, this attribute is required |
public | group |
maxusers | group |
allowinvites | Whether to allow group members to invite people to join the group. true: Allow group members to invite people to join this group, false: Only the group owner or administrator can add people to the group. Note: If it is a public group (public is true), it does not allow group members to invite others to join the group. |
members_only | whether the user needs to be approved by the group owner or group administrator, default is false. note: if the group member is allowed to invite users into the group (allowinvites is true), then the group owner or group administrator is not required to approve the group |
owner | The administrator of the group, this attribute is required |
members | group members, this attribute is optional, but if added, the array element is at least one, not more than 100 (note: group owner user1 does not need to write to members) |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
groupid | Group ID |
Request Example
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' -d '{
"groupname": "testgroup",
"desc": "test",
"public": true,
"maxusers": 300,
"owner": "testuser",
"members": [
"user2"
]
}' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups'
Examples of possible returned results
Returns a value of 200, indicating that the group was created successfully
{
"action": "post",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups",
"entities": [],
"data": {
"groupid": "66021836783617"
},
"timestamp": 1542361730243,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, owner user does not exist
{
"error": "resource_not_found",
"timestamp": 1542361812517,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "username tesuser doesn't exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "resource_not_found",
"timestamp": 1542361812517,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "username tesuser doesn't exist!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Modifying group information
The request body only receives
groupname, description, maxusers, membersonly four attributes,
passing non-existent fields or fields that cannot be modified will throw an exception.
HTTP Request
PUT | /{org_name}/{app_name}/chatgroups/{group_id} |
---|
You need to fill in {group_id}, the group ID to be modified, when you request it.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
groupname | The name of the group, the value cannot contain a slash ("/") when modifying |
description | group description, the value cannot contain a slash ("/") |
maxusers | The maximum number of group members (including the group owner), the value is a numeric value |
membersonly | If or not the group owner or group administrator needs to approve the group membership. true: yes, false: no. |
allowinvites | Whether to allow group members to invite people to join this group. true: allow group members to invite people to join this group. false: only the group owner can add people to the group. |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
groupname | The name of the group, true means success, false means failure. |
description | The group description, true means the modification was successful, false means the modification failed. |
maxusers | The maximum number of group members, true indicates a successful modification, false indicates a failed modification. |
membersonly | If or not the group owner or group administrator needs to approve the group membership. true: yes, false: no. |
allowinvites | Whether to allow group members to invite people to join this group. true: allow group members to invite people to join this group. false: only the group owner can add people to the group. |
Request example
curl -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' -d '{
"groupname": "testgroup1",
"description": "test",
"maxusers": 300,
"membersonly": true,
"allowinvites": true
}' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617'
Examples of possible returned results
Returns a value of 200, indicating that the group information was modified successfully
{
"action": "put",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617",
"entities": [],
"data": {
"membersonly": true,
"allowinvites": true,
"description": true,
"maxusers": true,
"groupname": true
},
"timestamp": 1542363146301,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542363205192,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6602183678361 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363254128,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Deleting a group
Deletes the interface of a group.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id} |
---|
You need to fill in the {group_id} corresponding to the group ID that needs to be deleted in the request.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617'
Examples of possible returned results
Returns a value of 200, indicating that the group deletion was successful
{
"action": "delete",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617",
"entities": [],
"data": {
"success": true,
"groupid": "66021836783617"
},
"timestamp": 1542363546590,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6602183678361 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Get group announcements
Get group announcements for the specified group id
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/announcement |
---|
You need to fill in {group_id} when requesting, you need to get the group ID of the group announcement.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/announcement'
Examples of possible returned results
Returns a value of 200, indicating that getting the group announcement was successful
{
"action": "get",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/announcement",
"entities": [],
"data": {
"announcement" : "Group Announcement..."
},
"timestamp": 1542363546590,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6602183678361 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Modify group announcement
Modify the group announcement for the specified group id, note that the content of the group announcement cannot exceed 512 characters.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/announcement |
---|
You need to fill in the {group_id} when requesting the group ID of the group announcement that needs to be modified.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' -d '{"announcement" : "Group Announcement…"}' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/announcement'
Examples of possible returned results
Returns a value of 200, indicating that the group announcement was modified successfully
{
"action": "post",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/announcement",
"entities": [],
"data": {
"id" : "66021836783617",
"result" : true
},
"timestamp": 1542363546590,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6602183678361 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Get group shared files
Paging gets the group shared file with the specified group id, after which you can call download group shared file interface to download the file, call delete group shared file interface to delete the file.
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/share_files |
---|
You need to fill in {group_id} when requesting to get the group ID of the group shared file. By default, you can get the group ID from page 1, and you can get up to 1000 items in 1 page.
Pagination | {org_name}/{app_name}/chatgroups/{group_id}/share_files?pagenum=1&pagesize=10 |
---|
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
file_id | The id of the group share file, which is used if the file is to be downloaded |
file_name | The name of the group share file |
file_owner | The id of the user who uploaded the group share file |
file_size | The size of the group share file (in bytes) |
created | Time when the group share file was uploaded |
Example request
curl -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files?pagenum=1&pagesize=10'
Examples of possible returned results
Returns a value of 200, indicating that getting the group share file was successful
{
"action": "get",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"params": {
"pagesize": [
"10"
],
"pagenum": [
"1"
]
},
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files",
"entities": [],
"data": [
{
"file_id": "dbd88d20-e1d4-11ea-95fc-638fc2d59a8d",
"file_name": "159781149272586.jpg",
"file_owner": "u1",
"file_size": 326127,
"created": 1597811492594
},
{
"file_id": "b30e0be0-e1d4-11ea-8732-172a3f85134f",
"file_name": "159781141836993.jpg",
"file_owner": "u1",
"file_size": 326127,
"created": 1597811424158
}
],
"timestamp": 1542363546590,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6602183678361 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Upload group shared files
Upload the group share file for the specified group id. Note that the uploaded file size cannot exceed 10MB
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/share_files |
---|
You need to fill in {group_id} when requesting, the group ID of the group you need to upload the shared files.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
file_url | The url of the group's shared file, as saved on the Chat server |
group_id | Group id |
file_name | The name of the group share file |
created | Time when the group share file was uploaded |
file_id | The id of the group share file, which can be used to download the share file and delete the share file |
file_size | The size of the group share file (in bytes) |
Request Example
curl -X POST 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files' -H 'Content-Type: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' -H 'restrict-access: true' -F file=@/Users/test/image/IMG_3.JPG
Examples of possible returned results
Returns a value of 200 for uploading a group shared file
{
"action" : "post",
"application" : "7f7b5180-3f2b-11e5-9558-092397c841ef",
"uri" : "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files",
"entities" : [ ],
"data" : {
"file_url" : "https://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files/c6906aa0-ed19-11ea-b480-f3cf141d15c0",
"group_id" : "66021836783617",
"file_name" : "img_3.jpg",
"created" : 1599050554954,
"file_id" : "c6906aa0-ed19-11ea-b480-f3cf141d15c0",
"file_size" : 13512
},
"timestamp" : 1599050554978,
"duration" : 0,
"organization" : "chat-demo",
"applicationName" : "testapp"
}
Return value 404, group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6602183678361 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Download group shared files
Download the group share file according to the specified group id and file_id. file_id is obtained by Get group share file interface
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/share_files/{file_id} |
---|
You need to fill in {group_id} and {file_id} when requesting a group share file, the group ID and group share file ID of the group you need to download. ID and group share file ID.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files/b30e0be0-e1d4-11ea-8732-172a3f85134f'
Examples of possible returned results
Returns 200, the download of the group share file was successful, the byte stream of the downloaded file is returned
Returns 404, the group share file ID does not exist
{
"error": "not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.sun.jersey.api.NotFoundException",
"error_description": "null for uri: http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files/1b30e0be0-e1d4-11ea-8732-172a3f85134f"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Delete group shared files
Delete a group share file based on the specified group id and file_id. file_id is obtained by Get group shared files interface
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/share_files/{file_id} |
---|
You need to fill in the {group_id} and {file_id} when requesting, the group ID and group shared file ID of the group that needs to be deleted.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value
Parameter | Description |
---|---|
group_id | group_id |
file_id | Group share file id |
result | The result of deleting a group shared file, true means the deletion was successful, false means the deletion failed |
curl -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files/b30e0be0-e1d4-11ea-8732-172a3f85134f'
Examples of possible returned results
Returns a value of 200, indicating deletion of the group shared file
{
"action": "delete",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files/b30e0be0-e1d4-11ea-8732-172a3f85134f",
"entities": [],
"data": {
"group_id": "66021836783617",
"file_id": "b30e0be0-e1d4-11ea-8732-172a3f85134f",
"result": true
},
"timestamp": 1599049350114,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, group share file ID does not exist
{
"error": "not_found",
"timestamp": 1542363611915,
"duration": 0,
"exception": "com.sun.jersey.api.NotFoundException",
"error_description": "null for uri: http://a1.easecdn.com/chat-demo/testapp/chatgroups/66021836783617/share_files/1b30e0be0-e1d4-11ea-8732-172a3f85134f"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542363640975,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Manage group members
Chat provides several interfaces to manage group members, including adding and removing group member relationship lists, transferring group owners, etc.
Name | Request | Description |
---|---|---|
Paging for group members | /{org_name}/{app_name}/chatgroups/{group_id}/users | Paging for a list of group members of a group |
Add a single group member | /{org_name}/{app_name}/chatgroups/{group_id}/users/{username} | Add users to the group member list |
Add group members' | /{org_name}/{app_name}/chatgroups/{chatgroupid}/users | Add users' to the group members list |
Remove a single group member | /{org_name}/{app_name}/chatgroups/{group_id}/users/{usernames} | Remove a user from the list of group members |
Remove group members' | /{org_name}/{app_name}/chatgroups/{group_id}/users/{usernames} | Remove users' from the list of group members |
Get the list of group administrators | /{org_name}/{app_name}/chatgroups/{group_id}/admin | Get the list of group administrators |
Add group admins | /{org_name}/{app_name}/chatgroups/{group_id}/admin | Add users to the group admin list |
Remove group admin | /{org_name}/{app_name}/chatgroups/{group_id}/admin/{oldadmin} | Remove user from group admin list |
Transfer group | /{org_name}/{app_name}/chatgroups/{groupid} | Transfer group owner |
Paging group members
Interface to paginate the list of group members.
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/users |
---|
You need to fill in {group_id}, the group ID you need to get, when requesting.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
owner | The Chat user ID of the group owner. e.g. {"owner": "user1"}. |
member | The Chat letter ID of the group member. e.g. {"member": "user2"}. |
Request Example
curl -X GET 'HTTP://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/users?pagenum=2&pagesize=2' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
Returns a value of 200, indicating successful group membership acquisition
{
"action": "get",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"params": {
"pagesize": [
"2"
],
"pagenum": [
"2"
]
},
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/users",
"entities": [],
"data": [
{
"member": "user1"
},
{
"member": "user2"
}
],
"timestamp": 1489074511416,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp",
"count": 2
}
Return value 404, group ID does not exist
{
"error": "service_resource_not_found",
"timestamp": 1542364673829,
"duration": 0,
"exception": "com.easemob.group.exception.ServiceResourceNotFoundException",
"error_description": "do not find this group:66016455491581"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542364697076,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Add a single group member
Add one member to a group at a time, and do not add the same member repeatedly. If the user is already a member of the group, the addition will fail and an error will be returned.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/users/{username} |
---|
You need to fill in the {username} corresponding to the IM username you need to add when requesting.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
result | The result of the add, true means the add was successful, false means the add failed |
groupid | Group ID |
action | The action performed |
user | The ID of the user being added |
Request example
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users/user4'
Examples of possible returned results
Returns a value of 200, indicating that adding a group member was successful
{
"action": "post",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users/user4",
"entities": [],
"data": {
"result": true,
"groupid": "66016455491585",
"action": "add_member",
"user": "user4"
},
"timestamp": 1542364958405,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, the group id or the person added does not exist
{
"error": "resource_not_found",
"timestamp": 1542365038436,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "username user8 doesn't exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542365096789,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Add group members’
Add multiple members to a group, up to 60 members can be added at a time. If all users are already members of the group, the addition will fail and an error will be returned.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{chatgroupid}/users |
---|
You need to fill in the {chatgroupid} corresponding to the group ID you need to add when requesting.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
usernames | username1/username2 Username of the member to be added to the group |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
newmembers | Added group member ID |
groupid | Group ID |
action | The action to be performed |
Request example
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' -d '{
"usernames": [
"user4","user5"
]
}' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users'
Examples of possible returned results
Returns a value of 200, indicating that adding a group member was successful
{
"action": "post",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users",
"entities": [],
"data": {
"newmembers": [
"user5",
"user4"
],
"groupid": "66016455491585",
"action": "add_member"
},
"timestamp": 1542365557942,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Returns 404, this group ID or the person being added does not exist
{
"error": "resource_not_found",
"timestamp": 1542365626633,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542365740570,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Remove a single group member
Removes a member from a group. If the removed user is not a member of the group, the removal will fail and an error will be returned.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/users/{username} |
---|
You need to fill in the {username} corresponding to the IM username that needs to be removed during the request.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
result | Remove result, true means add successful, false means add failed |
groupid | Group ID |
action | The action performed |
user | The ID of the removed user |
Request example
curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer YWMt4LqJIul7EeizhBO5TSO_UgAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnG7GyAQBPGgDv4ENRUku7fg05Kev0a_aVC8NyA6O6PgpxIRjajSVN3g' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users/user3'
Examples of possible returned results
Returns a value of 200, indicating successful group member removal
{
"action": "delete",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users/user3",
"entities": [],
"data": {
"result": true,
"action": "remove_member",
"user": "user3",
"groupid": "66016455491585"
},
"timestamp": 1542365943067,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Returns value 403, the member is not in this group
{
"error": "forbidden_op",
"timestamp": 1542366087574,
"duration": 0,
"exception": "com.easemob.group.exception.ForbiddenOpException",
"error_description": "users [user8] are not members of this group!"
}
Return value 404, this group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542366050953,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired ]
{
"error": "group_authorization",
"timestamp": 1542366178894,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Remove Group Members’
Removes group members, separated by English commas between usernames. It is recommended to remove up to 60 group members at a time. If all the removed users are not group members, the removal will fail and an error will be returned.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/users/{memebers} |
---|
You need to fill in the {memebers} corresponding to the IM username to be removed during the request.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value.
result | Description |
---|---|
Content-Type | The result of the operation; true: removal succeeded, false: removal failed |
action | The action performed; remove_member: Remove the group member |
reason | The reason for the failure of the operation |
user | The user name of the removed member |
groupid | The group ID of the operation |
Request example
curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer YWMtduapFumREei8DkfcegKdAAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnHD8qUwBPGgC0sPDXWLwWYh8ObqXytVlhbUhCTnbiIPi0oNGS8j2pDg' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/users/ttestuser0015981,user2,user3'
Examples of possible returned results
Returns a value of 200, indicating successful group member removal
{
"action": "delete",
"application": "9b848cf0-fafe-11e4-b5b8-0f74e8e740f7",
"uri": "https://a1.easecdn.com/chat-demo/testapp",
"entities": [],
"data": [{
"result": false,
"action": "remove_member",
"reason": "user ttestuser0015981 doesn't exist.",
"user": "user1",
"groupid": "1433492852257879"
},
{
"result": true,
"action": "remove_member",
"user": "user2",
"groupid": "1433492852257879"
},
{
"result": true,
"action": "remove_member",
"user": "user3",
"groupid": "1433492852257879"
}],
"timestamp": 1433492935318,
"duration": 84,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 403, the member is not in this group
{
"error": "forbidden_op",
"timestamp": 1542367708303,
"duration": 0,
"exception": "com.easemob.group.exception.ForbiddenOpException",
"error_description": "users [{memebers}] are not members of this group!"
}
Return value 404, this group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542367736446,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542367755294,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Get the list of group administrators
Interface to get the list of group administrators.
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/admin |
---|
You need to fill in {group_id}, the group ID you need to get, when requesting.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
Parameter | Description |
---|---|
data | Group administrator information |
Request Example
curl -X GET 'HTTP://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/admin' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
Returns a value of 200, indicating success in getting a list of group administrators
{
"action": "get",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/admin",
"entities": [],
"data": ["user1"],
"timestamp": 1489073361210,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp",
"count": 1
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Add Group Administrator
Elevates a group member role to the group administrator interface.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/admin |
---|
You need to fill in the request with {group_id}, the group ID you need to get.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
newadmin | New administrator user ID added |
Response Body
Parameter | Description |
---|---|
data | New administrator user ID added |
Request Example
curl -X POST 'HTTP://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/admin' -d '{"newadmin":"user1"}' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
Return value 200, means get group administrator list successfully
{
"action": "get",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/admin",
"entities": [],
"data": ["user1"],
"timestamp": 1489073361210,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp",
"count": 1
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Remove Group Administrator
Downgrades the user’s role from group administrator to group normal member interface.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/admin/{oldadmin} |
---|
You need to fill in {group_id} and {oldadmin}, the group of the administrator to be removed and the username of the administrator in the request.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X DELETE 'HTTP://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/admin/user1' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
Returns 200, indicating that the removal of the group administrator was successful
{
"action": "delete",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/admin/user1",
"entities": [],
"data": {
"result": "success",
"oldadmin": "user1"
},
"timestamp": 1489073432732,
"duration": 1,
"organization": "chat-demo",
"applicationName": "testapp"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Transferring Groups
Modify the group Owner to another member of the same group.
HTTP Request
PUT | /{org_name}/{app_name}/chatgroups/{groupid} |
---|
You need to fill in the request with {groupid}, the group ID of the group that needs to be transferred.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
newowner | New administrator ID for the group |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
newowner | New administrator ID for the group |
Request Example
curl -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt7CoyjusbEeixOi3iod4eDAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnJlhJIwBPGgCqtjiyVnR209iyr8kNbhJhhanNQDdP9CMmpK2G-NIUOQ' -d '{
"newowner": "user2"
}' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585'
Examples of possible returned results
Returns 200, indicating a successful group transfer
{
"action": "put",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585",
"entities": [],
"data": {
"newowner": true
},
"timestamp": 1542537813420,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 403, the member is not in this group
{
"error": "forbidden_op",
"timestamp": 1542538459201,
"duration": 0,
"exception": "com.easemob.group.exception.ForbiddenOpException",
"error_description": "user: user6 doesn't exist in group: 66016455491585"
}
Return value 404, this group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542367736446,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542538513851,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Manage Blacklist
Chat provides multiple interfaces to complete group blacklist management, including viewing, adding users to and removing them from the blacklist.
Query group blacklist | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users | View the blacklist list of a group |
Add a single user to a group's blacklist | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users/{username} | Add a user to a group's blacklist |
Add users' to group blacklist | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users | Add users' to group blacklist |
Remove individual users from group blacklist | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users/{username} | Remove users from the blacklist list |
Remove users' from group blacklists | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users/{usernames} | Remove users' from blacklists |
Query Group Blacklist
Queries the list of users in the blacklist of a group. Users located in the blacklist cannot view information about the group and cannot receive messages from the group.
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users |
---|
You need to fill in {group_id}, the group ID to be queried, when requesting.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
data | Group blacklist user ID |
Request Example
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer YWMt7CoyjusbEeixOi3iod4eDAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnJlhJIwBPGgCqtjiyVnR209iyr8kNbhJhhanNQDdP9CMmpK2G-NIUOQ' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users'
Examples of possible returned results
Return value 200, means the group blacklist query is successful
{
"action": "get",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/67178793598977/blocks/users",
"entities": [],
"data": [
"user2",
"user3"
],
"timestamp": 1543466293681,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp",
"count": 2
}
Return value 404, the group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542539206941,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542539245149,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Add a single user to a group blacklist
Add a user to the blacklist of a group. The group owner cannot be blacklisted from the group.
After a user is blacklisted from a group, they will receive the message: You are kicked out of the group xxx. After that, the user cannot view information about the group and cannot receive messages from the group.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users/{username} |
---|
You need to fill in the request with {group_id}, the group ID of the group to be blacklisted and {username}, the IM username to be added.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
result | The result of the add, true means the add was successful, false means the add failed |
groupid | Group ID |
action | Execute the action |
user | The ID of the user being added |
Request Example
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt7CoyjusbEeixOi3iod4eDAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnJlhJIwBPGgCqtjiyVnR209iyr8kNbhJhhanNQDdP9CMmpK2G-NIUOQ' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users/user1'
Examples of possible returned results
Return value 200, add user to group blacklist successfully
{
"action": "post",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users/user1",
"entities": [],
"data": {
"result": true,
"action": "add_blocks",
"user": "user1",
"groupid": "66016455491585"
},
"timestamp": 1542539577124,
"duration": 27,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, the group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542539654833,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 403, the user does not exist
{
"error": "forbidden_op",
"timestamp": 1542539679705,
"duration": 0,
"exception": "com.easemob.group.exception.ForbiddenOpException",
"error_description": "users [user10] are not members of this group!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542539732510,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Add users’ to group blacklist
Add multiple users to a group’s blacklist, up to 60 users can be added at once. Group owners cannot be added to the group’s blacklist.
After a user is blacklisted in a group, he/she will receive the message: You are kicked out of the group xxx. After that, the user will not be able to view the group’s information or receive messages from the group.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users |
---|
You need to fill in the request with {group_id}, the group ID of the group to be blacklisted and {username}, the IM username to be added.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
usernames | Added username ID |
Response Body
View the information contained in the data field in the return value.
Parameter | Description |
---|---|
result | Add result, true means add success, false means add failure |
reason | The reason for adding failure |
groupid | Group ID |
action | The action to perform |
user | The ID of the user being added |
Request Example
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer YWMt7CoyjusbEeixOi3iod4eDAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnJlhJIwBPGgCqtjiyVnR209iyr8kNbhJhhanNQDdP9CMmpK2G-NIUOQ' -d '{
"usernames": [
"user3","user4"
]
}' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users'
Examples of possible returned results
Return value 200, add user to group blacklist successfully
{
"action": "post",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users",
"entities": [],
"data": [
{
"result": false,
"action": "add_blocks",
"reason": "user: user3 doesn't exist in group: 66016455491585",
"user": "user3",
"groupid": "66016455491585"
},
{
"result": true,
"action": "add_blocks",
"user": "user4",
"groupid": "66016455491585"
}
],
"timestamp": 1542540095540,
"duration": 16,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, the group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542540155192,
"duration": 1,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 403, the user does not exist or cannot add the group owner to the blacklist
{
"error": "forbidden_op",
"timestamp": 1542540210145,
"duration": 0,
"exception": "com.easemob.group.exception.ForbiddenOpException",
"error_description": "forbidden operation on group owner!"
}
Return value 401, unauthorized [no token, token error, token expired ]
{
"error": "group_authorization",
"timestamp": 1542540260660,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API)
Remove a single user from a group blacklist
Removes a user from the group blacklist. For users in the group blacklist, if you need to add them to the group again, you need to remove them from the group blacklist first.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users/{username} |
---|
You need to fill in the request with {group_id}, the group ID of the group to be removed from the blacklist and {username}, the IM username to be removed.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer YWMt7CoyjusbEeixOi3iod4eDAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnJlhJIwBPGgCqtjiyVnR209iyr8kNbhJhhanNQDdP9CMmpK2G-NIUOQ' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users/user1'
Examples of possible returned results
Return value 200, remove user blacklist successfully
{
"action": "delete",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users/user1",
"entities": [],
"data": {
"result": true,
"action": "remove_blocks",
"user": "user1",
"groupid": "66016455491585"
},
"timestamp": 1542540470679,
"duration": 45,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, the group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542540559252,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 404, the user does not exist
{
"error": "resource_not_found",
"timestamp": 1542540616864,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "username user10 doesn't exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542540739864,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Remove users’ from group blacklist
Remove multiple users from the group blacklist. For users in the group blacklist, if you need to add them to the group again, you need to remove them from the group blacklist first.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/blocks/users/{usernames} |
---|
You need to fill in the request with {group_id}, the group ID of the group to be removed from the blacklist and {username}, the IM username to be removed.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer YWMt7CoyjusbEeixOi3iod4eDAAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnJlhJIwBPGgCqtjiyVnR209iyr8kNbhJhhanNQDdP9CMmpK2G-NIUOQ' 'http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users/user1%2Cuser2'
Examples of possible returned results
Return value 200, remove user blacklist successfully
{
"action": "delete",
"application": "8be024f0-e978-11e8-b697-5d598d5f8402",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/66016455491585/blocks/users/user1%2Cuser2",
"entities": [],
"data": [
{
"result": true,
"action": "remove_blocks",
"user": "user1",
"groupid": "66016455491585"
},
{
"result": true,
"action": "remove_blocks",
"user": "user2",
"groupid": "66016455491585"
}
],
"timestamp": 1542541014655,
"duration": 29,
"organization": "chat-demo",
"applicationName": "testapp"
}
Return value 404, the group ID does not exist
{
"error": "resource_not_found",
"timestamp": 1542541067286,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "grpID 6601645549158 does not exist!"
}
Return value 404, the user does not exist
{
"error": "resource_not_found",
"timestamp": 1542541102793,
"duration": 0,
"exception": "com.easemob.group.exception.ResourceNotFoundException",
"error_description": "username user10 doesn't exist!"
}
Return value 401, unauthorized [no token, token error, token expired]
{
"error": "group_authorization",
"timestamp": 1542541134588,
"duration": 0,
"exception": "com.easemob.group.exception.GroupAuthorizationException",
"error_description": "this token is bad, or has expired!"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Manage mutes
Chat provides multiple interfaces to manage the group mute list, including viewing, adding users to, and removing them from the mute list.
Name | Request | Description |
---|---|---|
Add mute | /{org_name}/{app_name}/chatgroups/{group_id}/mute | Add user to group's mute list |
Remove mute | /{org_name}/{app_name}/chatgroups/{group_id}/mute/{member1}(,{member2},...) | Remove a user from the group's mute list |
Get the mute list | /{org_name}/{app_name}/chatgroups/{group_id}/mute | Get the group's mute list |
Add a mute
mutes a user. When a user is muted, they will not be able to send messages in the group.
HTTP Request
POST | /{org_name}/{app_name}/chatgroups/{group_id}/mute |
---|
You need to fill in the request with {group_id}, the group ID you need to add the mute to, and {username}, the IM username you want to add the mute to.
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Body
Parameter | Description |
---|---|
mute_duration | The duration of the mute, in milliseconds, if "-1" means permanent (the actual expiration time is the fixed timestamp 4638873600000, i.e. 2117-01-01 00:00:00) |
usernames | ID of the user to be added to the mute |
Response Body
Parameter | Description |
---|---|
result | The result of the operation; true: add success; false: add failure |
expire | The timestamp for the expiration of the mute (milliseconds from January 1, 1970. If the mute timestamp is passed as "-1", then the timestamp is a fixed 4638873600000, see the description of the mute_duration parameter) |
user | ID of the muted user |
Request Example
curl -X POST 'HTTP://a1.easecdn.com/chat-demo/testuser/chatgroups/10130212061185/mute' -d '{"usernames":["user1"], "mute_duration":86400000}' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
Return value 200, add mute successfully
{
"action": "post",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/mute",
"entities": [],
"data": [{
"result": true,
"expire": 1489158589481,
"user": "user1"
}],
"timestamp": 1489072189508,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Remove mutes
Removes a user from the mute list. After removal, the user can send messages in the group normally.
HTTP Request
DELETE | /{org_name}/{app_name}/chatgroups/{group_id}/mute/{member1}(,{member2},...) |
---|
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Request Example
curl -X DELETE 'HTTP://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/mute/user1' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
The return value of 200 means that the mute was removed successfully.
{
"action": "delete",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/mute/user1",
"entities": [],
"data": [{
"result": true,
"user": "user1"
}],
"timestamp": 1489072695859,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details
Test online using Platform API
Get the list of muted users
Gets the list of muted users for the current group.
HTTP Request
GET | /{org_name}/{app_name}/chatgroups/{group_id}/mute |
---|
Request Headers
Parameter | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer ${token} |
Response Body
Parameter | Description |
---|---|
expire | Timestamp of the mute expiration (number of milliseconds from January 1, 1970. If the value of "-1" is passed for the mute time, then the timestamp is fixed at 4638873600000, see the description of the mute_duration parameter) |
user | ID of the muted user |
Request Example
curl -X GET 'HTTP://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/mute' -H 'Authorization: Bearer YWMtG4T5wkOTEeST5V-9lp7f-wAAAUnafsqrQFnCU4gI0-rQImw4523fWqIasd1'
Examples of possible returned results
The return value of 200 indicates the success of getting the mute list
{
"action": "post",
"application": "527cd7e0-04b3-11e7-9f59-ef10ecd81ff0",
"uri": "http://a1.easecdn.com/chat-demo/testapp/chatgroups/10130212061185/mute",
"entities": [],
"data": [{
"expire": 1489158589481,
"user": "user1"
}],
"timestamp": 1489072802179,
"duration": 0,
"organization": "chat-demo",
"applicationName": "testapp"
}
If the return result is 429, 503 or other 5xx , it may mean that the interface is flow-limited, please pause a little and retry. See interface flow restriction instructions for details