Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(sdk-js): mark the sendDocument filename as optional

Yudhi Armyndharisbe969438b57d
diff --git a/sdk/javascript/src/resources/messages.ts b/sdk/javascript/src/resources/messages.ts
index 19e9e44c1..b5f76508e 100644
--- a/sdk/javascript/src/resources/messages.ts
+++ b/sdk/javascript/src/resources/messages.ts
@@ -75,7 +75,10 @@ export class MessagesResource {
return this.client.sendMedia(sessionId, 'send-audio', body);
}
- /** Send a document (url or base64; `filename` required). */
+ /**
+ * Send a document (url or base64). `filename` is optional and is the name the recipient sees;
+ * without it the gateway uses `"file"`, or the URL basename for a URL send on whatsapp-web.js.
+ */
sendDocument(sessionId: string, body: SendMediaRequest): Promise<MessageResponse> {
return this.client.sendMedia(sessionId, 'send-document', body);
}