Configuring Global Mute

Last updated: 2020-03-12 15:08:42

PDF

Background

  • Global muting includes the global muting of one-to-one chat messages and that of group chat messages.
    If the global muting of one-to-one chat messages is enabled for an account, during the muting period, no one-to-one chat messages can be sent, the sender receives error code 20012 (for details, see Error Codes), and the callback before sending one-to-one chat messages is not triggered. After the muting period expires, the IM backend system automatically disables the global muting of one-to-one chat messages, and then all one-to-one chat messages can be sent normally. For the permanent global muting of one-to-one chat messages, the muting period never expires. By default, the global muting of one-to-one chat messages is disabled for accounts.
    If the global muting of group chat messages is enabled for an account, during the muting period, no group chat messages can be sent, the sender receives error code 10017 (for details, see Error Codes), and the callback before sending group chat messages is not triggered. After the muting period expires, the IM backend system automatically disables the global muting of group chat messages, and then all group chat messages can be sent normally. For the permanent global muting of group chat messages, the muting period never expires. By default, the global muting of group chat messages is disabled for accounts.

Feature Description

  • This API is used to enable the global muting of one-to-one chat messages for an account.
  • This API is used to enable the global muting of group chat messages for an account.

API Calling Description

Request URL example

https://console.tim.qq.com/v4/openconfigsvr/setnospeaking?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

Request parameters

The following table lists only the parameters to be modified when this API is called. For details on other parameters, see RESTful API Overview.

Parameter Description
v4/openconfigsvr/setnospeaking Request API
sdkappid SDKAppID assigned by the IM console when an app is created
identifier The value must be the app admin account. For details, see App Admins.
usersig Signature generated by the app admin account. For details, see Generating UserSig.
random A random 32-bit unsigned integer ranging from 0 to 4294967295

Maximum calling frequency

The maximum calling frequency is 200 times per second.

Request packet example

{
    "Set_Account": "lumotuwe",
    "C2CmsgNospeakingTime": 4294967295, // C2CmsgNospeakingTime and GroupmsgNospeakingTime are optional, but either of them must be specified.
    "GroupmsgNospeakingTime": 7200
}

Request packet fields

Field Type Attribute Description
Set_Account String Required Account for which muting will be enabled
C2CmsgNospeakingTime Integer Optional Muting period (in seconds) of one-to-one chat messages. The value is a non-negative integer, and the maximum value is 4294967295 (0xFFFFFFFF in hexadecimal format). 0: the account is unmuted. 4294967295 (0xFFFFFFFF in hexadecimal format): the account is permanently muted. Others: the muting period of the account.
GroupmsgNospeakingTime Integer Optional Muting period (in seconds) of group chat messages. The value is a non-negative integer, and the maximum value is 4294967295 (0xFFFFFFFF in hexadecimal format). 0: the account is unmuted. 4294967295 (0xFFFFFFFF in hexadecimal format): the account is permanently muted. Others: the muting period of the account.

Response packet example

{
    "ErrorCode": 0,
    "ErrorInfo": "",
}

Response packet fields

Field Type Description
ErrorCode Integer Request error code. 0: succeeded. Others: failed.
ErrorInfo String Error information

Error Codes

Unless a network error (such as error 502) occurs, the HTTP return code for this API is always 200. ErrorCode and ErrorInfo in the response packet represent the actual error code and error information, respectively.
For common error codes (60000 to 79999), see Error Codes.
The following table describes the error codes specific to this API.

Error Code Description
130001 Failed to parse the JSON request packet. To correct it, check whether the request packet meets JSON specifications.
130004 The JSON request packet does not contain the Set_Account field.
130005 The Set_Account field in the JSON request packet is invalid.
130008 Neither GroupmsgNospeakingTime nor C2CmsgNospeakingTime in the JSON request packet is specified.
130014 A system error occurred. To correct it, try again or contact our technical customer service.

API Commissioning Tool

Use the online commissioning tool for RESTful APIs to commission this API.

References

Querying global muting (v4/openconfigsvr/setnospeaking)