Skip to content

example issue. #2

@fredmo

Description

@fredmo

In the example,

after setting the :
SENDER_NAME = 'hst2XXXXXXX' # Name of your app in dev console
AUTH_TOKEN = 'Basic XXX==' # Authorization header from dev console

By using the current example in the python3 script on a raspberry pi :

python3 send_sms.py
Traceback (most recent call last):
File "/home/pi/send_sms.py", line 13, in
sms = utils.SMS(AUTH_TOKEN=AUTH_TOKEN, )
TypeError: init() missing 1 required positional argument: 'SENDER_NAME'

I guess the example should be modified to
sms = utils.SMS(AUTH_TOKEN=AUTH_TOKEN, SENDER_NAME =SENDER_NAME )
???

Nevertheless, after the modification I have this error :

Traceback (most recent call last):
File "/home/pi/send_sms.py", line 14, in
res = sms.send_sms(message=message,
File "/home/pi/.local/lib/python3.9/site-packages/python_orange_sms/utils.py", line 62, in send_sms
access_token = self.get_access_token()
File "/home/pi/.local/lib/python3.9/site-packages/python_orange_sms/utils.py", line 38, in get_access_token
raise Exception(f"Failed with following response: '{r.text}'")
Exception: Failed with following response: '{"error":"unauthorized_client","error_description":"The requested service needs credentials, but the ones provided were not approved."}'

On https://developer.orange.com/myapps/hst2XXXXXXX/addapi , what is the Api to allow for this module ?
I am a Orange France user.

Regards.
Frederic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions