Team Call
The Team Call Data Action allows you to programmatically override team configuration just prior to a call being offered to a team.
Note that the data action is not invoked if the call is sent directly to the team's voicemail e.g. transferring to the team's voicemail or redirecting to Spoke via its extension with sendToVoicemail=true.
Below are the configurations that can be overridden via Team Call Data Action.
Display Name
Overrides the display name of the team the call will be offered to. This overridden name will be displayed in following areas:
- Incoming call screen for new calls, transferred calls, and rolled over calls to the team
- Incoming call and missed call notifications
- Current call screen
- Users' call history and call details on Spoke applications
- Account-wide call history and call summary on Spoke Account Portal
- Call summary and voicemail summary emails
Note: This field is ignored for internal calls.
Users
Overrides the list of users who are offered the call. This allows you to fine tune who is offered individual calls while still following standard team offer flows.
Each user is identified by their email address in Spoke. Invalid emails are ignored.
Availability rules still apply - only available users will be offered the call.
If the team's offer pattern is set to Round-robin, the call will be offered to the users in the order in which they appear in the list.
Timeout
Overrides the number of the seconds Spoke will wait for someone to answer the call before returning or forwarding the call.
The supported range of values for timeout is from 10 to 300 seconds. If the provided value falls outside the range, it will be rounded to the nearest supported value.
Next Offer Timeout
Overrides the number of the seconds Spoke will wait before offering the call to the next available user(s).
The supported range of values for nextOfferTimeout is from 5 to 60 seconds. If the provided value falls outside the range, it will be rounded to the nearest supported value.
Note : The asynchronous nature of API calls between Spoke and Twilio coupled with the overhead of setting up and tearing down call legs means that timeout values are indicative only, and the follow on action may occur some number of seconds after the timeout expires.
Priority
Overrides the priority of the call. This allows you to prioritise or deprioritise the call.
The supported range of values for priority is an integer value between 1 and 9, where 1 is the highest priority and 9 is the lowest. If the provided parameter falls outside the range, the call will be assigned a default value of 5.
Passthrough Parameters
Overrides the passthrough parameters associated with the inbound call.
Passthrough parameters can be attached to an inbound call when using Spoke's Redirect Handler. See Passthrough Parameters for the full picture of how they are set and returned.
Existing passthrough parameters are included in the POST request. If there are no existing passthrough parameters, the passthroughParameters field will be an empty object.
Passthrough parameters from the data action response will be merged with the existing passthrough parameters associated with the call. If a key exists in both the response and the current passthrough parameters, the value from the response will override the existing value.
The maximum size of passthrough parameters is 1000 bytes. If the merged passthrough parameters exceed 1000 bytes, then the passthrough parameters from the response will be discarded, and the stored passthrough parameters will not be updated.
Request and Response
Spoke sends an HTTP GET request with the parameters defined in the Team Call Request Payload, and expects a Team Call Response within 2 seconds. If no response payload is returned, the call will proceed as planned, using the original configuration for the call.
If the request returns a non-200 response or times out and the fallback URL is configured, Spoke will send another request to the fallback URL with the same payload.
If no response payload is returned, the call will proceed as planned, using the original team configuration.
Example Timelines
A Team Call Data Action will be triggered any time a call is about to be offered to a given team. This means that it may be triggered more than one time during a call, for example:
- The team is configured with an overflow rule that routes unanswered calls to a second team
- A call is transferred by an agent to another team
In both cases above, if a Team Call Data Action is configured, two requests will be made to the configured URL. In the second request, the directoryTarget and offerConfig attributes of the request payload will be updated to reflect the new team. All other attributes will remain the same.
Data actions for teams are triggered irrespective of the source of a call. This includes:
- Direct calls to the team via a team DDI
- Calls redirected into Spoke from an external IVR such as Studio
- Calls received via the Spoke IVR
- Any actions that result in calls being offered to a team from the Spoke application, such as transfer or a user calling the team directly
The following examples illustrate when data action requests will be made during the lifecycle of a call.
Example 1 - Inbound Call with Transfer
User Actions
Team Call Data Action Request Sent
Customer Alice starts a call to a company number.
Request for Reception DeskAlice presses 0 for Reception Desk
Bob answers the call and talks to Alice.
Request for SalesBob transfers Alice to the Sales team
Fred answers the call and talks to Alice.
Fred hangs up the call.
Example 2 - Direct Call with Offer Forwarding
User Actions
Team Call Data Action Request Sent
Request for Customer SupportCustomer Alice starts a call to the Customer Support team.
No one in the Customer Support team answers.
Request for Reception DeskThe offer is forwarded to Reception Desk according to Customer Support's configuration.
Natty answers the call and talks to Alice.
Natty hangs up the call.
Example 3 - Redirect to a Team Call via API
User Actions
Team Call Data Action Request Sent
Request for Regional SalesCall from Alice is redirected to the Regional Sales team via its extension number.
No one in the Regional Sales team is available.
The call is returned to the originating Twilio Studio flow.
Request for Global SalesThe call is redirected to the Global Sales team via its extension number.
Dob answers the call and talks to Alice.
Alice hangs up the call
Team Call request
Spoke sends this request to the Data Action URL you configure.
Team Call request › Request Body
Contains directory entry of the team which the call was offered to.
callIdThe Spoke ID of the call.
** DEPRECATED ** Use the assignedCallGroup field instead.
isInternalIndicates whether the call was an internal (Spoke User to Spoke Team) call. If this flag is true then there was no external party on the call, and the contactNumber and companyNumber fields will be empty.
Configuration that shows how the call will be offered to the team.
The existing passthrough parameters stored against the call record.
If there are no existing passthrough parameters, this field will be an empty object.
vendorCallIdThe vendor's identifier for the call.
companyNumberThe company number that originated or terminated this call. This will be one of the numbers defined in the Spoke Phone Number settings page.
This field will be null for Spoke internal calls (where isInternal is true).
contactIdThe ID of the phonebook contact (if any) associated with the external party on the call.
contactNumberThe phone number of the external party that originated or terminated this call.
Possible values:
- null: This field will be blank for Spoke internal calls (where
isInternalis true). - ANONYMOUS: If the external party has masked their caller id then this field will contain the value
ANONYMOUS - +E164 Number: A phone number in +E164 format (e.g. +16508221060)
Team Call request › Responses
Return the payload below within 2 seconds.
callGroupDisplayNameThis overrides the current display name of the team the call will be offered to.
Note: This field is ignored for internal calls.
Overriding the display name will change what is displayed in the following areas:
- Incoming call screen for new calls, transferred calls, and rolled over calls to a team
- Incoming call and missed call notifications
- Current call screen
- Users' call history and call details on Spoke applications
- Account-wide call history and call summary on Spoke account portal
- Call summary and voicemail summary emails
Configuration that overrides how the call will be offered to the team.
passthroughParametersIf specified, updates the passthrough parameters stored against the call by merging the existing passthrough parameters with the returned passthrough parameters. If a key exists in both the existing passthrough parameters and the returned passthrough parameters, the returned parameter value will overwrite the existing value.
Each passthrough parameter key must start with the prefix x- and the value must be a string. Otherwise, the parameter will be ignored.
The maximum size of passthrough parameters is 1000 bytes. If the merged passthrough parameters exceed 1000 bytes, then the stored passthrough parameters will not be updated.
Example:
Code
priorityIf specified, overrides the priority of the call. Use this to prioritise or deprioritise a call.
Priority is used:
- To determine which calls take priority when selecting the next call to queue for a user.
- To determine the order in which calls are offered to a user.
The supported range of values for priority is an integer value between 1 and 9, where 1 is the highest priority and 9 is the lowest.
Any calls with an undefined or invalid priority are assigned a default value of 5.