tencent cloud


SDK APIs (Web & Mini Program)

Last updated: 2021-11-15 09:57:01


    TIM is the namespace of the IM Web SDK and provides the static method create() for creating SDK instances, the event constant EVENT, and the type constant TYPES.


    API Description
    create Creates an SDK instance.

    SDK Instance

    Term Description
    Message Message indicates the content to be sent and carries multiple attributes which specify whether you are the sender, the sender account, the message generation time, and so on.
    Conversation Two types of Conversation are available:
  • Client to Client (C2C): a one-to-one chat, involving only 2 participants.
  • GROUP: a group chat, involving more than 2 participants.
  • Profile Profile describes the basic information of a user, including the nickname, gender, personal signature, and profile photo address.
    Friend Friend describes the basic information of a friend, including the remarks and friend list.
    FriendApplication FriendApplication describes the basic information of a friend request, including the friend source and remarks.
    FriendGroup FriendGroup describes the basic information of a friend list, including the friend list name and members.
    Group Group indicates a communication system for group chatting, including Work, Public, Meeting, and AVChatRoom.
    GroupMember (group member) GroupMember indicates the basic information of each group member, such as the ID, nickname, role, and the time of joining the group.
    Group notification A group notification is generated when an event such as adding or deleting group member occurs. The access side can configure whether to display group notifications to group members.
    For more information about group notification types, see Message.GroupTipPayload.
    Group system message For example, when a user requests to join a group, the group admin receives a system message. After the admin accepts or rejects the request, the IM SDK returns the result to the access side, which then displays the result to the user.
    For more information about group system message types, see Message.GroupSystemNoticePayload.
    Message display on screen The sent messages, including text segments and images, are displayed on the computer or phone screen.


    API Description
    login Logs in.
    logout Logs out.


    API Description
    createTextMessage Creates a text message.
    createTextAtMessage Creates a text message with the @ notification feature.
    createImageMessage Creates an image message.
    createAudioMessage Creates a voice message.
    createVideoMessage Creates a video message.
    createCustomMessage Creates a custom message.
    createFaceMessage Creates an emoji message.
    createFileMessage Creates a file message.
    createMergerMessage Creates a combined message.
    downloadMergerMessage Downloads a combined message.
    createForwardMessage Creates a forward message.
    sendMessage Sends a message.
    revokeMessage Recalls a message.
    resendMessage Sends a message again.
    deleteMessage Deletes a message.


    API Description
    getMessageList Gets the message list.
    setMessageRead Sets a message as read.
    getConversationList Gets the conversation list.
    getConversationProfile Gets the conversation information.
    deleteConversation Deletes a conversation.
    pinConversation Pins/Unpins a conversation to/from top.


    API Description
    getMyProfile Gets your personal profile.
    getUserProfile Gets other user’s profile.
    updateMyProfile Updates your personal profile.
    getBlacklist Gets your blocklist.
    addToBlacklist Adds a user to the blocklist.
    removeFromBlacklist Removes a user from the blocklist.

    Relationship Chain

    API Description
    getFriendList Gets the friend list in the SDK cache.
    addFriend Adds friends.
    deleteFriend Deletes friends.
    checkFriend Verifies friends.
    getFriendProfile Gets the friend data and profile data of a specified user.
    updateFriend Updates the relationship chain data of friends.
    getFriendApplicationList Gets the friend request list in the SDK cache.
    acceptFriendApplication Accepts a friend request.
    refuseFriendApplication Rejects a friend request.
    deleteFriendApplication Deletes a friend request.
    setFriendApplicationRead Set a friend request as reads.
    getFriendGroupList Gets friend lists in the SDK cache.
    createFriendGroup Creates a friend list.
    deleteFriendGroup Deletes a friend list.
    addToFriendGroup Adds friends to a friend list.
    removeFromFriendGroup Removes friends from a friend list.
    renameFriendGroup Modifies the name of a friend list.


    API Description
    getGroupList Gets the group list.
    getGroupProfile Gets the group profile.
    createGroup Creates a group.
    dismissGroup Deletes a group.
    updateGroupProfile Modifies the group profile.
    joinGroup Requests to join a group.
    quitGroup Quits a group.
    searchGroupByID Searches for a group.
    getGroupOnlineMemberCount Gets the number of online users in an audio-video group.
    changeGroupOwner Transfers the group ownership.
    handleGroupApplication Processes requests to join the group.
    initGroupAttributes Initializes group attributes.
    setGroupAttributes Sets group attributes.
    deleteGroupAttributes Deletes group attributes.
    getGroupAttributes Gets group attributes.

    Group member

    API Description
    getGroupMemberList Gets the group member list.
    getGroupMemberProfile Gets a group member’s profile.
    addGroupMember Adds a group member.
    deleteGroupMember Deletes a group member.
    setGroupMemberMuteTime Configures the muting period.
    setGroupMemberRole Modifies the group member’s role.
    setGroupMemberNameCard Sets the name card for a group member.
    setGroupMemberCustomField Sets a custom field for a group member.
    setMessageRemindType Specifies the notification type of group messages.


    API Description
    on Enables event listening.
    off Disables event listening.
    registerPlugin Registers a plugin.
    setLogLevel Sets the log level.
    destroy Terminates an SDK instance.
    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