ringcentral / ringcentral-python

RingCentral Connect Platform Python SDK
MIT License
44 stars 35 forks source link

Refresh token has expired exception trying to send SMS #24

Closed MeRyyK closed 5 years ago

MeRyyK commented 5 years ago

Hello, I am using this code to attempt to send an SMS message throug RingCentral Sandbox Server, It is throwing "Refresh Token has expired at patform.login() I am using Python 3.6 64bit and VS2017 on Win8.1 have also tried using 3.7 on same platform. Thanks for your help

from ringcentral import SDK
sdk = SDK(CLIENT_ID, CLIENT_SECRET, SERVER)
platform = sdk.platform()
try :
    platform.login("+nnnnnnnn", "xxx", "xxxxxx")  #Throws Refresh token has expired
except Exception as e: print(str(e))
builder = sdk.create_multipart_builder()
builder.set_body({
        'from': {'phoneNumber': '+nnnn'},
        'to': [{'phoneNumber': '+nnnn'}],
        'text': 'Try this from RC!'
})

request = builder.request('/account/~/extension/~/sms')
response = platform.send_request(request)
print("Response " + response)
kirill-konshin commented 5 years ago

Is it still the case? I can't reproduce.