mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Use the new mmg api
This commit is contained in:
@@ -78,8 +78,9 @@ class MMGClient(SmsClient):
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_time = monotonic()
|
start_time = monotonic()
|
||||||
|
mmg_url = "https://api.mmg.co.uk/json/api.php"
|
||||||
try:
|
try:
|
||||||
response = request("POST", "https://www.mmgrp.co.uk/API/json/api.php",
|
response = request("POST", mmg_url,
|
||||||
data=json.dumps(data),
|
data=json.dumps(data),
|
||||||
headers={'Content-Type': 'application/json',
|
headers={'Content-Type': 'application/json',
|
||||||
'Authorization': 'Basic {}'.format(self.api_key)})
|
'Authorization': 'Basic {}'.format(self.api_key)})
|
||||||
@@ -89,7 +90,7 @@ class MMGClient(SmsClient):
|
|||||||
self.current_app.logger.info(
|
self.current_app.logger.info(
|
||||||
"API {} request on {} succeeded with {} '{}'".format(
|
"API {} request on {} succeeded with {} '{}'".format(
|
||||||
"POST",
|
"POST",
|
||||||
"https://www.mmgrp.co.uk/API/json/api.php",
|
mmg_url,
|
||||||
response.status_code,
|
response.status_code,
|
||||||
response.json().items()
|
response.json().items()
|
||||||
)
|
)
|
||||||
@@ -99,7 +100,7 @@ class MMGClient(SmsClient):
|
|||||||
self.current_app.logger.error(
|
self.current_app.logger.error(
|
||||||
"API {} request on {} failed with {} '{}'".format(
|
"API {} request on {} failed with {} '{}'".format(
|
||||||
"POST",
|
"POST",
|
||||||
"https://www.mmgrp.co.uk/API/json/api.php",
|
mmg_url,
|
||||||
api_error.status_code,
|
api_error.status_code,
|
||||||
api_error.message
|
api_error.message
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user