This service is meant to run as a GCP Cloud Function v2.
The purpose of the module is to prepare the data required in order to send SMS through the telecommunications api. It is supposed to be used for testing purposes only, to validate the format of an SMS.
Calls through HTTPS allow for swift tests of an SMS from the webapp. Safety measures are implemented with CORS restrictions and Firebase
token validations. The requests are supposed to be sent from confirmed domains in this project.
- Examines the HTTPS request.
- Validates the Firebase token.
- Retrieves the necessary data of the organization.
- Sends the SMS to the provided phone number with the message after validation.
The entrypoint for the HTTPS request is in the main.py
file. The function's name is send_test_sms
.
Expected format:
{
"message": "String",
"to": ["String"] // Phone numbers
}
SINCH_REGION
SINCH_ENDPOINT
GCP_PROJECT
CORS