コード例 #1
0
# 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
コード例 #2
0
# 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()
コード例 #3
0
ファイル: example-1.py プロジェクト: crtr0/api-snippets
# 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
コード例 #4
0
ファイル: example-1.py プロジェクト: crtr0/api-snippets
# 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()
コード例 #5
0
# 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
コード例 #6
0
# 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
コード例 #7
0
# 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"]
コード例 #8
0
ファイル: example-1.py プロジェクト: crtr0/api-snippets
# 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"]