the_big_blackbox
the_big_blackbox

Reputation: 1196

Twilio Autopilot Python quickstart tutorial

I am trying to follow the following Twilio Autopilot tutorial https://www.twilio.com/docs/autopilot/quickstart/python?code-sample=code-create-your-first-assistant-with-autopilot-7&code-language=Python&code-sdk-version=6.x

I am trying to create my first assistant with autopilot and my own account_sid and auth_token.

# Download the helper library from 
https://www.twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

assistant = client.autopilot \
              .assistants \
              .create(
                   friendly_name='Quickstart Assistant',
                   unique_name='quickstart-assistant'
               )

print(assistant.sid) 

However i receive the following error when i try execute the script.

enter image description here

Upvotes: 1

Views: 185

Answers (1)

tthurium
tthurium

Reputation: 56

Twilio developer evangelist here.

Did you by chance run this script more than once? The unique_name must be unique, so if you ran the script twice without changing that value, the second try would fail.

I tried running the code example you posted (with my own account credentials), and it worked the first time but failed the second time with the same exact error message you got (35002). Changing the unique_name value to quickstart-assistant-2, the script ran successfully again.

If you can log in to Twilio, you should be able to see the list of autopilot assistants you have created, which would tell you if you were able to create the assistant successfully on the first try.

Let me know if you have any additional questions or issues.

Upvotes: 4

Related Questions