These code snippets demonstrate how to perform operations with the Business Communications API using Python.
This project contains multiple examples. Each file contains a single operation with the Business Communications API.
To run the Python scripts you need to be signed up with Business Messages.
The documentation for the Business Communications API can be found here.
You must have the following software installed on your machine:
- Google Cloud SDK (aka gcloud)
- Python
python -m venv source /bin/activate /bin/pip install -r requirements.txt
python -m venv \Scripts\activate \Scripts\pip.exe install -r requirements.txt
Python 3.5, 3.6 and 3.7, and 3.8 are fully supported and tested.
- Locate the file with the code snippet you want to execute.
- Replace all the values of the variables on top of the file that are set to
EDIT_HERE
. - Make sure the path to your service account key is correct. The scripts use the path
./service_account_key.json
. - On your terminal, run
python file-name-to-be-executed.py
To learn more about setting up Business Messages and supporting chat from Search and Maps, see the documentation.