Skip to content

Commit

Permalink
Add send unicode SMS method
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Gómez committed May 8, 2017
1 parent b2a62c6 commit d715379
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/sms/send-sms-unicode.py
Original file line number Diff line number Diff line change
@@ -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']
9 changes: 9 additions & 0 deletions instasent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d715379

Please sign in to comment.