Use the new mmg api

This commit is contained in:
Rebecca Law
2016-07-19 15:27:52 +01:00
parent ae85baf810
commit aca23472e3

View File

@@ -78,8 +78,9 @@ class MMGClient(SmsClient):
}
start_time = monotonic()
mmg_url = "https://api.mmg.co.uk/json/api.php"
try:
response = request("POST", "https://www.mmgrp.co.uk/API/json/api.php",
response = request("POST", mmg_url,
data=json.dumps(data),
headers={'Content-Type': 'application/json',
'Authorization': 'Basic {}'.format(self.api_key)})
@@ -89,7 +90,7 @@ class MMGClient(SmsClient):
self.current_app.logger.info(
"API {} request on {} succeeded with {} '{}'".format(
"POST",
"https://www.mmgrp.co.uk/API/json/api.php",
mmg_url,
response.status_code,
response.json().items()
)
@@ -99,7 +100,7 @@ class MMGClient(SmsClient):
self.current_app.logger.error(
"API {} request on {} failed with {} '{}'".format(
"POST",
"https://www.mmgrp.co.uk/API/json/api.php",
mmg_url,
api_error.status_code,
api_error.message
)