twilio-python
                                
                                 twilio-python copied to clipboard
                                
                                    twilio-python copied to clipboard
                            
                            
                            
                        [DOCS INCONSISTENCY] rest client parameters have no auth_token
Issue Summary
Rest client does not take auth_token as an argument, but username and password, even though all over documentation auth_token is used
Steps to Reproduce
- import rest client
- try to initialize client with sid and auth_token
- client does not take auth_token
Technical details:
- twilio-python version: 6.46.0
- python version: 3.8.1
Could you provide more details, code samples, and links for what you're trying to accomplish? Are you referring to client initialization using named params?
Could you provide more details, code samples, and links for what you're trying to accomplish? Are you referring to client initialization using named params?
Yep, Im talking about client initialization. After fetching latest version of library, I tried to initialize the client as it was done in official documentation but it seems that client does not take auth_token argument anymore. After examining the library itself, it is clear that it takes username and password instead.
Could you provide a link to the documentation you're referring to that's incorrect?
Account SID plus auth token should work fine. Docs here: https://github.com/twilio/twilio-python#api-credentials
Could you provide a link to the documentation you're referring to that's incorrect?
Account SID plus auth token should work fine. Docs here: https://github.com/twilio/twilio-python#api-credentials
Twilio rest client source code: https://github.com/twilio/twilio-python/blob/main/twilio/rest/init.py#L24 I can't see auth_token as a parameter.
Documentation: https://www.twilio.com/docs/sms/send-messages (pl: python, line: 10 - initialization of client instance)
The examples in the docs you've linked show initializing the client with the account SID auth token: client = Client(account_sid, auth_token)
The code itself calls these args username, password as they're meant to be more generic. For example, these args can either be your account_sid, auth_token, or they can be your api_key_sid, api_key_secret.
An example of the latter here: https://www.twilio.com/docs/iam/keys/api-key-resource?code-sample=code-authenticate-with-api-key-and-api-secret&code-language=Python&code-sdk-version=6.x
After your explanation, got it. But it is very implicit and not clear for the first time. It would be great if documentation was more self-explanatory.