waha-api-client-ts
    Preparing search index...

    Interface SendFileParams

    File message parameters

    Parameters for sending a file/document using sendFile() or safeSendFile().

    // Send PDF from URL
    const params: SendFileParams = {
    chatId: '1234567890@c.us',
    file: 'https://example.com/document.pdf',
    filename: 'report.pdf',
    caption: 'Monthly report',
    };

    // Send file from base64
    const base64Params: SendFileParams = {
    chatId: '1234567890@c.us',
    file: 'data:application/pdf;base64,JVBERi0xLjcKC...',
    filename: 'document.pdf',
    };

    await client.sendFile(params);
    interface SendFileParams {
        caption?: string;
        chatId: string;
        config?: RequestConfig;
        file: string;
        filename?: string;
        reply_to?: string;
    }
    Index

    Properties

    caption?: string

    Caption for the file (optional) Text that will be displayed with the file

    chatId: string

    Chat ID to send message to Format: phone@c.us for individual chats, groupId@g.us for groups

    config?: RequestConfig

    Optional request configuration override Allows overriding session, timeout, retry settings for this specific request

    file: string

    File data (base64 or URL) Can be a URL (http/https) or base64-encoded file data with data URI scheme

    filename?: string

    Filename (optional) The name that will be shown for the file in WhatsApp

    reply_to?: string

    Message ID to reply to (optional) If provided, the file will be sent as a reply to the specified message