ConnectCases / Client / batch_create_related_item
batch_create_related_item¶
- ConnectCases.Client.batch_create_related_item(**kwargs)¶
Creates a comment and associates it with multiple cases in a single request. All cases must belong to the same domain. This operation supports only the Comment related item type.
Each case is processed independently. If some cases fail, the remaining cases still receive the related item. To determine whether individual items failed, inspect the
failedItemsarray in the response.The entire request fails, and no related items are created, in the following cases:
The specified domain doesn’t exist.
A reference ID doesn’t match any case in the domain.
The request contains duplicate case IDs.
The content isn’t comment content.
Note
This operation uses the same IAM action as CreateRelatedItem (
cases:CreateRelatedItem). You can use thecases:IsBatchActioncondition key in IAM policies to allow or deny batch operations independently from single-case operations.Note
If you provide a value for
performedBy.userArn, you must also have DescribeUser permission on the ARN of the user that you provide.Endpoints: See Connect Customer endpoints and quotas.
See also: AWS API Documentation
Request Syntax
response = client.batch_create_related_item( domainId='string', content={ 'contact': { 'contactArn': 'string' }, 'comment': { 'body': 'string', 'contentType': 'Text/Plain' }, 'file': { 'fileArn': 'string' }, 'sla': { 'slaInputConfiguration': { 'name': 'string', 'type': 'CaseField', 'fieldId': 'string', 'targetFieldValues': [ { 'stringValue': 'string', 'doubleValue': 123.0, 'booleanValue': True|False, 'emptyValue': {} , 'userArnValue': 'string' }, ], 'targetSlaMinutes': 123 } }, 'connectCase': { 'caseId': 'string' }, 'custom': { 'fields': [ { 'id': 'string', 'value': { 'stringValue': 'string', 'doubleValue': 123.0, 'booleanValue': True|False, 'emptyValue': {} , 'userArnValue': 'string' } }, ] } }, cases=[ { 'caseIdentifier': { 'caseId': 'string', 'referenceId': 'string' } }, ], performedBy={ 'userArn': 'string', 'customEntity': 'string' }, clientToken='string' )
- Parameters:
domainId (string) –
[REQUIRED]
The unique identifier of the Cases domain.
content (dict) –
[REQUIRED]
The content of the related item to be created. The same content is applied to every case in the request. Only comment content is supported for batch creation.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
contact,comment,file,sla,connectCase,custom.contact (dict) –
Object representing a contact in Connect Customer as an API request field.
contactArn (string) – [REQUIRED]
A unique identifier of a contact in Connect Customer.
comment (dict) –
Represents the content of a comment to be returned to agents.
body (string) – [REQUIRED]
Text in the body of a
Commenton a case.contentType (string) – [REQUIRED]
Type of the text in the box of a
Commenton a case.
file (dict) –
A file of related items.
fileArn (string) – [REQUIRED]
The Amazon Resource Name (ARN) of a File in Connect Customer.
sla (dict) –
Represents the content of an SLA to be created.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
slaInputConfiguration.slaInputConfiguration (dict) –
Represents an input SLA configuration.
name (string) – [REQUIRED]
Name of an SLA.
type (string) – [REQUIRED]
Type of SLA.
fieldId (string) –
Unique identifier of a field.
targetFieldValues (list) –
Represents a list of target field values for the fieldId specified in SlaInputConfiguration. The SLA is considered met if any one of these target field values matches the actual field value.
(dict) –
Object to store union of Field values.
Note
The
Summarysystem field accepts up to 3000 characters, while all other fields accept up to 4100 characters. If you use multi-byte characters, the effective character limit may be lower.Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
stringValue,doubleValue,booleanValue,emptyValue,userArnValue.stringValue (string) –
String value type.
doubleValue (float) –
Can be either null, or have a Double number value type. Only one value can be provided.
booleanValue (boolean) –
Can be either null, or have a Boolean value type. Only one value can be provided.
emptyValue (dict) –
An empty value.
userArnValue (string) –
Represents the user that performed the audit.
targetSlaMinutes (integer) – [REQUIRED]
Target duration in minutes within which an SLA should be completed.
connectCase (dict) –
Represents the Connect Customer case to be created as a related item.
caseId (string) – [REQUIRED]
A unique identifier of the case.
custom (dict) –
Represents the content of a
Customtype related item.fields (list) – [REQUIRED]
List of field values for the
Customrelated item.(dict) –
Object for case field values.
id (string) – [REQUIRED]
Unique identifier of a field.
value (dict) – [REQUIRED]
Union of potential field value types.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
stringValue,doubleValue,booleanValue,emptyValue,userArnValue.stringValue (string) –
String value type.
doubleValue (float) –
Can be either null, or have a Double number value type. Only one value can be provided.
booleanValue (boolean) –
Can be either null, or have a Boolean value type. Only one value can be provided.
emptyValue (dict) –
An empty value.
userArnValue (string) –
Represents the user that performed the audit.
cases (list) –
[REQUIRED]
The list of cases to associate the related item with. All cases must belong to the same domain.
(dict) –
Identifies a case to associate the related item with in a
BatchCreateRelatedItemrequest.caseIdentifier (dict) – [REQUIRED]
The identifier of the case to associate the related item with. Specify either the case ID or the reference ID.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
caseId,referenceId.caseId (string) –
The unique identifier of the case.
referenceId (string) –
The reference ID of the case. Reference IDs are unique within a domain, and uniqueness isn’t case sensitive.
performedBy (dict) –
The entity that created the related item.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
userArn,customEntity.userArn (string) –
Represents the Connect Customer ARN of the user.
customEntity (string) –
Any provided entity.
clientToken (string) –
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
If you retry a request with the same client token, the service returns the original response instead of processing the request again. If you reuse a client token with different request parameters, the request fails with a
ConflictException.This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'successfulItems': [ { 'caseIdentifier': { 'caseId': 'string', 'referenceNumber': 'string', 'referenceId': 'string' }, 'relatedItemId': 'string', 'relatedItemArn': 'string' }, ], 'failedItems': [ { 'caseIdentifier': { 'caseId': 'string', 'referenceNumber': 'string', 'referenceId': 'string' }, 'errorCode': 'string', 'errorMessage': 'string' }, ] }
Response Structure
(dict) –
successfulItems (list) –
The list of related items that were successfully created and associated with their cases.
(dict) –
Information about a related item that was created.
caseIdentifier (dict) –
The identifiers of the case that the related item is associated with.
caseId (string) –
The unique identifier of the case.
referenceNumber (string) –
The reference number of the case. Reference numbers aren’t guaranteed to be unique.
BatchUpdateCaseandBatchCreateRelatedItemdon’t return this value.referenceId (string) –
The reference ID of the case. Cases created before reference IDs were available don’t have one.
relatedItemId (string) –
The unique identifier of the related item.
relatedItemArn (string) –
The Amazon Resource Name (ARN) of the related item.
failedItems (list) –
The list of related items that were not created. Each entry includes an error code and message. Possible error codes include:
CASE_NOT_FOUND- No case exists with the specified case ID.VALIDATION_ERROR- The request contains invalid input.CONFLICT- Another operation is in progress on the case, such as a concurrent update or a merge of the case into another case.THROTTLED- The request rate exceeded the allowed limit.ACCESS_DENIED- The caller lacks permission to perform the operation.SERVICE_QUOTA_EXCEEDED- The request exceeded a service quota.DOMAIN_NOT_FOUND- The case domain was deleted while the request was being processed.INTERNAL_ERROR- An unexpected error occurred on the server.
(dict) –
Information about a related item that wasn’t created.
caseIdentifier (dict) –
The identifiers of the case that the related item wasn’t created for.
caseId (string) –
The unique identifier of the case.
referenceNumber (string) –
The reference number of the case. Reference numbers aren’t guaranteed to be unique.
BatchUpdateCaseandBatchCreateRelatedItemdon’t return this value.referenceId (string) –
The reference ID of the case. Cases created before reference IDs were available don’t have one.
errorCode (string) –
The error code. For possible values, see
failedItems.errorMessage (string) –
A message that describes the error.
Exceptions