This page introduces the error codes and error messages that might be returned by the SDK when you call the Agora Chat APIs.
Possible reasons for the errors are given to assist you in debugging. If you receive an error code not included here, Agora recommends you contact support@agora.io so that the technical support team can help resolve the issue.
During the run time of the Agora Chat SDK, the error codes and error messages might be returned in the following ways:
onError
callback.For example, when a user registration request fails because the username already exists, the onError
callback returns the following error code and error message:
SDKClient.Instance.Login(username, passwd,
handle: new CallBack(
onSuccess: () =>
{
},
onError: (code, desc) =>
{
// code: 203
// desc: USER_ALREADY_EXIST
}
)
);
Error code | Error message | Error description |
---|---|---|
0 | EM_NO_ERROR |
The operation succeeds. |
1 | GENERAL_ERROR |
The SDK is not properly initialized, or the server cannot identify this error. |
2 | NETWORK_ERROR |
The SDK is disconnected from the server due to network interruption. |
4 | EXCEED_SERVICE_LIMIT |
The usage exceeds the service limit. For example, the total number of registered user exceeds the limit of the current pricing plan. |
100 | INVALID_APP_KEY |
The App Key is invalid. |
101 | INVALID_USER_NAME |
The user ID is invalid. For example, when you request to add a contact, the username is set to an empty string. |
102 | INVALID_PASSWORD |
The login password is empty or invalid. |
104 | INVALID_TOKEN |
The login token is empty or invalid. |
105 | USER_NAME_TOO_LONG |
The length of the username exceeds the limit of 64 bytes. |
108 | TOKEN_EXPIRED |
The token has expired. |
109 | TOKEN_WILL_EXPIRE |
The token has passed half of its validity period. |
200 | USER_ALREADY_LOGIN |
The user has already logged in. |
201 | USER_NOT_LOGIN |
The login session is either invalid or has expired when you request to send a message or perform operations to a chat group. |
202 | USER_AUTHENTICATION_FAILED |
The user authentication fails because the token is either invalid or has expired. |
203 | USER_ALREADY_EXIST |
When you register a user account, the specified user ID already exists. |
204 | USER_NOT_FOUND |
When you request to log in as a user or retrieve the conversation list of a user, the specified user ID does not exist. |
205 | USER_ILLEGAL_ARGUMENT |
When you request to register a user account or update user attributes, the specified user ID is invalid or empty. |
206 | USER_LOGIN_ANOTHER_DEVICE |
If you have not enabled the multi-device service, you are forced to log out on one device by a login attempt on another device. |
207 | USER_REMOVED |
Your account is deleted in the backend. |
208 | USER_REG_FAILED |
The request to register a user account fails because the registration is closed. |
209 | PUSH_UPDATECONFIGS_FAILED |
The nickname displayed during message push fails to be updated. |
210 | USER_PERMISSION_DENIED |
You are blocked and not allowed to send messages. |
213 | USER_BIND_ANOTHER_DEVICE |
If you set that the login device takes precedence, a login attempt on another device triggers this error to notify that this user has already logged in. |
214 | USER_LOGIN_TOO_MANY_DEVICES |
The number of devices on which a user ID logs in exceeds the limit. |
215 | USER_MUTED |
You are muted and not allowed to send messages in a chat group or chat room. |
216 | USER_KICKED_BY_CHANGE_PASSWORD |
Once the password of a user account is updated, the current login session ends and you must log in again with the new password. |
217 | USER_KICKED_BY_OTHER_DEVICE |
If you have enabled the multi-device service, you log out on one device by either a force quit API call on another device or a force quit operation in the backend. |
218 | USER_ALREADY_LOGIN_ANOTHER |
Log in to the SDK with another user account while the current account has not been logged out. |
219 | USER_MUTED_BY_ADMIN |
The App Key of a user is globally muted and not allowed to send messages. |
220 | USER_DEVICE_CHANGED |
If you set that the login device takes precedence, a login attempt on another device triggers this error to notify that the login device is detected as irregular. |
221 | USER_NOT_FRIEND |
If you set that only contacts can send messages to you in the console, the SDK returns this error when strangers attempt to send messages. |
300 | SERVER_NOT_REACHABLE |
The SDK is disconnected from the server due to unstable networks when you send API requests. |
301 | SERVER_TIMEOUT |
The server does not respond to an API request within the allocated period, generally 30 seconds or 60 seconds. |
302 | SERVER_BUSY |
The server is busy. Retry later. |
303 | SERVER_UNKNOWN_ERROR |
A default error is returned by the server. You need to further identify and troubleshoot this error with logs. |
304 | SERVER_GET_DNSLIST_FAILED |
The SDK fails to retrieve the DNS server information. |
305 | SERVER_SERVICE_RESTRICTED |
This error returns when the app server is restricted. |
400 | FILE_NOT_FOUND |
The request to retrieve a log file or download an attachment fails. |
401 | FILE_INVALID |
The request to upload a group shared file or message attachment fails. |
402 | FILE_UPLOAD_FAILED |
The request to upload a message attachment fails. |
403 | FILE_DOWNLOAD_FAILED |
The request to download a message attachment fails. |
404 | FILE_DELETE_FAILED |
The outdated file fails to be deleted when retrieving the latest log file. |
405 | FILE_TOO_LARGE |
The message attachment or shared group file you attempt to upload exceeds the limit of the file size. |
406 | FILE_CONTENT_IMPROPER |
The content of a message attachment or shared group file does not meet the compliance requirements. |
500 | MESSAGE_INVALID |
The request to send a message is invalid, for example, the message body or message ID is empty, or the user ID of the sender is inconsistent with the user ID of the current login session. |
501 | MESSAGE_INCLUDE_ILLEGAL_CONTENT |
The message contains illegal content. |
502 | MESSAGE_SEND_TRAFFIC_LIMIT |
Too many requests too often. Agora recommends that you reduce the call frequency or the message size. |
504 | MESSAGE_RECALL_TIME_LIMIT |
A message cannot be recalled because the message exceeds the recall period. |
505 | SERVICE_NOT_ENABLED |
The feature that you are attempting to use is not activated. Contact support@agora.io to activate this feature for your user account. |
506 | MESSAGE_EXPIRED |
The chat group receipt has expired. The default valid period is 3 days. |
507 | MESSAGE_ILLEGAL_WHITELIST |
You are not allowed to send messages because a chat group or chat room mutes all members and you are not on the allow list. |
508 | MESSAGE_EXTERNAL_LOGIC_BLOCKED |
The message that you are attempting to send is blocked by the logic defined in your own server. |
600 | GROUP_INVALID_ID |
The request to perform operations to a chat group fails because the chat group ID is an empty string. |
601 | GROUP_ALREADY_JOINED |
The request to join a chat group fails because you have already joined the chat group. |
602 | GROUP_NOT_JOINED |
The request to send a message or perform operations to a chat group fails because you have not joined the chat group. |
603 | GROUP_PERMISSION_DENIED |
You do not have the privilege to perform the operation to a chat group. For example, a chat group member does not have permission to add or remove a chat group admin. |
604 | GROUP_MEMBERS_FULL |
The number of chat group members exceeds the limit. |
605 | GROUP_NOT_EXIST |
The chat group to which you are requesting to perform operations does not exist. |
700 | CHATROOM_INVALID_ID |
The request to perform operations to a chat room fails because the chat room ID is an empty string. |
701 | CHATROOM_ALREADY_JOINED |
The request to join a chat room fails because you have already joined the chat room. |
702 | CHATROOM_NOT_JOINED |
The request to send a message or perform operations to a chat room fails because you have not joined the chat room. |
703 | CHATROOM_PERMISSION_DENIED |
You do not have the privilege to perform the operation to a chat room. For example, a chat room member does not have permission to add or remove a chat room admin. |
704 | CHATROOM_MEMBERS_FULL |
The number of chat room members exceeds the limit. |
705 | CHATROOM_NOT_EXIST |
The chat room to which you are requesting to perform operations does not exist. |
900 | PUSH_NOT_SUPPORT |
The third-party push service is not supported by the current device. |
901 | PUSH_BIND_FAILED |
The token of the third-party push service fails to upload to the server. |
902 | PUSH_UNBIND_FAILED |
The token of the third-party push service fails to unbind. |