twilio-python icon indicating copy to clipboard operation
twilio-python copied to clipboard

Can't instantiate a TwilioRestClient with API Key and API Secret

Open acamino opened this issue 10 years ago • 3 comments

Version: 5.6.0 API Subdomain (api/taskrouter/ip_messaging): API

There is no way to create a TwilioRestClient with an API Key and API Secret. https://github.com/twilio/twilio-python/blob/master/twilio/rest/base.py

This functionality is supported in other Twilio Helper Libraries.

acamino avatar Sep 22 '16 14:09 acamino

Stumbled upon this issue as well, but found that there is a way to do it, but the documentation doesn't reflect that. Pull request #263 is out of date with master, but the doc fix would provide better guidance around how to do it. Providing an example here for anyone else who runs into it:

from twilio.rest import TwilioRestClient
api_key_sid = 'The api key sid from when you generated the token'
api_token = 'The actual token that you received'
account_sid = 'The main account sid'
client = TwilioRestClient(account=api_key_sid, token=api_token, request_account=account_sid)

johnpneumann avatar Sep 29 '16 15:09 johnpneumann

This has been fixed in 6.0.0!

jingming avatar Apr 05 '17 14:04 jingming

Thank you!

On Apr 5, 2017, at 09:51, Jingming Niu [email protected] wrote:

Closed #286.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

johnpneumann avatar Apr 08 '17 02:04 johnpneumann