# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioTaskRouterClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "{{ account_sid }}" auth_token = "{{ auth_token }}" workspace_sid = "{{ workspace_sid }}" taskqueue_sid = "{{ taskqueue_sid }}" client = TwilioTaskRouterClient(account_sid, auth_token) taskqueue = client.taskqueues(workspace_sid).update(taskqueue_sid, target_workers='languages HAS "english"') print taskqueue.target_workers # alternatively taskqueue = client.workers(workspace_sid).get(taskqueue_sid) taskqueue = taskqueue.update(target_workers='languages HAS "english"') print taskqueue.target_workers
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioTaskRouterClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "{{ account_sid }}" auth_token = "{{ auth_token }}" workspace_sid = "{{ workspace_sid }}" taskqueue_sid = "{{ taskqueue_sid }}" client = TwilioTaskRouterClient(account_sid, auth_token) taskqueue = client.taskqueues(workspace_sid).get(taskqueue_sid) taskqueue.delete()
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioTaskRouterClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "{{ account_sid }}" auth_token = "{{ auth_token }}" workspace_sid = "{{ workspace_sid }}" client = TwilioTaskRouterClient(account_sid, auth_token) for taskqueue in client.taskqueues(workspace_sid).list(): print taskqueue.friendly_name
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioTaskRouterClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "{{ account_sid }}" auth_token = "{{ auth_token }}" workspace_sid = "{{ workspace_sid }}" client = TwilioTaskRouterClient(account_sid, auth_token) taskqueue = client.taskqueues(workspace_sid).create( friendly_name='English', reservation_activity_sid='WAxxxx', assignment_activity_sid='WAyyyy', target_workers='languages HAS "english"') print taskqueue.friendly_name
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioTaskRouterClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "{{ account_sid }}" auth_token = "{{ auth_token }}" workspace_sid = "{{ workspace_sid }}" taskqueue_sid = "{{ taskqueue_sid }}" client = TwilioTaskRouterClient(account_sid, auth_token) statistics = client.taskqueues(workspace_sid).get( taskqueue_sid).statistics.get() print statistics.cumulative["reservations_accepted"]
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioTaskRouterClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "{{ account_sid }}" auth_token = "{{ auth_token }}" workspace_sid = "{{ workspace_sid }}" taskqueue_sid = "{{ taskqueue_sid }}" client = TwilioTaskRouterClient(account_sid, auth_token) statistics = client.taskqueues(workspace_sid).get(taskqueue_sid).statistics.get() print statistics.cumulative["reservations_accepted"]