Importing multiple accounts

Last updated: 2020-07-07 14:56:21

    Feature Description

    This API is used to batch import app-owned accounts to IM and create an internal ID for these accounts to ensure that these accounts can use the IM service.

    • This API can import up to 100 accounts to IM at a time. If an account is imported repeatedly, only one internal ID will be created for it.
    • This API is unable to import account nickname and portrait. To set the nickname and portrait, call the Configuring Profiles

    Call Description

    Example request URL

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

    Request parameters

    The following table only describes the parameters that are modified when this API is called. For more information on other parameters, see RESTful API Overview.

    Parameter Description
    v4/im_open_login_svc/multiaccount_import The request API.
    sdkappid The SDKAppID assigned by the IM console when an application is created.
    identifier The value must be the app admin account. For more information, see App Admin.
    usersig The signature generated by the app admin account. For more information on the operation, see Generating UserSig.
    random A random 32-bit unsigned integer ranging from 0 to 4294967295.

    Maximum call frequency

    100 times/second

    Example request packet

    {
    "Accounts":["test1","test2","test3","test4","test5"]
    }

    Request packet fields

    Field Type Property Description
    Accounts Array Required The user name. A single user name cannot exceed 32 bytes in length. Up to 100 user names can be imported at a time.

    Example response packet body

    {
        "ActionStatus":"OK",
        "ErrorCode": 0,
        "ErrorInfo":"",
        "FailAccounts": [
            "test3",
            "test4"
        ]
    }

    Response packet fields

    Field Type Description
    ActionStatus String The request processing result. OK: succeeded. FAIL: failed.
    ErrorCode Integer The error code. 0: succeeded. Other values: failed.
    ErrorInfo String The error information.
    FailAccounts Array A list of accounts that failed to be imported.

    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.
    For public error codes 60000 to 79999, see Error Codes.
    The following table describes the error codes specific to this API.

    Error Code Description
    70169 The server timed out. Try again later.
    70202 The server timed out. Try again later.
    70398 The number of accounts exceeds the limit. To create more than 100 accounts, upgrade your application to the Pro Edition. For more information on the directions, see Purchase Guide.
    70402 A parameter is invalid. Check whether the required fields have been specified or whether the fields are set according to protocol requirements.
    70403 The request failed. The app admin's permissions are required.
    70500 An internal server error occurred. Try again later.

    Commissioning Tool

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

    References

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help