diff --git a/examples/sms/send-sms-unicode.py b/examples/sms/send-sms-unicode.py new file mode 100644 index 0000000..2e31ca2 --- /dev/null +++ b/examples/sms/send-sms-unicode.py @@ -0,0 +1,7 @@ +import instasent + +client = instasent.Client('my-token') +response = client.send_sms_unicode('My company', '+34666666666', 'test message áéíóú') + +print response['response_code'] +print response['response_body'] \ No newline at end of file diff --git a/instasent/client.py b/instasent/client.py index 79a0147..e60a045 100644 --- a/instasent/client.py +++ b/instasent/client.py @@ -18,6 +18,15 @@ def send_sms(self, sender, to, text, client_id=''): return self.execute_request(url, http_method, data) + def send_sms_unicode(self, sender, to, text, client_id=''): + url = self.secureChannel + 'sms/' + + http_method = 'POST' + + data = {'from': sender, 'to': to, 'text': text, 'allowUnicode': 'true'} + + return self.execute_request(url, http_method, data) + def get_sms_by_id(self, id): url = self.secureChannel + 'sms/' + id