tencent cloud


Setting Profiles

Last updated: 2022-01-14 17:30:06

    Feature Description

    This API is used to set standard profile fields and custom profile fields.

    API Calling Description

    Request URL example


    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
    https The request protocol is HTTPS, and the request method is POST.
    xxxxxx The country/region where your SDKAppID is located.
  • China: console.tim.qq.com
  • Singapore: adminapisgp.im.qcloud.com
  • Seoul: adminapikr.im.qcloud.com
  • Frankfurt: adminapiger.im.qcloud.com
  • India: adminapiind.im.qcloud.com
  • v4/profile/portrait_set 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
    contenttype Request format. The value is always json.

    Maximum calling frequency

    The maximum calling frequency is 200 times per second.

    Request packet example


    Request packet fields

    Field Type Attribute Description
    From_Account String Required UserID of the user whose profile needs to be set
    ProfileItem Array Required Profile object array of the target user. Each object in the array contains a Tag and a Value.
    Tag String Required Profile field to be set. Profile fields that can be set include:
    1. Standard profile fields. For details, see Standard Profile Fields
    2. Custom profile fields. For details, see Custom Profile Fields.
    Value uint64_t/string/bytes Required Value of the profile field to be set. For details, see Profile Fields.

    Response packet example


    Response packet fields

    Field Type Description
    ActionStatus String Request processing result. OK: succeeded. FAIL: failed.
    ErrorCode Integer Error code. 0: succeeded. Others: failed.
    ErrorInfo String Detailed error information
    ErrorDisplay String Detailed error information to be displayed on the client

    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
    40001 A request parameter is incorrect. To correct it, check request parameters based on the error description.
    40003 The requested user account does not exist.
    40004 The request requires app admin permissions.
    40005 A profile field contains sensitive words.
    40006 An internal server error occurred. To correct it, try again later.
    40008 You do not have the permission to write profile fields. For details, see Profile Fields.
    40009 The tag of a profile field does not exist.
    40601 The length of the value of a profile field exceeds 500 bytes.
    40605 The value of a standard profile field is incorrect. For details, see Standard Profile Fields.
    40610 The value type of a profile field is incorrect. For details, see Standard Profile Fields.

    API Commissioning Tool

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


    Pulling profiles (v4/profile/portrait_get)

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support