API Overview

Last updated: 2021-12-01 16:15:15

    Tencent Cloud IM Cross-platform C APIs

    Download link for each platform:

    There are two types of callbacks. One is the asynchronous return from API calls, and the other is the notification pushed by the backend. The logic thread for callback triggering in the IM SDK may not be the same as the thread for API calls.
    On the Windows platform, if you call the TIMInit API to initialize the IM SDK after a UI message loop is created and the thread for calling the TIMInit API is the main UI thread, the IM SDK will throw the callback to the main UI thread to call.

    Note:

    If the parameter string of the API contains Chinese characters, use UTF-8 encoding.

    Event callback APIs

    API Description
    TIMAddRecvNewMsgCallback Adds the callback for receiving new messages
    TIMRemoveRecvNewMsgCallback Deletes the callback for receiving new messages
    TIMSetMsgReadedReceiptCallback Sets the callback for message read receipts
    TIMSetMsgRevokeCallback Sets the callback for message recalls
    TIMSetMsgElemUploadProgressCallback Sets the callback for the upload progress of message element files
    TIMSetGroupTipsEventCallback Sets the callback for group system messages
    TIMSetConvEventCallback Sets the callback for conversation events
    TIMSetNetworkStatusListenerCallback Sets the callback for network connection status
    TIMSetKickedOfflineCallback Sets the callback for notifications of forced logout
    TIMSetUserSigExpiredCallback Sets the callback for user ticket expiration
    TIMSetOnAddFriendCallback Sets the callback for adding friends
    TIMSetOnDeleteFriendCallback Sets the callback for deleting friends
    TIMSetUpdateFriendProfileCallback Sets the callback for updating friends' profiles
    TIMSetFriendAddRequestCallback Sets the callback for friend requests
    TIMSetLogCallback Sets the callback for logs
    TIMSetMsgUpdateCallback Sets the callback for message update notifications returned after messages are modified in the cloud

    IM SDK initialization APIs

    API Description
    TIMInit Initializes the IM SDK
    TIMUninit Uninstalls the IM SDK
    TIMGetSDKVersion Gets IM SDK version number
    TIMSetConfig Sets extra user configurations

    Login and logout APIs

    API Description
    TIMLogin Logs in
    TIMLogout Logs out

    Conversation APIs

    API Description
    TIMConvCreate Creates a conversation
    TIMConvDelete Deletes a conversation
    TIMConvGetConvList Gets the conversation list of recent contacts
    TIMConvSetDraft Sets the draft of a conversation
    TIMConvCancelDraft Deletes the draft of a conversation

    Message APIs

    API Description
    TIMMsgSendNewMsg Sends a new message
    TIMMsgReportReaded Marks a message as read
    TIMMsgRevoke Recalls a message
    TIMMsgFindByMsgLocatorList Locates a message of a conversation by using the message locator
    TIMMsgImportMsgList Imports a message list to a conversation
    TIMMsgSaveMsg Saves a custom message
    TIMMsgGetMsgList Gets the messages of a conversation
    TIMMsgDelete Deletes the messages of a conversation
    TIMMsgDownloadElemToPath Downloads message elements (such as image, video, audio, and file) to a path
    TIMMsgBatchSend Sends a message to multiple users at a time, but not to groups

    Group APIs

    API Description
    TIMGroupCreate Creates a group
    TIMGroupDelete Deletes a group
    TIMGroupJoin Requests to join a group
    TIMGroupQuit Quits a group
    TIMGroupInviteMember Invites someone to join a group
    TIMGroupDeleteMember Removes a member from a group
    TIMGroupGetJoinedGroupList Gets the list of groups that a user has joined
    TIMGroupGetGroupInfoList Gets group information
    TIMGroupModifyGroupInfo Modifies group information
    TIMGroupGetMemberInfoList Gets group member information
    TIMGroupModifyMemberInfo Modifies group member information
    TIMGroupGetPendencyList Gets the pending group request list.
    Pending group requests are those that are not handled, for example, requests to join a group or to invite a user to join a group.
    TIMGroupReportPendencyReaded Reports that a pending group request is read
    TIMGroupHandlePendency Handles pending group requests

    User profile APIs

    API Description
    TIMProfileGetUserProfileList Gets the profiles of specified users
    TIMProfileModifySelfUserProfile Modifies one’s own profile

    Relationship chain APIs

    API Description
    TIMFriendshipGetFriendProfileList Gets friend lists
    TIMFriendshipAddFriend Adds friends
    TIMFriendshipHandleFriendAddRequest Handles friend requests
    TIMFriendshipModifyFriendProfile Updates friends’ profiles (such as remarks)
    TIMFriendshipDeleteFriend Deletes friends
    TIMFriendshipCheckFriendType Checks the friend type (one-way or two-way)
    TIMFriendshipCreateFriendGroup Creates a friend list
    TIMFriendshipGetFriendGroupList Gets the information of a friend list
    TIMFriendshipModifyFriendGroup Modifies a friend list
    TIMFriendshipDeleteFriendGroup Deletes a friend list
    TIMFriendshipAddToBlackList Adds a user to the blocklist
    TIMFriendshipGetBlackList Gets the blocklist
    TIMFriendshipDeleteFromBlackList Removes a user from the blocklist
    TIMFriendshipGetPendencyList Gets the pending friend request list
    TIMFriendshipDeletePendency Deletes a pending friend request
    TIMFriendshipReportPendencyReaded Reports that a pending friend request is read