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

    Interface APIResponse<T>

    API Response wrapper

    Generic wrapper for API responses from WAHA.

    const response: APIResponse<MessageInfo> = {
    success: true,
    data: {
    id: 'message-id',
    from: '1234567890@c.us',
    body: 'Hello!',
    },
    };

    const errorResponse: APIResponse = {
    success: false,
    error: 'Session not found',
    message: 'The specified session does not exist',
    };
    interface APIResponse<T = any> {
        data?: T;
        error?: string;
        message?: string;
        success?: boolean;
    }

    Type Parameters

    • T = any

      Type of the data payload

    Index

    Properties

    data?: T

    Response data payload (optional) Contains the actual response data when successful

    error?: string

    Error code or type (optional) Present when the request failed

    message?: string

    Human-readable message (optional) Additional information about success or failure

    success?: boolean

    Whether the request was successful (optional)