TIMMsgSearchLocalMessages

Introduction

Search local message

Only local messages can be searched for, for example, received messages or historical messages obtained after the API is called.

Ultimate package only, Buy Ultimate package to enable it.

Parameter details

Parameter name Parameter type Required Description
msgSearchLocalMessagesParams MsgSearchLocalMessagesParams yes Param of searching local message

Returned template

Promise<commonResult<MessageSearchResult>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: MessageSearchResult | undefined;
    json_params?: MessageSearchResult | undefined; 
    user_data?: string | undefined;
}

Return value details

name type description
code TIMResultTIMErrCode Request result: Error codes. 0 means success.
desc string | undefined The description of the error. It will be empty if success.
json_param MessageSearchResult | undefined Return value of calling API
json_params MessageSearchResult | undefined Return value of calling API. Compatible field, which is returned in some cases.
user_data string | undefined ImSDK is responsible for transporting user-defined data without any processing

Code example

import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { MsgSearchLocalMessagesParams, Json_search_message_param } from "im_electron_sdk/dist/interfaces";

let params: Json_search_message_param = {
    msg_search_param_keyword_array: [""],    // optional
    msg_search_param_message_type_array: [0],    // optional
    msg_search_param_conv_id: '',    // optional
    msg_search_param_conv_type: 1,    // optional
    msg_search_param_search_time_position: 0,    // optional
    msg_search_param_search_time_period: 24 * 60 * 60 * 7,    // optional
    msg_search_param_page_index: 0,    // optional
    msg_search_param_page_size: 100,    // optional
    msg_search_param_keyword_list_match_type: 0,    // optional
    msg_search_param_send_identifier_array: ['']    // optional
}
let param: MsgSearchLocalMessagesParams = {
    params: params,
    user_data: ''
}

const { code } = await timRenderInstance.TIMMsgSearchLocalMessages(param);
if (code == 0) {
    // success
}

results matching ""

    No results matching ""