メニュー

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?

Activity Resource

Activityは、Workerの現在のステータスを表します。これにより、WorkerがTask割り当てを受諾する資格があるかどうかが決まります。 Workerは、常に1つのActivityに設定されます。

TaskRouter pre-populates new Workspaces with "Offline", "Unavailable", and "Available" Activities. Add your own Activities to the list to get a more granular understanding of the way your Workers are spending their time!

Each Activity has:

A FriendlyName, which describes the Worker's state in human-readable terms, and

An Availability, which is a boolean that determines whether Workers are available for task assignment.

If a Worker is performing an Activity that has an availability of "true", it means that Worker is ready to have Tasks assigned to it. If a Worker is set to an Activity with an availability of "false", it means the Worker is not able to accept new Tasks and will not be considered for assignment.

Workerを受付不可から受付可Activityに移動することで、TaskRouterにWorkerが新しいTaskに割り当て可能であることを合図します。 TaskRouterがWorkerにTaskを割り当てると自動的に受付不可のActivityに移行し、こちらに占有されている間は新しいTaskの割り当てが行われなくなります。 作業の完了時は、Workerは受付可のActivityに移行して再度、新しいTaskの承諾を開始できます。

Workerの状態遷移に対する既定のActivityの構成

特定のWorkerの現在のActivityは、次の操作によって変更されます。

  • Your application can update a Worker's Activity by POSTing to the Worker instance resource and providing the SID of any of the Activities in the Workspace.
  • If a Reservation times out, the Worker is placed in the TimeoutActivity identified by the Workspace. By default this is Offline.
  • 新しいWorkerが作成されると、特定のActivitySidが渡された場合を除いて、Workspaceで指定されている DefaultActivity にWorkerが配置されます。これは、既定では Offline です。

In addition, a single-tasking Workspace supports two additional automatic state transitions:

  • When the Worker is assigned a Task, the Worker is placed in the ReservationActivityidentified by the TaskQueue that assigns the Worker the Task. By default this is the Reserved Activity.
  • When a Worker accepts a Task, the Worker is placed in the AssignmentActivity identified by the TaskQueue that assigns the Worker the Task. By default this is the Busy Activity.

If a Workspace in which multiple tasks can be assigned to a Worker, a Worker's state does not automatically update when a Task is assigned.

Activity properties

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created the Activity resource.

available
boolean Not PII

Whether the Worker is eligible to receive a Task when it occupies the Activity. A value of true, 1, or yes indicates the Activity is available. All other values indicate that it is not.

dateCreated
date_time<iso8601> Not PII

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

dateUpdated
date_time<iso8601> Not PII

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

friendlyName
文字列 Not PII

The string that you assigned to describe the Activity resource.

sid
sid<WA> Not PII

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

workspaceSid
sid<WS> Not PII

The SID of the Workspace that contains the Activity.

url
url Not PII

The absolute URL of the Activity resource.

Create an Activity resource

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

The maximum amount of Activities allowed for any given Workspace is 100.

パラメーター
Names in None format
workspace_sid
必須
post sid<WS> Not PII

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

friendly_name
必須
post 文字列 Not PII

A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: on-call, break, and email.

available
オプション
post boolean Not PII

Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of true, 1, or yes specifies the Activity is available. All other values specify that it is not.

例 1
        
        
        
        

        Fetch an Activity resource

        GET
        https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Activities/{Sid}
        パラメーター
        Names in None format
        workspace_sid
        必須
        GET sid<WS> Not PII

        The SID of the Workspace with the Activity resources to fetch.

        sid
        必須
        GET sid<WA> Not PII

        The SID of the Activity resource to fetch.

              
              
              
              

              Read multiple Activity resources

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

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

              パラメーター
              Names in None format
              workspace_sid
              必須
              GET sid<WS> Not PII

              The SID of the Workspace with the Activity resources to read.

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

              The friendly_name of the Activity resources to read.

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

              Whether return only Activity resources that are available or unavailable. A value of true returns only available activities. Values of '1' or yes also indicate true. All other values represent false and return activities that are unavailable.

                    
                    
                    
                    

                    Update an Activity resource

                    post
                    https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Activities/{Sid}
                    パラメーター
                    Names in None format
                    workspace_sid
                    必須
                    post sid<WS> Not PII

                    The SID of the Workspace with the Activity resources to update.

                    sid
                    必須
                    post sid<WA> Not PII

                    The SID of the Activity resource to update.

                    friendly_name
                    オプション
                    post 文字列 Not PII

                    A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: on-call, break, and email.

                    例 1
                          
                          
                          
                          

                          Delete an Activity resource

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

                          The SID of the Workspace with the Activity resources to delete.

                          sid
                          必須
                          削除する sid<WA> Not PII

                          The SID of the Activity resource to delete.

                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

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