问题
I am currently leveraging Sinch SMS to send SMS notifications based on events for a web application in python using sinchsms. When I send a message I get this exception:
HTTP Error 403: Sandobx SMS only allowed to be sent to verified numbers.
With this stacktrace:
File "/usr/local/lib/python2.7/site-packages/sinchsms.py", line 79, in send_message
return self._request(self.SEND_SMS_URL + to_number, values)
File "/usr/local/lib/python2.7/site-packages/sinchsms.py", line 40, in _request
connection = urllib2.urlopen(request)
File "/usr/local/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Sandobx SMS only allowed to be sent to verified numbers.
I don't see a way on the sinch sms dashboard to validate the number or register a number
回答1:
In sandbox mode you can send sms to one number only (an unfortunate side effect of some scammers/fraudsters). You can verify you number under https://www.sinch.com/dashboard/#/account. To send to any number, you need to make a payment and request a production key.
来源:https://stackoverflow.com/questions/30468789/how-to-add-a-validated-number-to-sinch-sandbox