メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Worker Resource

Workerは、コールセンターで働くエージェントやリードを処理する販売員など、Taskを実行できるエンティティを表します。

Worker properties

Workerの属性
Every Worker has a set of Attributes that describe what sort of tasks the Worker is able to complete. Attributes are modeled as a JSON string and may contain string, integer, and array data. These attributes will be used to link a Worker to one or more TaskQueues, and thus determine which Tasks the Worker is eligible to handle.

たとえば、2人のエージェントが存在するとします。 1人目のWorkerであるAliceは英語を話し、サポートとセールスのTaskを処理します。

{ 
    "skills": ["support", "sales"], 
    "languages":["english"]
}

2人目のWorkerであるBobは、セールスリクエストのみ処理し、スペイン語と英語を話します。

{ 
    "skills": ["sales"], 
    "languages": ["spanish", "english"]
}

A property of contact_uri is required on the WorkerAttributes to indicate whom to call when issuing a Dequeue Instruction.

{ 
    "skills": ["sales"], 
    "languages": ["spanish", "english"],
    "contact_uri": "client:Bob"
}

WorkerのActivity

また、各WorkerにはActivityが存在し、ActivitySid で表されます。 このActivityによって、Workerのシステム内での現在の状態、さらにWorkerが新しいTask割り当てを受諾できるかどうかが決まります。

Names in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created the Worker resource.

activity_name
文字列 Not PII

The friendly_name of the Worker's current Activity.

activity_sid
sid<WA> Not PII

The SID of the Worker's current Activity.

attributes
文字列 PII MTL: 30 DAYS

The JSON string that describes the Worker. For example: { "email": "Bob@example.com", "phone": "+5095551234" }. Note If this property has been assigned a value, it will only be displayed in FETCH actions that return a single resource. Otherwise, this property will be null, even if it has a value. This data is passed to the assignment_callback_url when TaskRouter assigns a Task to the Worker.

available
boolean Not PII

Whether the Worker is available to perform tasks.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_status_changed
date_time<iso8601> Not PII

The date and time in GMT of the last change to the Worker's activity specified in ISO 8601 format. Used to calculate Workflow statistics.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

friendly_name
文字列 PII MTL: 30 DAYS

The string that you assigned to describe the resource. Friendly names are case insensitive, and unique within the TaskRouter Workspace.

sid
sid<WK> Not PII

The unique string that we created to identify the Worker resource.

workspace_sid
sid<WS> Not PII

The SID of the Workspace that contains the Worker.

url
url Not PII

The absolute URL of the Worker resource.

links
uri_map Not PII

The URLs of related resources.

Create a Worker resource

post
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers
パラメーター
Names in REST API format
workspace_sid
Path
post sid<WS> Not PII

The SID of the Workspace that the new Worker belongs to.

friendly_name
必須
post 文字列 PII MTL: 30 DAYS

A descriptive string that you create to describe the new Worker. It can be up to 64 characters long.

activity_sid
オプション
post sid<WA> Not PII

The SID of a valid Activity that will describe the new Worker's initial state. See Activities for more information. If not provided, the new Worker's initial state is the default_activity_sid configured on the Workspace.

attributes
オプション
post 文字列 PII MTL: 30 DAYS

A valid JSON string that describes the new Worker. For example: { "email": "Bob@example.com", "phone": "+5095551234" }. This data is passed to the assignment_callback_url when TaskRouter assigns a Task to the Worker. Defaults to {}.

        
        
        
        

        Fetch a Worker resource

        GET
        https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{Sid}
        パラメーター
        Names in REST API format
        workspace_sid
        Path
        GET sid<WS> Not PII

        The SID of the Workspace with the Worker to fetch.

        sid
        Path
        GET sid<WK> Not PII

        The SID of the Worker resource to fetch.

              
              
              
              

              Read multiple Worker resources

              GET
              https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers

              By default, this will return the first 50 Workers. Supply a PageSize parameter to fetch more than 50 Workers. See pagination information for more information.

              パラメーター
              Names in REST API format
              workspace_sid
              Path
              GET sid<WS> Not PII

              The SID of the Workspace with the Workers to read.

              activity_name
              オプション
              GET 文字列 Not PII

              The activity_name of the Worker resources to read.

              activity_sid
              オプション
              GET sid<WA> Not PII

              The activity_sid of the Worker resources to read.

              available
              オプション
              GET 文字列 Not PII

              Whether to return only Worker resources that are available or unavailable. Can be true, 1, or yes to return Worker resources that are available, and false, or any value returns the Worker resources that are not available.

              friendly_name
              オプション
              GET 文字列 PII MTL: 30 DAYS

              The friendly_name of the Worker resources to read.

              target_workers_expression
              オプション
              GET 文字列 Not PII

              Filter by Workers that would match an expression on a TaskQueue. This is helpful for debugging which Workers would match a potential queue.

              task_queue_name
              オプション
              GET 文字列 Not PII

              The friendly_name of the TaskQueue that the Workers to read are eligible for.

              task_queue_sid
              オプション
              GET sid<WQ> Not PII

              The SID of the TaskQueue that the Workers to read are eligible for.

              例 1
                    
                    
                    
                    
                    例 2
                          
                          
                          
                          

                          You can use the TargetWorkersExpression parameter to see which workers are eligible for a queue, or to understand why a certain queue isn't mapping to the workers you would expect.

                          This example checks which workers have a name attribute of Alice, Bob, Connie or David - and, by extension, if we had a queue that mapped to workers with those names, we can be confident that these workers would be associated with the queue.

                          Update a Worker resource

                          post
                          https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{Sid}

                          Workerの現在のActivityの更新は、どのTaskRouterアプリケーションでも共通の操作です。 この操作を実行するには、TaskRouterの Worker.jsライブラリまたはこのREST APIを使用します。

                          パラメーター
                          Names in REST API format
                          workspace_sid
                          Path
                          post sid<WS> Not PII

                          The SID of the Workspace with the Worker to update.

                          sid
                          Path
                          post sid<WK> Not PII

                          The SID of the Worker resource to update.

                          activity_sid
                          オプション
                          post sid<WA> Not PII

                          The SID of a valid Activity that will describe the Worker's initial state. See Activities for more information.

                          attributes
                          オプション
                          post 文字列 PII MTL: 30 DAYS

                          The JSON string that describes the Worker. For example: { "email": "Bob@example.com", "phone": "+5095551234" }. This data is passed to the assignment_callback_url when TaskRouter assigns a Task to the Worker. Defaults to {}.

                          friendly_name
                          オプション
                          post 文字列 PII MTL: 30 DAYS

                          A descriptive string that you create to describe the Worker. It can be up to 64 characters long.

                          reject_pending_reservations
                          オプション
                          post boolean Not PII

                          Whether to reject pending reservations.

                                
                                
                                
                                

                                Delete a Worker resource

                                削除する
                                https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{Sid}
                                パラメーター
                                Names in REST API format
                                workspace_sid
                                Path
                                削除する sid<WS> Not PII

                                The SID of the Workspace with the Worker to delete.

                                sid
                                Path
                                削除する sid<WK> Not PII

                                The SID of the Worker resource to delete.

                                      
                                      
                                      
                                      

                                      If you wish to view Reservations for a particular worker, use the Worker Reservation Resource.

                                      Rate this page:

                                      ヘルプが必要ですか?

                                      誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。