question

Rick Smith avatar image
Rick Smith asked Rick Smith answered

Gettting Failed to install 'ringcentral_client==0.6.0' in Python 3.7

Hello all


Have the following code its Python 3.7 When I try to import ring_central client I get Any ideas?


Thanks

----- Failed to install 'ringcentral_client==0.6.0' -----

The code I have so far...

import time
import json
import os
from ringcentral_client import PubNub
from ringcentral import SDK
from ringcentral_client import RestClient, SANDBOX_SERVER
#DO NOT MODIFY ANY OF THIS OR IT WILL BLOW UP IN YOUR FACE
rc= RestClient("blahbla", "other","https://platform.devtest.ringcentral.com")
rc.authorize('+1XXXXXXX, ''', 'mypasword')

ringout_body = {
"to": {"phoneNumber": 'number'},
"from": {"phoneNumber": 'othernumber'},
"callerId": {"phoneNumber": 'id'},
"playPrompt": "true"
}

response = rc.post('/restapi/v1.0/account/~/extension/~/ring-out',ringout_body)

rest api
1 |3000

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

Phong Vu avatar image
Phong Vu answered

Where do you get the ringcentral_client? Is that your own lib?

To use the RingCentral Python SDK, here is all you need to do:

from ringcentral import SDK

rcsdk = SDK( "CLIENTID", "CLIENTSECRET", "RINGCENTRAL_SERVER_URL")
platform = rcsdk.platform()
platform.login("USERNAME", "EXTENSION", "PASSWORD")

resp = platform.post('/restapi/v1.0/account/~/extension/~/ring-out',
              {
                  'from' : { 'phoneNumber': 'othernumber' },
                  'to'   : {'phoneNumber': 'number' },
                  'callerId': {'phoneNumber': 'id'},
                  'playPrompt' : False
              })
print "Call placed. Call status: " + resp.json().status.callStatus


1 |3000

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

Rick Smith avatar image
Rick Smith answered

Thanks!

I believe it came from Ring Central, It's older code so I'm not sure.


Anyway I will try as you suggest.


Thanks Again

1 |3000

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

Rick Smith avatar image
Rick Smith answered Phong Vu commented

Ok, I tried the code and I am getting

Invalid resource owner credentials

I believe it's a phone number that's the user name at least tha's what I had before, or it could be the password...Not sure.

at

                 
  • platform.login("USERNAME", "EXTENSION", "PASSWORD")
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.

You just need to double check the user name and password are correct. Remember the credentials for sandbox are different for the one for production if you happen to test it on your production environment.

0 Likes 0 ·
Rick Smith avatar image
Rick Smith answered Rick Smith commented

Thanks,

I checked as far as I can tell, it's correct, now it's throwing "unauthorized for this grant type" at platform.login. I tried enabling every type of grant??? I could still nothing....

4 comments
1 |3000

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

What is the app's auth type? password flow? Or let me know your app client id.

0 Likes 0 ·

Phong, thanks here is the client ID

dKXy39MFTI200gzNYa4vLg


not sure about auth type, where di I set that? and password flow, not sure on that either? what is it?

0 Likes 0 ·

Ok, your app scope is "Public" and the platform type is "Desktop/Windows". That's why you cannot use password flow login. Please read this dev guide for more info about authentication/authorization.

I am not sure about the purpose of your app and why you chose it as "Public" so I cannot help you change the scope to "Private" which allows me also change the platform type to support password flow authentication.

You can either create a new app, set the scope to "Private" and the server type to "Server-only/(No UI)" then you can use password flow authentication. Or implement 3-legged authentication to login. Or let me know if this app can be a private app so I can help to change them for you.

0 Likes 0 ·
Show more comments
Rick Smith avatar image
Rick Smith answered

Hello All:

Still unable to get the ringout code to work, has anybody gotten it to work in python or C#?, However, I did get SMS to work and was able to send a text message as an experiment.


My real goal is to be able to receive or read and an incoming call and then perform various actions...Is this possible? I am fairly certain I can do this with SMS, but not to clear on voice?


Thanks for any help


1 |3000

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

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