此问题可能是由于CLI和UI的默认设置不同造成的。有一个解决方法是在每次导出时指定参数以确保结果的一致性。以下是一个Python的CLI代码示例:
import boto3
connect = boto3.client('connect')
response = connect.get_contact_flow(
InstanceId='YOUR_INSTANCE_ID',
ContactFlowId='YOUR_CONTACT_FLOW_ID',
ResourceType='CONTACT_FLOW',
IntegrationType='CALL_POLLY'
)
# Specify the output format as JSON
output_format = 'JSON'
# Export the contact flow with the specified format
response = connect.export_contact_flow(
InstanceId='YOUR_INSTANCE_ID',
ContactFlowId='YOUR_CONTACT_FLOW_ID',
ResourceType='CONTACT_FLOW',
IntegrationType='CALL_POLLY',
OutputFormat=output_format
)
print(response)
在此示例中,我们通过在export_contact_flow中指定OutputFormat参数来确保结果一致。如果UI中的设置与此代码中使用的格式不同,请根据需要进行更改。