Skip to content

green-api/whatsapp-api-client-python / skills

greenapi-client-python

Verified

Write correct Python code with the official GREEN-API SDK whatsapp-api-client-python (package whatsapp_api_client_python). Use when sending/receiving WhatsApp messages, files, polls, groups, journals, queues, statuses, contacts, partner instances, polling notifications, or configuring a GREEN-API instance in Python. Triggers: GREEN-API, green-api, whatsapp-api-client-python, GreenAPI, GreenApi, sendMessage, receiveNotification.

FileKindSize
SKILL.mdskill md12.9 KB
references/account.mdmarkdown2.9 KB
references/contacts.mdmarkdown796 B
references/device.mdmarkdown346 B
references/groups.mdmarkdown1.9 KB
references/inventory.mdmarkdown12.1 KB
references/journals.mdmarkdown1.1 KB
references/marking.mdmarkdown436 B
references/partner.mdmarkdown930 B
references/queues.mdmarkdown843 B
references/receiving.mdmarkdown4.1 KB
references/sending.mdmarkdown3.7 KB
references/service-methods.mdmarkdown2.0 KB
references/statuses.mdmarkdown1.3 KB

references/sending.md

View on GitHub
# Sending (`greenAPI.sending`)

Class: `Sending` in `tools/sending.py`.  
Index: https://green-api.com/en/docs/api/sending/

All send methods enqueue messages. Queue retention **24 hours**. Rate controlled by
`delaySendMessagesMilliseconds` — https://green-api.com/en/docs/api/send-messages-delay/

Typical success body: `{ "idMessage": "..." }` (upload also returns `urlFile`).

## `sendMessage`

Docs: https://green-api.com/en/docs/api/sending/SendMessage/

| Param | Required | Notes |
| --- | --- | --- |
| `chatId` | yes | `@c.us` / `@g.us` |
| `message` | yes | max 20000 chars, UTF-8 |
| `quotedMessageId` | no | same chat only |
| `linkPreview` | no | bool; default on server |
| `typePreview` | no | `large` / `small` |
| `customPreview` | no | object: title, description, link, urlFile, jpegThumbnail |
| `typingTime` | no | 1000–20000 ms |
| `archiveChat` | no | SDK optional (if supported by account) |

```python
greenAPI.sending.sendMessage("79876543210@c.us", "Hello")
await greenAPI.sending.sendMessageAsync("79876543210@c.us", "Hello")
```

## `sendFileByUrl`

Docs: https://green-api.com/en/docs/api/sending/SendFileByUrl/

| Param | Required | Notes |
| --- | --- | --- |
| `chatId` | yes | |
| `urlFile` | yes | direct file URL, `http(s)://` |
| `fileName` | yes | **with extension** |
| `caption` | no | max 1024 |
| `quotedMessageId` | no | |
| `typingTime` / `typingType` | no | `typingType="recording"` for audio |
| `archiveChat` | no | |

Max file size **100 MB**. One file per request.

## `sendFileByUpload`

Docs: https://green-api.com/en/docs/api/sending/SendFileByUpload/

Uses **media** host. SDK: second arg is filesystem `path`.

| Param | Required | Notes |
| --- | --- | --- |
| `chatId` | yes | |
| `path` | yes | local file path (SDK-only name; becomes form file) |
| `fileName` | no | with extension |
| `caption` | no | max 1024 |
| `quotedMessageId`, `typingTime`, `typingType` | no | |

Response: `idMessage`, `urlFile` (link ~15 days).

## `uploadFile`

Docs: https://green-api.com/en/docs/api/sending/UploadFile/

Upload to cloud storage; then send with `sendFileByUrl` using returned URL.

```python
up = greenAPI.sending.uploadFile("data/logo.jpg")
# then sendFileByUrl(..., urlFile=up.data["urlFile"], fileName="logo.jpg")
```

## `sendLocation`

Docs: https://green-api.com/en/docs/api/sending/SendLocation/

Required: `chatId`, `latitude`, `longitude`. Optional: `nameLocation`, `address`,
`quotedMessageId`, `typingTime`.

## `sendContact`

Docs: https://green-api.com/en/docs/api/sending/SendContact/

Required: `chatId`, `contact` dict (fields per docs: phoneContact, firstName, …).

## `forwardMessages`

Docs: https://green-api.com/en/docs/api/sending/ForwardMessages/

Required: `chatId` (destination), `chatIdFrom` (source), `messages` (list of idMessage).

## `sendPoll`

Docs: https://green-api.com/en/docs/api/sending/SendPoll/

```python
greenAPI.sending.sendPoll(
    "79876543210@c.us",
    "Choose a color:",
    [{"optionName": "Red"}, {"optionName": "Green"}, {"optionName": "Blue"}],
    multipleAnswers=False,
)
```

## `sendInteractiveButtons` / `sendInteractiveButtonsReply`

Docs:

- https://green-api.com/en/docs/api/sending/SendInteractiveButtons/
- https://green-api.com/en/docs/api/sending/SendInteractiveButtonsReply/

SDK params: `chatId`, `body`, `buttons`, optional `header`, `footer`, `typingTime`.
Prefer these over deprecated `sendButtons` / `sendTemplateButtons` / `sendListMessage`.

## Deprecated (still in SDK)

Do not use in new code unless the user explicitly asks:

- `sendButtons` → use `sendInteractiveButtons`
- `sendTemplateButtons` → use `sendInteractiveButtonsReply`
- `sendListMessage` → use `sendMessage` / interactive methods
- `sendLink` → use `sendMessage` with `linkPreview`
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall