Logo Site EngageLab Mark Colored Transparent
Document

Error Codes

This document applies to the 2.x standalone MA Web SDK.

Client-side Error Codes

Callback codes generated locally by the Web SDK take one of the following three values:

Code Description Details
0 Request succeeded The API request succeeded (message is always success)
-1 Request failed Local parameter validation failed, the SDK is not ready (not initialized / RID or EUID not obtained), a network error occurred, the response could not be parsed, or the server returned an invalid response. See the callback message for the exact reason
-8 Data collection disabled Since 2.2.0. After collection is disabled through the Data Collection Switch, user property APIs (setProperty, increaseProperty, addProperty, deleteProperty, removeProperty, updateProperty) are intercepted and the operation is not performed; message is always data collection disabled. APIs without callbacks, such as events and UTM, drop the data silently while disabled and do not return this code

Common local -1 messages (returned to the application in English):

message Scenario
invalid argument: enabled must be boolean The argument of setDataCollectionEnabled is not a boolean
sdk hasn't registered yet, request will be cancel init has not completed or /get-rid has not succeeded, so user APIs are intercepted
MA EUID is not a valid Long The local EUID is missing or invalid (usually /get-euid has not succeeded)
identifyAccount fail loginID and mobile are nil identifyAccount was called with an empty identity object (wording kept byte-for-byte identical to v1)
user_id cannot be "0" / email format is invalid / phone must be E.164 format (+[1-9] followed by 1-14 digits) etc. User identity field validation failed (see "API Guide - Set User Identity" for the rules)
channelId must be greater than 0 / channel values cannot be empty / channel value element cannot be empty setChannelValue parameter validation failed
userIdentity is invalid: ... All userIdentity fields passed to a repeated init are invalid (since 2.1.0, passing a different AppKey to init switches the data source and no longer returns an error)
network exception The network request failed or the response is invalid

Server-side Business Codes

When the server explicitly returns a business failure, the SDK does not collapse it into -1. It passes the server's code and message through to the callback as is, so positive codes may appear in callbacks.

Server-side business codes are for troubleshooting only and are not part of the stable SDK contract. Do not write business branches based on specific positive codes. Always use code === 0 to determine success, and provide the original code and message to technical support when an unexpected failure occurs.

When init is called repeatedly (since 2.1.0 every call re-fetches the EUID), failures of the EUID request are also passed through as server-side business codes according to the rule above.

Appendix: Common Server-side Business Codes

The following values are for reference during troubleshooting only and are not guaranteed to stay stable across SDK or server versions:

Code Meaning
55004 Invalid business parameter, for example the channel AppKey is not mapped in the current project, the channelId does not exist in the current project, the channel value equals the MA RID, or updateProperty / removeProperty is called on an undefined object_array property
55100 User registration failed
55101 The number of user identities exceeds the limit
55102 An invalid user property name exists
55103 The user property value is empty
55105 The user identity value exceeds 256 characters
55106 The user identity name is not supported
55107 The user identity value is empty
55108 Invalid EUID, for example maEuid and maRid do not belong to the same MA user
55110 Too many requests; retry later
55000 Server-side system error
40007 EUID is empty
Icon Solid Transparent White Qiyu
Contact Sales