Skip to content

Instantly share code, notes, and snippets.

@toomore
Created April 25, 2012 18:10
Show Gist options
  • Save toomore/2491781 to your computer and use it in GitHub Desktop.
Save toomore/2491781 to your computer and use it in GitHub Desktop.
Nexmo SMS Sender
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
text = u'這是一封測試簡訊 This a test SMS.'
endpoint = 'https://rest.nexmo.com/sms/json'
data = {
'username': '{yours}',
'password': '{yours}',
'from': '{yours}',
'to': '{yours}',
'type': 'unicode',
'text': text,
'status-report-req': 1,
'client-ref': '{yours}'
}
r = requests.post(endpoint, data=data)
print r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment