[core] Reformat send messages documentation

This commit is contained in:
allburov committed 2023-12-02 16:28:44 +07:00
1 parent 390a171891
commit 741e5e86f8
1 file changed
+20 -8
@@ -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