Android Status Codes

Update time: 2023/01/06 09:38:50

Status codes

Code Description
408 Timeout
1000 Local operation error

Status codes

Incorrect username or password 302

When the SDK executes the login operation and the status code 302 is returned. Check whether the current AppKey, accid (account), and token are associated. Common reasons: incorrect or outdated token, no such accid for the AppKey.
For more information, see Login failure-302.

Invalid Invalid operation or no permission 403

When an invalid operation is performed, status code 403 will be returned. Common invalid operations are as follows:

  • If The setting in the CommsEase console does not allow non-friends to send messages, the client SDK will return a 403 error when you send messages to non-friends. In the chat rooms, to turn an administrator to regular participant, you can revoke the administrator role. You cannot set admin as regular member. Otherwise, a 403 error is returned.
    In the chat rooms, only the creator can manage administrators. Administrators have no permission to manage the creator. Otherwise a 403 error is returned. If a webhook does not forward a message, the sender SDK will return a 403 error.
    If a user is blocked by a friend, sending a message to the friend may trigger a webhook. If the message is blocked, the SDK throws a 403 error. If the message is delivered, the SDK returns a 7101 code. If an account has left the group or is removed from the group, recalling a message will return a 403 error. However, within the validity period for recalling messages, administrators can still recall messages sent by removed participants on the client. When the application corresponding to the current AppKey in the CommsEase console is suspended, calling the server API will return {"desc": "app is forbidden", "code": 403}. If the nickname or signature of a user hits the moderation rules, such as politically sensitive content, inappropriate text, or advertisement, {"desc": "forbidden info", "code" : 403} is returned. In Interactive Whiteboard, document information can only be queried by the user uploading the file. If other accounts query the information, a 403 error is returned. IM server APIs for group operations are applicable to advanced groups and supergroups. For other types of groups, {"desc": "no support", "code":403} is returned. If two users are not friends, updating the friend profile by calling the API will return a 403 error.

Before a specific function is enabled or activated, calling the corresponding API will also return status code 403. Common reasons:

  • If event subscription (commonly used for online event subscription) is unactivated, a 403 error will be returned for subscription operations.
  • If the application does not have permission to send and receive messages (a corresponding prompt in the CommsEase console), sending messages by calling the corresponding API returns a 403 error. Consult your sales consultant for details. If the message roaming service is disabled, calling the relevant interface will return a 403 error.

object does not exist 404

If a 404 status code is returned for an API call, check whether the parameters are correct. Common reasons:

  • If a required parameter is empty, a 404 code may be returned.
  • The parameter specified does not exist. Such as an unregistered accid and a group ID that does not exist.

Client request timeout 408

If a 408 status code is returned for an API call, check whether the current network works. Common reasons:

  • After the network is disconnected, calling the connect request returns a 408 status code.
  • Call the connect request when you do not log in.
  • Android SDK v4.3.0 and earlier versions are incompatible with Android 8.0 and above system versions, a 408 status code may appear when logging in, update to the latest SDK.

Invalid parameter 414

If a 414 status code is returned for an API call, check whether the parameters are correct. Common reasons:

  • The data type of the specified parameter is inconsistent with the requirements.
  • If Identifier Verification is selected in the CommsEase Console > Application > AppKey > Identifier`, login requests are rejected when the client App ID (Bundle ID for iOS/Package Name for Android) is not included in the configured identifier list, and a 414 status code is returned.
  • Calling a server API with an unregistered accid also returns a 414 error.
  • If a chat room is closed, querying the chat room message history will return a 414 error. For example: calling an API to query "chat room message history in the cloud" returns {"desc": "check roomid", "code": 414}.
  • Unsending a message filtered by content moderation returns a 414 error.
  • Adding yourself to friends returns a 414 error.
  • Passing a parameter incompatible with the JSON format for an SMS API returns {"code": 414, "msg":"'mobiles' / 'params' must be in JSON format"}. The teamMsgReceipts parameter for read receipt in groups is an array in the SDK for Web. The upper limit of the elements in an array is 50. If the number of elements exceeds the upper limit, a 414 error code will be returned.
  • Incorrect verification information for calling a server API returns {"desc":"bad http headers", "code":414}. For verification information, see Verification.
    Note that AppSecret is used instead of AppKey for calculating CheckSum.
  • Inconsistency between CurTime and current UTC timestamp in calling a server API returns {"desc": "CurTime is illegal", "code": 414}/{"desc": "CurTime is expired", "code": 414}. Possible reasons:
    • Current UTC timestamp is not dynamically obtained.
    • The time zone and time configured on your app server are inconsistent with the actual time.
  • {"desc":"body not json", "code":414} is returned The Content-Type of a request uses application/x-www-form-urlencoded. You can encode the URL that includes parameters. This can avoid parsing failure caused by special characters.
  • {"desc":"retry again", "code":414} is returned. If you create an account by calling the Register IM account with the same accid in different requests, the error occurs.
  • If the group owner's account is banned, calling the corresponding API to dismiss the group may return {"desc": "check accid001", "code": 414}.
  • if {"desc":"parameter roomid must be of long type", "code":414} is returned for chat room API calling, possible reasons include but not limited to:
    • The roomid parameter is improperly coded. For example, encoding the parameter using json_encode in PHP may cause this error.
  • If only roomid, needNotify, and notifyExt are specified and other parameters to be updated are unspecified [updating chat room information](/docs/TM5MzM5Njk/TYyMDI1MTg?#Update chat room information), {"desc": "no valid param provided, skip update!", "code": 414} is returned.
  • Calling [create IM accounts](/docs/TM5MzM5Njk/Dc2NTM1NzI?#create IM accounts) returns {"desc": "Exceed the maximum account XXX", "code":414}. Possible reasons:
    • The maximum number of accounts for the free tier is 100.
    • IM Pro free trial expires. IM Pro can have an unlimited number of accounts during your free trial. When the free trial expires, the number of accounts is lowered to 100. To continue to use IM Pro, contact the sales.

Repeated operation 417

  • If a 417 error code is returned for automatic logins, possible reasons are included in Automatic login returns 417.
  • If a 417 error code is returned for creating a group audio and video room,possible reasons are included in Group audio and video room/interactive live streaming returns 417
  • {desc:"duplicate...", code:"417"} is returned for API [Set the role in chat rooms](/docs/TM5MzM5Njk/TYyMDI1MTg?#Set the role in chat rooms), possible reasons include but not limited to:
    • Repeated operations, such as setting a role after it is already set, or canceling a role after it is canceled.
    • Invalid operations, such as revoking administrator roles from regular users, or performing operations on users that have not joined a chat room.

No permissions 802

  • If you call the leave method in the IM SDK to leave a group, and the 802 status code is returned. The group owner of an advanced group cannot leave the group directly. Transfer the group before leaving the group, or dismiss the group.
  • If you mute all or unmute all and muteType is set to 3, all group members (including the group owner) is muted. In this case, if the SDK tries to call the mute interface again, the 802 status code will be returned.
Was this page helpful?
  • Status codes
  • Status codes
  • Incorrect username or password 302
  • Invalid Invalid operation or no permission 403
  • object does not exist 404
  • Client request timeout 408
  • Invalid parameter 414
  • Repeated operation 417
  • No permissions 802