updateContact method
This API is in preview release for Connect Customer and is subject to change.
Adds or updates user-defined contact information associated with the specified contact. At least one field to be updated must be present in the request.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServiceException.
May throw InvalidActiveRegionException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter contactId :
The identifier of the contact. This is the identifier of the contact
associated with the first interaction with your contact center.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter customerEndpoint :
The endpoint of the customer for which the contact was initiated. For
external audio contacts, this is usually the end customer's phone number.
This value can only be updated for external audio contacts. For more
information, see Connect
Customer Contact Lens integration in the Connect Customer
Administrator Guide.
Parameter description :
The description of the contact.
Parameter name :
The name of the contact.
Parameter queueInfo :
Information about the queue associated with a contact. This parameter can
only be updated for external audio contacts. It is used when you integrate
third-party systems with Contact Lens for analytics. For more information,
see Connect
Customer Contact Lens integration in the Connect Customer
Administrator Guide.
Parameter references :
Well-formed data on contact, shown to agents on Contact Control Panel
(CCP).
Parameter segmentAttributes :
A set of system defined key-value pairs stored on individual contact
segments (unique contact ID) using an attribute map. The attributes are
standard Connect Customer attributes. They can be accessed in flows.
Attribute keys can include only alphanumeric, -, and _.
This field can be used to show channel subtype, such as
connect:Guide.
Contact Expiry, and user-defined attributes (String - String) that are defined in predefined attributes, can be updated by using the UpdateContact API.
Parameter systemEndpoint :
External system endpoint for the contact was initiated. For external audio
contacts, this is the phone number of the external system such as the
contact center. This value can only be updated for external audio
contacts. For more information, see Connect
Customer Contact Lens integration in the Connect Customer
Administrator Guide.
Parameter userInfo :
Information about the agent associated with a contact. This parameter can
only be updated for external audio contacts. It is used when you integrate
third-party systems with Contact Lens for analytics. For more information,
see Connect
Customer Contact Lens integration in the Connect Customer
Administrator Guide.
Implementation
Future<void> updateContact({
required String contactId,
required String instanceId,
Endpoint? customerEndpoint,
String? description,
String? name,
QueueInfoInput? queueInfo,
Map<String, Reference>? references,
Map<String, SegmentAttributeValue>? segmentAttributes,
Endpoint? systemEndpoint,
UserInfo? userInfo,
}) async {
final $payload = <String, dynamic>{
if (customerEndpoint != null) 'CustomerEndpoint': customerEndpoint,
if (description != null) 'Description': description,
if (name != null) 'Name': name,
if (queueInfo != null) 'QueueInfo': queueInfo,
if (references != null) 'References': references,
if (segmentAttributes != null) 'SegmentAttributes': segmentAttributes,
if (systemEndpoint != null) 'SystemEndpoint': systemEndpoint,
if (userInfo != null) 'UserInfo': userInfo,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/contacts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}',
exceptionFnMap: _exceptionFns,
);
}