question

Nathanael B avatar image
Nathanael B asked Nathanael B commented

Issues with Python & SMS demo app

Hi folks,

I am juuuust getting started with RingCentral & Python, trying to run the sms.py sample app. I filled out .ENV as required, however, cannot run sms.py without error. I get the error:

Unable to authenticate to platform. Check credentials. Either code, or username with password, or jwt has to be provided

I have provided username, password, Client ID, etc. in .ENV and it is as if the script is ignoring it. I see a line of the script that says:

platform.login(jwt=os.environ.get('RC_JWT'))

which leads me to belive this sample .py file defaults to using JWT authentication? If so, how do I change it? If not, what might be wrong with my implementation?


Thank You!

rest apisms and text messagingdeveloper sandbox
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Nathanael B commented

If you want to use username and password flow, you can define the username, password and extension number in your .env file and call the login method like this.

platform.login(os.environ.get('RC_USERNAME', os.environ.get('RC_EXTENSION', os.environ.get('RC_PASSWORD'))

We recommend developers to use JWT auth though.

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thank you sir, this was exactly what I was looking for. Just wanted to get a rough proof together before I dive into JWT :)

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys