Contact Center AI Platform (CCAI Platform)은 SMS 채널에 아웃바운드 SMS 엔드포인트를 제공합니다.
아웃바운드 SMS
| 매개변수 | 필수 | 데이터 유형 | 정의 | |
|---|---|---|---|---|
| chat_type | TRUE | 문자열 | 생성할 채팅 유형입니다. 현재 '메시지 (API)', 'SMS' (지원 중단됨)를 사용할 수 있습니다. | 메시지 (API) |
| end_user_number | TRUE | 문자열 | SMS를 전송할 번호 | `{end_user_number}` |
| outbound_number | TRUE | 문자열 | SMS 메시지를 전송하는 데 사용할 발신 전화번호 | `{outbound_number}` |
| 메시지 | TRUE | 문자열 | 소비자에게 전송할 SMS 메시지 | `{message}` |
| ticket_id | FALSE | 문자열 | 세션과 연결될 CRM 티켓 ID | `{ticket_id}` |
엔드포인트:
Method: POST
Type: RAW
URL: https://{{subdomain}}.{{domain}}/apps/api/v1/sms
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
요청 및 응답 예시
다음 섹션에서는 엔드포인트에 대한 요청의 예를 제공합니다.
티켓 ID를 사용하여 발신 SMS 채팅 만들기
이 예시에서는 티켓 ID와 연결된 최종 사용자에게 아웃바운드 SMS를 만드는 방법을 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: ticket_id로 아웃바운드 SMS 채팅 만들기
{
"id": 114,
"lang": "en",
"chat_type": "Messaging (SMS)",
"status": "selecting",
"created_at": "2021-10-04T17:20:51.000Z",
"queued_at": null,
"assigned_at": null,
"ends_at": null,
"wait_duration": 0,
"chat_duration": 0,
"rating": null,
"has_feedback": false,
"out_ticket_id": null,
"out_ticket_url": null,
"verified": false,
"disconnected_by": "disconnected_by_unknown",
"fail_reason": null,
"selected_menu": null,
"menu_path": null,
"agent_info": null,
"end_user": {
"id": 87,
"identifier": null,
"out_contact_id": null
},
"photos": [],
"videos": [],
"transfers": [],
"participants": [
{
"id": 205,
"type": "end_user",
"status": "connected",
"chat_id": 114,
"user_id": null,
"end_user_id": 87,
"chat_duration": null,
"connected_at": "2021-10-04T17:20:51.000Z",
"ended_at": null,
"fail_reason": "nothing"
}
],
"offer_type": null,
"offer_events": [],
"answer_type": "manual",
"outbound_number": "+16285550199"
}
상태 코드: 200
아웃바운드 SMS 채팅을 만들고 에이전트 ID를 사용하여 에이전트에게 할당
이 예시에서는 제공된 상담사 ID를 기반으로 상담사에게 할당된 아웃바운드 SMS를 만드는 방법을 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"agentId": 1
}
응답: agentId를 사용하여 아웃바운드 SMS 채팅을 만들어 에이전트에게 할당
{
"id": 114,
"lang": "en",
"chat_type": "Messaging (SMS)",
"status": "assigned",
"created_at": "2021-10-04T17:20:51.000Z",
"queued_at": null,
"assigned_at": "2021-10-04T17:20:53.000Z",
"ends_at": null,
"wait_duration": 0,
"chat_duration": 0,
"rating": null,
"has_feedback": false,
"out_ticket_id": null,
"out_ticket_url": null,
"verified": false,
"disconnected_by": "disconnected_by_unknown",
"fail_reason": null,
"selected_menu": null,
"menu_path": null,
"agent_info": {
"id": 1,
"agent_number": 9,
"email": "john.doe@foo.com",
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"avatar_url": "https://foobar.com/johndoe"
},
"end_user": {
"id": 87,
"identifier": null,
"out_contact_id": null
},
"photos": [],
"videos": [],
"transfers": [],
"participants": [
{
"id": 205,
"type": "end_user",
"status": "connected",
"chat_id": 114,
"user_id": null,
"end_user_id": 87,
"chat_duration": null,
"connected_at": "2021-10-04T17:20:51.000Z",
"ended_at": null,
"fail_reason": "nothing"
},
{
"id": 206,
"type": "agent",
"status": "connected",
"chat_id": 114,
"user_id": 1,
"end_user_id": null,
"chat_duration": null,
"connected_at": "2021-10-04T17:20:53.000Z",
"ended_at": null,
"fail_reason": "nothing"
}
],
"offer_type": null,
"offer_events": [],
"answer_type": "manual",
"outbound_number": "+16285550199"
}
상태 코드: 200
발신 SMS 채팅을 만들어 상담사 이메일에 할당하기
이 예시에서는 에이전트 이메일 주소를 제공하여 아웃바운드 SMS 채팅 세션을 만들고 이를 에이전트와 연결하는 방법을 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"agentEmail": "john.doe@foo.com"
}
응답: agentId를 사용하여 아웃바운드 SMS 채팅을 만들어 에이전트에게 할당
{
"id": 114,
"lang": "en",
"chat_type": "Messaging (SMS)",
"status": "assigned",
"created_at": "2021-10-04T17:20:51.000Z",
"queued_at": null,
"assigned_at": "2021-10-04T17:20:53.000Z",
"ends_at": null,
"wait_duration": 0,
"chat_duration": 0,
"rating": null,
"has_feedback": false,
"out_ticket_id": null,
"out_ticket_url": null,
"verified": false,
"disconnected_by": "disconnected_by_unknown",
"fail_reason": null,
"selected_menu": null,
"menu_path": null,
"agent_info": null,
"end_user": {
"id": 87,
"identifier": null,
"out_contact_id": null
},
"photos": [],
"videos": [],
"transfers": [],
"participants": [
{
"id": 205,
"type": "end_user",
"status": "connected",
"chat_id": 114,
"user_id": null,
"end_user_id": 87,
"chat_duration": null,
"connected_at": "2021-10-04T17:20:51.000Z",
"ended_at": null,
"fail_reason": "nothing"
},
{
"id": 206,
"type": "agent",
"status": "connected",
"chat_id": 114,
"user_id": 1,
"end_user_id": null,
"chat_duration": null,
"connected_at": "2021-10-04T17:20:53.000Z",
"ended_at": null,
"fail_reason": "nothing"
}
],
"offer_type": null,
"offer_events": [],
"answer_type": "manual",
"outbound_number": "+16285550199"
}
상태 코드: 200
티켓 ID 없이 아웃바운드 SMS 채팅 만들기
이 예에서는 티켓 ID와 연결하지 않고 아웃바운드 SMS를 만드는 방법을 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: ticket_id 없이 아웃바운드 SMS 채팅 만들기
{
"id": 114,
"lang": "en",
"chat_type": "Messaging (SMS)",
"status": "selecting",
"created_at": "2021-10-04T17:20:51.000Z",
"queued_at": null,
"assigned_at": null,
"ends_at": null,
"wait_duration": 0,
"chat_duration": 0,
"rating": null,
"has_feedback": false,
"out_ticket_id": null,
"out_ticket_url": null,
"verified": false,
"disconnected_by": "disconnected_by_unknown",
"fail_reason": null,
"selected_menu": null,
"menu_path": null,
"agent_info": null,
"end_user": {
"id": 87,
"identifier": null,
"out_contact_id": null
},
"photos": [],
"videos": [],
"transfers": [],
"participants": [
{
"id": 205,
"type": "end_user",
"status": "connected",
"chat_id": 114,
"user_id": null,
"end_user_id": 87,
"chat_duration": null,
"connected_at": "2021-10-04T17:20:51.000Z",
"ended_at": null,
"fail_reason": "nothing"
}
],
"offer_type": null,
"offer_events": [],
"answer_type": "manual",
"outbound_number": "+16285550199"
}
상태 코드: 200
오류 : chat_type을 제공해야 합니다.
이 예시에서는 'chat_type'이 제공되지 않았지만 필요한 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: 오류 : chat_type을 제공해야 합니다.
{
"message": "chat_type needs to be provided"
}
상태 코드: 400
오류 : 유효한 채팅 유형을 제공해야 합니다.
이 예시에서는 채팅 유형을 제공해야 하는데 누락된 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "In-app",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: 오류 : 유효한 채팅 유형을 제공해야 합니다.
{
"message": "valid chat type needs to be provided"
}
상태 코드: 400
오류 : SMS가 사용 설정되지 않음
이 예시에서는 아웃바운드 SMS가 시작되었지만 SMS가 사용 설정되지 않은 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: 오류 : SMS가 사용 설정되지 않음
{
"message": "SMS is not enabled"
}
상태 코드: 400
오류 : 아웃바운드 SMS가 사용 설정되지 않음
이 예시에서는 SMS 세션이 시작되었지만 SMS 채널이 사용 설정되지 않아 실패하는 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: 오류 : 아웃바운드 SMS가 사용 설정되지 않음
{
"message": "Outbound SMS is not enabled"
}
상태 코드: 400
오류 : 최종 사용자 번호가 필요함
이 예에서는 최종 사용자 번호가 제공되지 않았지만 필요한 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
응답: 오류 : end_user_number가 필요합니다.
{
"message": "end_user_number is required"
}
상태 코드: 400
오류 : 최종 사용자 번호가 잘못됨
이 예에서는 제공된 최종 사용자 번호가 유효하지 않은 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "12345",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
응답: 오류 : end_user_number가 잘못됨
{
"message": "end_user_number is invalid"
}
상태 코드: 400
오류 : 미국 외 전화번호는 허용되지 않음
이 예에서는 제공된 번호가 미국 전화번호가 아니며 금지된 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+82 000-000-0000",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
응답: 오류 : 미국 외 전화번호는 허용되지 않음
{
"message": "Non-US phone number not allowed"
}
상태 코드: 400
오류 : 발신 번호는 필수 항목입니다.
이 예에서는 아웃바운드 번호가 제공되지 않았지만 필요한 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: 오류 : outbound_number는 필수 항목입니다.
{
"message": "outbound_number is required"
}
상태 코드: 400
오류 : 발신 번호가 잘못됨
이 예시에서는 제공된 아웃바운드 번호가 유효하지 않은 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "12345",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
응답: 오류 : outbound_number가 잘못됨
{
"message": "outbound_number is invalid"
}
상태 코드: 400
오류 : outbound_number를 찾을 수 없음
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
응답: 오류 : outbound_number를 찾을 수 없음
{
"message": "outbound_number is not found"
}
상태 코드: 400
오류 : 메시지는 필수 항목입니다.
이 예에서는 메시지가 requires에 제공되지 않았지만 필요한 실패 시나리오를 보여줍니다.
요청
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "",
"ticket_id": "5006x00000XXxxxXXX"
}
대답: 오류 : 메시지가 필요합니다.
{
"message": "message is required"
}
상태 코드: 400
오류 : 아웃바운드 SMS가 실패했습니다. 소비자가 이미 활성 SMS 세션에 있습니다.
헤더:
| 키 | 값 | 설명 |
|---|---|---|
| Content-Type | application/json |
본문:
{
"chat_type": "Messaging (SMS)",
"end_user_number": "+1 415-555-0100",
"outbound_number": "+1 628-555-0199",
"message": "lorem ipsum",
"ticket_id": "5006x00000XXxxxXXX"
}
응답: 오류 : 아웃바운드 SMS가 실패했습니다. 소비자가 이미 활성 SMS 세션에 있습니다.
{
"message": "Outbound SMS failed. Consumer is already in an active SMS session."
}
상태 코드: 400