From de09285cbbfea8e4652dbf0d81f2ff2f3d3ae839 Mon Sep 17 00:00:00 2001 From: Mbenguia Lioma Husseini Date: Sat, 15 May 2021 02:33:20 +0200 Subject: [PATCH] Fixed KeyError on sending message with Rest in Python --- clickatell/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clickatell/__init__.py b/clickatell/__init__.py index 3edf733..9c7fadc 100755 --- a/clickatell/__init__.py +++ b/clickatell/__init__.py @@ -42,7 +42,7 @@ def parseResponse(self, response): """ response['body'] = json.loads(response['body']) response['messages'] = response['body']['messages'] - response['error'] = response['body']['error'] + response['error'] = response['body']['messages'][0]['error'] del response['body'] return response