

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Amazon Connect Cases의 사례 이벤트 페이로드 및 스키마
<a name="case-event-streams-sample"></a>

이벤트 페이로드에 사례 데이터를 포함하도록 요청하면 해당 데이터는 특정 편집 후 사례의 버전을 반영합니다.

Amazon Connect Cases의 기본 제한은 페이로드가 256KB(EventBus 이벤트의 최대 크기) 미만이 되도록 보장합니다. 사례 객체 모델을 사용자 지정할 수 있으므로(예: 사례 객체에 사용자 지정 필드를 정의하여 비즈니스 관련 정보를 캡처할 수 있음), 사례 이벤트 스키마는 다음 예와 같이 사례 객체에 대한 사용자 지정 사항을 반영합니다(예: 고객별 UUID가 JSON 속성으로 사용되는 방법 참조).

## 사례 리소스에 대한 사례 이벤트 페이로드 예제
<a name="example-case-event-payload"></a>

```
// Given the limits on the "includedData" configuration
// this payload is guaranteed to less than 256KB at launch.
{
    "version": "0",
    "id": "{{event ID}}",
    "detail-type": "Amazon Connect Cases Change",
    "source": "aws.cases",
    "account": "{{your AWS account ID}}",
    "time": "2022-03-16T23:43:26Z",
    "region": "{{The AWS Region of your Amazon Connect instance}}",
    "resources": [
        "arn:aws:cases:{{your Amazon Connect AWS Region}}:{{your AWS account ID}}:domain/{{case domain ID}}",
        "arn:aws:cases:{{your Amazon Connect AWS Region}}:{{your AWS account ID}}:domain/{{case domain ID}}/case/{{case ID}}"
    ],
    "detail": {
        "version": "0",
        "eventType": "CASE.UPDATED",
        "approximateChangeTime": "2022-03-16T23:16:57.893Z",  // Can be used for ordering
        "changedFieldIds": ["status", "last_updated_datetime"],
        "performedBy": {
            "user": {
                "userArn": "arn:aws:connect:{{your Amazon Connect AWS Region}}:{{your AWS account ID}}:instance/{{connect instance ID}}/user/{{connect user ID}}"        
            },
            "iamPrincipalArn": "arn:aws:iam::{{your Amazon Connect AWS Region}}:role/{{role name}}"
        },       
        "case": {
            "caseId": "{{case ID}}",
            "templateId": "{{template ID}}",
            "createdDateTime": "2022-03-16T23:16:57.893Z",
            
            // This section contains only non-null field values for the 
            // fields that customers have configured in the "includedData".
           
            // Field values included in this section reflects the case
            // after this particular change is applied.
            "fields": {
                "status": {
                    "value": {
                        "stringValue": "open"
                   }
                },
                "case_reason": {
                    "value": {
                        "stringValue": "Shipment lost"
                    }
                },
                "custom-field-uuid-1": {
                    "value": {
                        "stringValue": "Customer didn't receive the product"
                    }
                }
            }
        }
    }
}
```

## 관련 항목 리소스에 대한 사례 이벤트 페이로드 예제
<a name="example-case-event-payload"></a>

```
// Given the limits on the "includedData" configuration
// this payload is guaranteed to less than 256KB
{
    "version": "0",
    "id": "{{event ID}}",
    "detail-type": "Amazon Connect Cases Change",
    "source": "aws.cases",
    "account": "{{your AWS account ID}}",
    "time": "2022-03-16T23:43:26Z",
    "region": "{{The AWS Region of your Amazon Connect instance}}",
    "resources": [
        "arn:aws:cases:{{your Amazon Connect AWS Region}}:{{your AWS account ID}}:domain/{{case domain ID}}",
        "arn:aws:cases:{{your Amazon Connect AWS Region}}:{{your AWS account ID}}:domain/{{case domain ID}}/case/{{case ID}}/related-item/{{related-item ID}}"
    ],
    
    "detail": {   
        "version": "0",
        "eventType": "RELATED_ITEM.CREATED",
        "approximateChangeTime": "2022-03-16T23:16:57.893Z", // Can be used for ordering
        "changedAttributes": ["comment.commentText"],
        "performedBy": {
            "user": {
                "userArn": "arn:aws:connect:{{your Amazon Connect AWS Region}}:{{your AWS account ID}}:instance/{{connect instance ID}}/user/{{connect user ID}}"        
            },
            "iamPrincipalArn": "arn:aws:iam::{{your Amazon Connect AWS Region}}:role/{{role name}}"
        },        
        "relatedItem": {
            "relatedItemType": "Comment",
            "relatedItemId": "{{related-item ID}}",
            "caseId": "{{case id that this related item is a sub-resource of}}",
            "createdDateTime": "2022-03-16T23:16:57.893Z",
            
            // This section includes any attributes that customers have configured
            // in the "includedData" configuration.
            "comment": {               
                "body": "Gave a $5 refund to customer to make them happy",
            },
            
            // if the related item was of type contact.
            // "contact": {
            //      "contactArn": ".......",
            // }
        }
    }
}
```

## 사용자 정의 엔터티가 수행한 사례 리소스에 대한 사례 이벤트 페이로드 예제
<a name="example-case-event-payload-case-resource-custom-entity"></a>

```
// Given the limits on the "includedData" configuration
// this payload is guaranteed to less than 256KB at launch.
{
    "version": "0",
    "id": "{{event ID}}",
    "detail-type": "Amazon Connect Cases Change",
    "source": "aws.cases",
    "account": "{{your AWS account ID}}",
    "time": "2022-03-16T23:43:26Z",
    "region": "{{The AWS Region of your Amazon Connect instance}}",
    "resources": [
        "arn:aws:cases:{{your Amazon Connect AWS Region:your AWS account ID}}:domain/{{case domain ID}}",
        "arn:aws:cases:{{your Amazon Connect AWS Region:your AWS account ID}}:domain/{{case domain ID}}/case/{{case ID}}"
    ],
    "detail": {
        "version": "0",
        "eventType": "CASE.UPDATED",
        "approximateChangeTime": "2022-03-16T23:16:57.893Z",  // Can be used for ordering
        "changedFieldIds": ["status", "last_updated_datetime"],
        "performedBy": {
            "user": {
                "customEntity": "{{your custom entity}}"        
            },
            "iamPrincipalArn": "arn:aws:iam::{{your Amazon Connect AWS Region}}:role/{{role name}}"
        },       
        "case": {
            "caseId": "{{case ID}}",
            "templateId": "{{template ID}}",
            "createdDateTime": "2022-03-16T23:16:57.893Z",
            
            // This section contains only non-null field values for the 
            // fields that customers have configured in the "includedData".
           
            // Field values included in this section reflects the case
            // after this particular change is applied.
            "fields": {
                "status": {
                    "value": {
                        "stringValue": "open"
                   }
                },
                "case_reason": {
                    "value": {
                        "stringValue": "Shipment lost"
                    }
                },
                "custom-field-uuid-1": {
                    "value": {
                        "stringValue": "Customer didn't receive the product"
                    }
                }
            }
        }
    }
}
```