From 741e5e86f8b57d3a57d55fd8765332a586481dda Mon Sep 17 00:00:00 2001 From: allburov Date: Sat, 2 Dec 2023 16:28:34 +0700 Subject: [PATCH] [core] Reformat send messages documentation --- .../en/docs/how-to/send-messages/index.md | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/site/content/en/docs/how-to/send-messages/index.md b/docs/site/content/en/docs/how-to/send-messages/index.md index a47d8ad6..dcd08e7d 100644 --- a/docs/site/content/en/docs/how-to/send-messages/index.md +++ b/docs/site/content/en/docs/how-to/send-messages/index.md @@ -15,18 +15,30 @@ If you haven't yet - please follow the steps from [**Quick Start →**]({{< relr ## Fields There are common fields that you can find in almost all requests: -- `session` - a session name from which account you're sending the message. We use `default` in the examples. - - Core ![](/images/versions/core.png) version supports only `default` session. - - Plus ![](/images/versions/plus.png) allows you to run multiple sessions inside one container to save your memory and CPU resources! +```json +{ + "session": "default", + "chatId": "12132132130@c.us", + "file": "..." +} +``` + +### session +`session` - a session name from which account you're sending the message. We use `default` in the examples. +- Core ![](/images/versions/core.png) version supports only `default` session. +- Plus ![](/images/versions/plus.png) allows you to run multiple sessions inside one container to save your memory and CPU resources! + Read more about [multiple sessions →]({{< relref "/docs/how-to/sessions" >}}) -- `chatId` - it's a phone number or Group identifier where you're sending the message. - - **Phone numbers** accounts use international phone number without + at the start and add `@c.us` at the end. - For phone number `12132132131` the `chatId` is `12132132131@c.us`. - - **Groups** use random number with `@g.us` at the end. +### chatId +`chatId` - it's a phone number or Group identifier where you're sending the message. +- **Phone numbers** accounts use international phone number without + at the start and add `@c.us` at the end. + For phone number `12132132131` the `chatId` is `12132132131@c.us`. +- **Groups** use random number with `@g.us` at the end. +### file When sending media (images, voice, files) you can either use: -- `file.data` field with base64 encoded file (https://base64.guru/converter/encode/file) +- `file.data` field [with base64 encoded file](https://base64.guru/converter/encode/file) - `file.url` field with public available URL for that file ## Endpoints