Skip to content

How to send a file by URL#

Installation#

python -m pip install whatsapp-api-client-python

Import#

from whatsapp_api_client_python import API

Examples#

You may see the full example at: sendPictureByLink.py

How to initialize an object#

greenAPI = API.GreenAPI(ID_INSTANCE, API_TOKEN_INSTANCE)

How to send a file by URL#

response = greenAPI.sending.sendFileByUrl(
    "11001234567@c.us",
    "https://download.samplelib.com/png/sample-clouds2-400x300.png",
    "sample-clouds2-400x300.png",
    "Sample PNG"
)

print(response.data)

Examples list#

Description Module
Example of sending text sendTextMessage.py
Example of sending a picture by URL sendPictureByLink.py
Example of sending a picture by uploading from the disk sendPictureByUpload.py
Example of a group creation and sending a message to the group createGroupAndSendMessage.py
Example of incoming webhooks receiving receiveNotification.py
Example of sending a polling message sendPoll.py