After sending an SMS, check the new user's balance. If it is lower than 2.5, call an endpoint to alert the user. 2.5 should be in an environment variable, LOW_BALANCE_ALERT_THRESHOLD.
The endpoint should also be defined in an environment variable, DC_LOW_BALANCE_ALERT_API or any other name you think is best.
Wrap the API call in a try catch, but do not throw an error in the catch block. Just ignore any error returned by this endpoint.
The API call should be a POST request with the following payload:
userId: the dcUserID from the DevConsoleUser table
After sending an SMS, check the new user's balance. If it is lower than 2.5, call an endpoint to alert the user. 2.5 should be in an environment variable, LOW_BALANCE_ALERT_THRESHOLD.
The endpoint should also be defined in an environment variable, DC_LOW_BALANCE_ALERT_API or any other name you think is best.
Wrap the API call in a try catch, but do not throw an error in the catch block. Just ignore any error returned by this endpoint.
The API call should be a POST request with the following payload: