Amazon Connect Cases

2024/01/22 - Amazon Connect Cases - 1 new 7 updated api methods

Changes  This release adds the ability to view audit history on a case and introduces a new parameter, performedBy, for CreateCase and UpdateCase API's.

GetCaseAuditEvents (new) Link ¶

Returns the audit history about a specific case if it exists.

See also: AWS API Documentation

Request Syntax

client.get_case_audit_events(
    caseId='string',
    domainId='string',
    maxResults=123,
    nextToken='string'
)
type caseId

string

param caseId

[REQUIRED]

A unique identifier of the case.

type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type maxResults

integer

param maxResults

The maximum number of audit events to return. The current maximum supported value is 25. This is also the default when no other value is provided.

type nextToken

string

param nextToken

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

rtype

dict

returns

Response Syntax

{
    'auditEvents': [
        {
            'eventId': 'string',
            'fields': [
                {
                    'eventFieldId': 'string',
                    'newValue': {
                        'booleanValue': True|False,
                        'doubleValue': 123.0,
                        'emptyValue': {},
                        'stringValue': 'string',
                        'userArnValue': 'string'
                    },
                    'oldValue': {
                        'booleanValue': True|False,
                        'doubleValue': 123.0,
                        'emptyValue': {},
                        'stringValue': 'string',
                        'userArnValue': 'string'
                    }
                },
            ],
            'performedBy': {
                'iamPrincipalArn': 'string',
                'user': {
                    'userArn': 'string'
                }
            },
            'performedTime': datetime(2015, 1, 1),
            'relatedItemType': 'Contact'|'Comment',
            'type': 'Case.Created'|'Case.Updated'|'RelatedItem.Created'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • auditEvents (list) --

      A list of case audits where each represents a particular edit of the case.

      • (dict) --

        Represents the content of a particular audit event.

        • eventId (string) --

          Unique identifier of a case audit history event.

        • fields (list) --

          A list of Case Audit History event fields.

          • (dict) --

            Fields for audit event.

            • eventFieldId (string) --

              Unique identifier of field in an Audit History entry.

            • newValue (dict) --

              Union of potential field value types.

              • booleanValue (boolean) --

                Can be either null, or have a Boolean value type. Only one value can be provided.

              • doubleValue (float) --

                Can be either null, or have a Double value type. Only one value can be provided.

              • emptyValue (dict) --

                An empty value. You cannot set EmptyFieldValue on a field that is required on a case template.

                This structure will never have any data members. It signifies an empty value on a case field.

              • stringValue (string) --

                Can be either null, or have a String value type. Only one value can be provided.

              • userArnValue (string) --

                Can be either null, or have a String value type formatted as an ARN. Only one value can be provided.

            • oldValue (dict) --

              Union of potential field value types.

              • booleanValue (boolean) --

                Can be either null, or have a Boolean value type. Only one value can be provided.

              • doubleValue (float) --

                Can be either null, or have a Double value type. Only one value can be provided.

              • emptyValue (dict) --

                An empty value. You cannot set EmptyFieldValue on a field that is required on a case template.

                This structure will never have any data members. It signifies an empty value on a case field.

              • stringValue (string) --

                Can be either null, or have a String value type. Only one value can be provided.

              • userArnValue (string) --

                Can be either null, or have a String value type formatted as an ARN. Only one value can be provided.

        • performedBy (dict) --

          Information of the user which performed the audit.

          • iamPrincipalArn (string) --

            Unique identifier of an IAM role.

          • user (dict) --

            Represents the identity of the person who performed the action.

            • userArn (string) --

              Represents the Amazon Connect ARN of the user.

        • performedTime (datetime) --

          Time at which an Audit History event took place.

        • relatedItemType (string) --

          The Type of the related item.

        • type (string) --

          The Type of an audit history event.

    • nextToken (string) --

      The token for the next set of results. This is null if there are no more results to return.

BatchGetField (updated) Link ¶
Changes (response)
{'fields': {'type': {'User'}}}

Returns the description for the list of fields in the request parameters.

See also: AWS API Documentation

Request Syntax

client.batch_get_field(
    domainId='string',
    fields=[
        {
            'id': 'string'
        },
    ]
)
type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type fields

list

param fields

[REQUIRED]

A list of unique field identifiers.

  • (dict) --

    Object for unique identifier of a field.

    • id (string) -- [REQUIRED]

      Unique identifier of a field.

rtype

dict

returns

Response Syntax

{
    'errors': [
        {
            'errorCode': 'string',
            'id': 'string',
            'message': 'string'
        },
    ],
    'fields': [
        {
            'description': 'string',
            'fieldArn': 'string',
            'fieldId': 'string',
            'name': 'string',
            'namespace': 'System'|'Custom',
            'tags': {
                'string': 'string'
            },
            'type': 'Text'|'Number'|'Boolean'|'DateTime'|'SingleSelect'|'Url'|'User'
        },
    ]
}

Response Structure

  • (dict) --

    • errors (list) --

      A list of field errors.

      • (dict) --

        Object for errors on fields.

        • errorCode (string) --

          The error code from getting a field.

        • id (string) --

          The field identifier that caused the error.

        • message (string) --

          The error message from getting a field.

    • fields (list) --

      A list of detailed field information.

      • (dict) --

        Object to store detailed field information.

        • description (string) --

          Description of the field.

        • fieldArn (string) --

          The Amazon Resource Name (ARN) of the field.

        • fieldId (string) --

          Unique identifier of the field.

        • name (string) --

          Name of the field.

        • namespace (string) --

          Namespace of the field.

        • tags (dict) --

          A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

          • (string) --

            • (string) --

        • type (string) --

          Type of the field.

CreateCase (updated) Link ¶
Changes (request)
{'fields': {'value': {'userArnValue': 'string'}},
 'performedBy': {'userArn': 'string'}}

Note

If you provide a value for PerformedBy.UserArn you must also have connect:DescribeUser permission on the User ARN resource that you provide

<p>Creates a case in the specified Cases domain. Case system and custom fields are taken as an array id/value pairs with a declared data types.</p> <p>The following fields are required when creating a case:</p> <ul> <li> <p> <code>customer_id</code> - You must provide the full customer profile ARN in this format: <code>arn:aws:profile:your_AWS_Region:your_AWS_account ID:domains/your_profiles_domain_name/profiles/profile_ID</code> </p> </li> <li> <p> <code>title</code> </p> </li> </ul>

See also: AWS API Documentation

Request Syntax

client.create_case(
    clientToken='string',
    domainId='string',
    fields=[
        {
            'id': 'string',
            'value': {
                'booleanValue': True|False,
                'doubleValue': 123.0,
                'emptyValue': {}
                ,
                'stringValue': 'string',
                'userArnValue': 'string'
            }
        },
    ],
    performedBy={
        'userArn': 'string'
    },
    templateId='string'
)
type clientToken

string

param clientToken

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 .

This field is autopopulated if not provided.

type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type fields

list

param fields

[REQUIRED]

An array of objects with field ID (matching ListFields/DescribeField) and value union data.

  • (dict) --

    Object for case field values.

    • id (string) -- [REQUIRED]

      Unique identifier of a field.

    • value (dict) -- [REQUIRED]

      Union of potential field value types.

      • booleanValue (boolean) --

        Can be either null, or have a Boolean value type. Only one value can be provided.

      • doubleValue (float) --

        Can be either null, or have a Double number value type. Only one value can be provided.

      • emptyValue (dict) --

        An empty value.

      • stringValue (string) --

        String value type.

      • userArnValue (string) --

        Represents the user that performed the audit.

type performedBy

dict

param performedBy

Represents the identity of the person who performed the action.

  • userArn (string) --

    Represents the Amazon Connect ARN of the user.

type templateId

string

param templateId

[REQUIRED]

A unique identifier of a template.

rtype

dict

returns

Response Syntax

{
    'caseArn': 'string',
    'caseId': 'string'
}

Response Structure

  • (dict) --

    • caseArn (string) --

      The Amazon Resource Name (ARN) of the case.

    • caseId (string) --

      A unique identifier of the case.

CreateField (updated) Link ¶
Changes (request)
{'type': {'User'}}

Creates a field in the Cases domain. This field is used to define the case object model (that is, defines what data can be captured on cases) in a Cases domain.

See also: AWS API Documentation

Request Syntax

client.create_field(
    description='string',
    domainId='string',
    name='string',
    type='Text'|'Number'|'Boolean'|'DateTime'|'SingleSelect'|'Url'|'User'
)
type description

string

param description

The description of the field.

type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type name

string

param name

[REQUIRED]

The name of the field.

type type

string

param type

[REQUIRED]

Defines the data type, some system constraints, and default display of the field.

rtype

dict

returns

Response Syntax

{
    'fieldArn': 'string',
    'fieldId': 'string'
}

Response Structure

  • (dict) --

    • fieldArn (string) --

      The Amazon Resource Name (ARN) of the field.

    • fieldId (string) --

      The unique identifier of a field.

GetCase (updated) Link ¶
Changes (response)
{'fields': {'value': {'userArnValue': 'string'}}}

Returns information about a specific case if it exists.

See also: AWS API Documentation

Request Syntax

client.get_case(
    caseId='string',
    domainId='string',
    fields=[
        {
            'id': 'string'
        },
    ],
    nextToken='string'
)
type caseId

string

param caseId

[REQUIRED]

A unique identifier of the case.

type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type fields

list

param fields

[REQUIRED]

A list of unique field identifiers.

  • (dict) --

    Object for unique identifier of a field.

    • id (string) -- [REQUIRED]

      Unique identifier of a field.

type nextToken

string

param nextToken

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

rtype

dict

returns

Response Syntax

{
    'fields': [
        {
            'id': 'string',
            'value': {
                'booleanValue': True|False,
                'doubleValue': 123.0,
                'emptyValue': {},
                'stringValue': 'string',
                'userArnValue': 'string'
            }
        },
    ],
    'nextToken': 'string',
    'tags': {
        'string': 'string'
    },
    'templateId': 'string'
}

Response Structure

  • (dict) --

    • fields (list) --

      A list of detailed field information.

      • (dict) --

        Object for case field values.

        • id (string) --

          Unique identifier of a field.

        • value (dict) --

          Union of potential field value types.

          • booleanValue (boolean) --

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) --

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) --

            An empty value.

          • stringValue (string) --

            String value type.

          • userArnValue (string) --

            Represents the user that performed the audit.

    • nextToken (string) --

      The token for the next set of results. This is null if there are no more results to return.

    • tags (dict) --

      A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

      • (string) --

        • (string) --

    • templateId (string) --

      A unique identifier of a template.

ListFields (updated) Link ¶
Changes (response)
{'fields': {'type': {'User'}}}

Lists all fields in a Cases domain.

See also: AWS API Documentation

Request Syntax

client.list_fields(
    domainId='string',
    maxResults=123,
    nextToken='string'
)
type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type maxResults

integer

param maxResults

The maximum number of results to return per page.

type nextToken

string

param nextToken

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

rtype

dict

returns

Response Syntax

{
    'fields': [
        {
            'fieldArn': 'string',
            'fieldId': 'string',
            'name': 'string',
            'namespace': 'System'|'Custom',
            'type': 'Text'|'Number'|'Boolean'|'DateTime'|'SingleSelect'|'Url'|'User'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • fields (list) --

      List of detailed field information.

      • (dict) --

        Object for the summarized details of the field.

        • fieldArn (string) --

          The Amazon Resource Name (ARN) of the field.

        • fieldId (string) --

          The unique identifier of a field.

        • name (string) --

          Name of the field.

        • namespace (string) --

          The namespace of a field.

        • type (string) --

          The type of a field.

    • nextToken (string) --

      The token for the next set of results. This is null if there are no more results to return.

SearchCases (updated) Link ¶
Changes (request, response)
Request
{'filter': {'field': {'contains': {'value': {'userArnValue': 'string'}},
                      'equalTo': {'value': {'userArnValue': 'string'}},
                      'greaterThan': {'value': {'userArnValue': 'string'}},
                      'greaterThanOrEqualTo': {'value': {'userArnValue': 'string'}},
                      'lessThan': {'value': {'userArnValue': 'string'}},
                      'lessThanOrEqualTo': {'value': {'userArnValue': 'string'}}}}}
Response
{'cases': {'fields': {'value': {'userArnValue': 'string'}}}}

Searches for cases within their associated Cases domain. Search results are returned as a paginated list of abridged case documents.

Note

For customer_id you must provide the full customer profile ARN in this format: arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles domain name/profiles/profile ID .

See also: AWS API Documentation

Request Syntax

client.search_cases(
    domainId='string',
    fields=[
        {
            'id': 'string'
        },
    ],
    filter={
        'andAll': [
            {'... recursive ...'},
        ],
        'field': {
            'contains': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'equalTo': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'greaterThan': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'greaterThanOrEqualTo': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'lessThan': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'lessThanOrEqualTo': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            }
        },
        'not': {'... recursive ...'},
        'orAll': [
            {'... recursive ...'},
        ]
    },
    maxResults=123,
    nextToken='string',
    searchTerm='string',
    sorts=[
        {
            'fieldId': 'string',
            'sortOrder': 'Asc'|'Desc'
        },
    ]
)
type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type fields

list

param fields

The list of field identifiers to be returned as part of the response.

  • (dict) --

    Object for unique identifier of a field.

    • id (string) -- [REQUIRED]

      Unique identifier of a field.

type filter

dict

param filter

A list of filter objects.

  • andAll (list) --

    Provides "and all" filtering.

    • (dict) --

      A filter for cases. Only one value can be provided.

  • field (dict) --

    A list of fields to filter on.

    • contains (dict) --

      Object containing field identifier and value information.

      • id (string) -- [REQUIRED]

        Unique identifier of a field.

      • value (dict) -- [REQUIRED]

        Union of potential field value types.

        • booleanValue (boolean) --

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • doubleValue (float) --

          Can be either null, or have a Double number value type. Only one value can be provided.

        • emptyValue (dict) --

          An empty value.

        • stringValue (string) --

          String value type.

        • userArnValue (string) --

          Represents the user that performed the audit.

    • equalTo (dict) --

      Object containing field identifier and value information.

      • id (string) -- [REQUIRED]

        Unique identifier of a field.

      • value (dict) -- [REQUIRED]

        Union of potential field value types.

        • booleanValue (boolean) --

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • doubleValue (float) --

          Can be either null, or have a Double number value type. Only one value can be provided.

        • emptyValue (dict) --

          An empty value.

        • stringValue (string) --

          String value type.

        • userArnValue (string) --

          Represents the user that performed the audit.

    • greaterThan (dict) --

      Object containing field identifier and value information.

      • id (string) -- [REQUIRED]

        Unique identifier of a field.

      • value (dict) -- [REQUIRED]

        Union of potential field value types.

        • booleanValue (boolean) --

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • doubleValue (float) --

          Can be either null, or have a Double number value type. Only one value can be provided.

        • emptyValue (dict) --

          An empty value.

        • stringValue (string) --

          String value type.

        • userArnValue (string) --

          Represents the user that performed the audit.

    • greaterThanOrEqualTo (dict) --

      Object containing field identifier and value information.

      • id (string) -- [REQUIRED]

        Unique identifier of a field.

      • value (dict) -- [REQUIRED]

        Union of potential field value types.

        • booleanValue (boolean) --

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • doubleValue (float) --

          Can be either null, or have a Double number value type. Only one value can be provided.

        • emptyValue (dict) --

          An empty value.

        • stringValue (string) --

          String value type.

        • userArnValue (string) --

          Represents the user that performed the audit.

    • lessThan (dict) --

      Object containing field identifier and value information.

      • id (string) -- [REQUIRED]

        Unique identifier of a field.

      • value (dict) -- [REQUIRED]

        Union of potential field value types.

        • booleanValue (boolean) --

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • doubleValue (float) --

          Can be either null, or have a Double number value type. Only one value can be provided.

        • emptyValue (dict) --

          An empty value.

        • stringValue (string) --

          String value type.

        • userArnValue (string) --

          Represents the user that performed the audit.

    • lessThanOrEqualTo (dict) --

      Object containing field identifier and value information.

      • id (string) -- [REQUIRED]

        Unique identifier of a field.

      • value (dict) -- [REQUIRED]

        Union of potential field value types.

        • booleanValue (boolean) --

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • doubleValue (float) --

          Can be either null, or have a Double number value type. Only one value can be provided.

        • emptyValue (dict) --

          An empty value.

        • stringValue (string) --

          String value type.

        • userArnValue (string) --

          Represents the user that performed the audit.

  • not (dict) --

    A filter for cases. Only one value can be provided.

  • orAll (list) --

    Provides "or all" filtering.

    • (dict) --

      A filter for cases. Only one value can be provided.

type maxResults

integer

param maxResults

The maximum number of cases to return. The current maximum supported value is 25. This is also the default value when no other value is provided.

type nextToken

string

param nextToken

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

type searchTerm

string

param searchTerm

A word or phrase used to perform a quick search.

type sorts

list

param sorts

A list of sorts where each sort specifies a field and their sort order to be applied to the results.

  • (dict) --

    A structured set of sort terms.

    • fieldId (string) -- [REQUIRED]

      Unique identifier of a field.

    • sortOrder (string) -- [REQUIRED]

      A structured set of sort terms

rtype

dict

returns

Response Syntax

{
    'cases': [
        {
            'caseId': 'string',
            'fields': [
                {
                    'id': 'string',
                    'value': {
                        'booleanValue': True|False,
                        'doubleValue': 123.0,
                        'emptyValue': {},
                        'stringValue': 'string',
                        'userArnValue': 'string'
                    }
                },
            ],
            'tags': {
                'string': 'string'
            },
            'templateId': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • cases (list) --

      A list of case documents where each case contains the properties CaseId and Fields where each field is a complex union structure.

      • (dict) --

        A list of items that represent cases.

        • caseId (string) --

          A unique identifier of the case.

        • fields (list) --

          List of case field values.

          • (dict) --

            Object for case field values.

            • id (string) --

              Unique identifier of a field.

            • value (dict) --

              Union of potential field value types.

              • booleanValue (boolean) --

                Can be either null, or have a Boolean value type. Only one value can be provided.

              • doubleValue (float) --

                Can be either null, or have a Double number value type. Only one value can be provided.

              • emptyValue (dict) --

                An empty value.

              • stringValue (string) --

                String value type.

              • userArnValue (string) --

                Represents the user that performed the audit.

        • tags (dict) --

          A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

          • (string) --

            • (string) --

        • templateId (string) --

          A unique identifier of a template.

    • nextToken (string) --

      The token for the next set of results. This is null if there are no more results to return.

UpdateCase (updated) Link ¶
Changes (request)
{'fields': {'value': {'userArnValue': 'string'}},
 'performedBy': {'userArn': 'string'}}

Note

If you provide a value for PerformedBy.UserArn you must also have connect:DescribeUser permission on the User ARN resource that you provide

<p>Updates the values of fields on a case. Fields to be updated are received as an array of id/value pairs identical to the <code>CreateCase</code> input .</p> <p>If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.</p>

See also: AWS API Documentation

Request Syntax

client.update_case(
    caseId='string',
    domainId='string',
    fields=[
        {
            'id': 'string',
            'value': {
                'booleanValue': True|False,
                'doubleValue': 123.0,
                'emptyValue': {}
                ,
                'stringValue': 'string',
                'userArnValue': 'string'
            }
        },
    ],
    performedBy={
        'userArn': 'string'
    }
)
type caseId

string

param caseId

[REQUIRED]

A unique identifier of the case.

type domainId

string

param domainId

[REQUIRED]

The unique identifier of the Cases domain.

type fields

list

param fields

[REQUIRED]

An array of objects with fieldId (matching ListFields/DescribeField) and value union data, structured identical to CreateCase .

  • (dict) --

    Object for case field values.

    • id (string) -- [REQUIRED]

      Unique identifier of a field.

    • value (dict) -- [REQUIRED]

      Union of potential field value types.

      • booleanValue (boolean) --

        Can be either null, or have a Boolean value type. Only one value can be provided.

      • doubleValue (float) --

        Can be either null, or have a Double number value type. Only one value can be provided.

      • emptyValue (dict) --

        An empty value.

      • stringValue (string) --

        String value type.

      • userArnValue (string) --

        Represents the user that performed the audit.

type performedBy

dict

param performedBy

Represents the identity of the person who performed the action.

  • userArn (string) --

    Represents the Amazon Connect ARN of the user.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --