- 인쇄
- PDF
Clova AiCall Open API Spec
- 인쇄
- PDF
version
Version | Date | Changes |
---|---|---|
v2.0.0 | 2021-05-27 | 1. Provide read API for - /dashboard/detail –GET - /dashboard/chart–GET - /dashboard/builder/chart–GET - /dashboard/channel– GET - /dashboard/outbound/call-time– GET 2. “2.1.1.Search Available Number List” fix description of “createType” in request body 3. Modify call stop spec - “3.2.3 Campaign Call Stop” update request body - Original “2.4.3 Get Campaign Call Stop List” split into two new APIs: “2.4.3. Get Campaign Call Stop Detail” “2.4.4. Get Campaign Call Stop Number List” 4. “3.2.3 Campaign Add Call Stop” add list size limit, and update response body 5. “1.1 How to apply for private open API” allow to set “X-CLOVA-AICALL-API-VERSION” and “X-CLOVA-AICALL-TRACE-ID” in header. |
1. Clova AiCall Open API Spec
1.1. How to apply for open API
● Provide the NCP account email and Contact Center ID/code. Request authority split to read and write.
● When request approved, we will provide the “API Secret” (X-CLOVA-AICALL-API-KEY) and “API URL” to you. Then you could request the private open API.
● In order to trace request, add trace id in the header. “X-CLOVA-AICALL-TRACE-ID” can be any string, but unique string is recommended (Such as GUID, “caab126fedf14575b66b554f21b84a57”). “X-CLOVA-AICALL-TRACE-ID” is optional.
● If you want to use the specified version of the API, please set "VERSION" in the header. If the document’s version is v2.x, then set “X-CLOVA-AICALL-API-VERSION : 2”. "X-CLOVA-AICALL-API-VERSION” is optional, if not set, version will be 0.
(You could find one product in API Gateway, named “CLOVA_AICALL_OPEN_API(KR)”. It is used for CLOVA AiCall, please don’t modify or delete it.)
1.2. General API Spec
Protocol | Https |
---|---|
Request Body Content Type | application/json |
Request Body Charset | UTF-8 |
Required Request Header | X-CLOVA-AICALL-API-KEY X-CLOVA-AICALL-API-VERSION X-CLOVA-AICALL-TRACE-ID |
Response Body Content Type | application/json |
Response Body charset | UTF-8 |
1.3. Error Response
Error Response Body:
{
"code": "error code",
"product": "product name",
"message": " error details info",
"path": " request path ",
"timestamp": " yyyy-MM-dd'T'HH:mm:ss'Z "
}
Error Code
Http Status Code | Code | Reason | Have Response Body |
---|---|---|---|
400 | INVALID_PARAM | Request parameters invalid or constraint problem. | Y |
401 | NOT_LOGIN | Api secret(X-CLOVA-AICALL-API-KEY) wrong or there is no secret header | N |
403 | - | Not have authority to access resources | N |
404 | NOT_FOUND | Not found data | Y |
405 | - | Http request method not support | N |
409 | DUPLICATE | Data duplicate | Y |
415 | - | Http request Media Type not support | N |
500 | UNKNOWN | Internal server error | Y |
2. Read API
Request endpoint: “API_URL/read/v1”.
2.1. Phone Number
2.1.1. Search Available Number List
Request
Http Method | GET |
---|---|
Path | /availableNumber |
Description | You can search the phone numbers available in contact center. There are 2 types of numbers: issuance and register. Issuance number is issued from number pool. Used to create agent. Register number is registered by user. Used to create campaign, as the “callerDisplayNumber”. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | number | String | Phone number | Optional |
Query Parameters | status | List | 0: unassigned agent number 1: assigned agent number null: all numbers (contains unassigned phone number and assigned phone number) | Optional |
Query Parameters | createType | String | ISSUANCE or null: issuance number REGISTER: register number | Optional |
Query Parameters | page | Integer | Current page, from 1. | Optional |
Query Parameters | size | Integer | Max element count in one page. Default 20. | Optional |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/availableNumber?contactCenterId=1&createType=ISSUANCE&page=1&size=10' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description | Nullable |
---|---|---|---|---|
Response Body | paged | Boolean | Paged or not | |
content | List | Page content | ||
id | Long | phone number id | ||
number | String | phone number | ||
channel | Integer | Count of phone number’s channel count | ||
status | Integer | [0]: unassigned agent number [1]: assigned aagent number | ||
description | String | Phone number description | Y | |
createdAt | String | phone number create time | ||
updatedAt | String | Phone number update time | ||
contactCenterId | Long | Contact Center ID | ||
createType | String | ISSUANCE: issued phone number REGISTER: registered phone number | ||
agentName | String | Assigned Agent Name | Y | |
pageNumber | Integer | Current Page Number | ||
totalCount | Long | Total Count | ||
totalPages | Integer | Total Pages | ||
pageSize | Integer | Max data elements count. | ||
sort | Boolean | Sort or not. Currently we do not support sorting, you can ignore this field. |
Response example
Http Status: 200
Response Body
{
"paged": **true**,
"content": [
{
"id": 63,
"number": "3333",
"channel": 1,
"status": 1,
"description": "",
"createdAt": "2020-09-07T03:27:19Z",
"updatedAt": "2020-12-10T02:59:31Z",
"contactCenterId": 1,
"createType": "REGISTER",
},
{
"id": 1,
"number": "07079190150",
"channel": 1,
"status": 1,
"description": "123",
"createdAt": "2020-07-17T08:38:24Z",
"updatedAt": "2020-12-10T02:59:14Z",
"contactCenterId": 1,
"createType": "ISSUANCE",
"agentName": "realAccount"
}
],
"pageNumber": 1,
"totalCount": 2,
"totalPages": 1,
"pageSize": 10,
"sort": "UNSORTED"
}
2.2. Agent
2.2.1. Search Agent List
Request
Http Method | GET |
---|---|
Path | /agent |
Description | You can search agent by this API. |
Request Parameter
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | name | String | Agent name | Optional |
Query Parameters | number | String | Assigned phone number | Optional |
Query Parameters | status | Integer | 0: enabled agent. 1: disabled agent. null: search all agents. | Optional |
Query Parameters | all | Boolean | true: all agents(undeleted and deleted agents). false: only undeleted agents. Default false. | Optional |
Query Parameters | page | Integer | Current page, from 1. | Optional |
Query Parameters | size | Integer | Max element count in one page. Default 20. | Optional |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/agent? contactCenterId=1&page=1&size=10' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description | Nullable |
---|---|---|---|---|
Response Body | paged | Boolean | Paged or not | |
content | List | Page content | ||
id | Long | Agent Id | ||
name | String | Agent name | ||
description | String | Agent description | Y | |
number | String | Assigned phone number | ||
csrSpeechLang | String | Language config of CSR(a voice recognition service) | ||
cssVoiceLang | String | Language config of CSS(a voice synthesis service) | ||
cssVoiceType | String | Voice type of css | ||
cssVoiceDetail | String | Voice detail config of CSS. It is json string contains the settings of volumn, please refer to response example. | ||
contactCenterId | Long | Contact Center ID | ||
chatbotDomainCode | String | Chatbot domain code This filed is used to link “CLOVA Chatbot” service | ||
status | Integer | 0: enabled agent 1: disabled agent | ||
createdAt | String | Agent create time | ||
updatedAt | String | Agent update time | ||
channel | Integer | Channel count of assigned phone number. | ||
pageNumber | Integer | Current Page Number | ||
totalCount | Long | Total Count | ||
totalPages | Integer | Total Pages | ||
pageSize | Integer | Max data elements count. | ||
sort | Boolean | Sort or not. Currently we do not support sorting, you can ignore this field. |
Response example
Http Status: 200
Response Body
{
"paged": **true**,
"content": [
{
"id": 62,
"name": "123123",
"description": "23",
"number": "132465789",
"csrSpeechLang": "ko",
"cssVoiceLang": "ko",
"cssVoiceType": "nara",
"cssVoiceDetail": "{\"speed\":0,\"pitch\":0,\"alpha\":0,\"volume\":0}",
"contactCenterId": 1,
"chatbotDomainCode": "rem_aicc",
"status": 0,
"createdAt": "2020-09-08T03:23:19Z",
"updatedAt": "2020-12-10T03:00:31Z",
"channel": 1
},
{
"id": 1,
"name": "realAccount",
"description": "do not update or delete",
"phoneNumber": "07079190150",
"csrSpeechLang": "ko",
"cssVoiceLang": "ko",
"cssVoiceType": "ara",
"cssVoiceDetail": "{\"speed\":0,\"pitch\":0,\"alpha\":0,\"volume\":0}",
"contactCenterId": 1,
"chatbotDomainCode": "rem_aicc",
"status": 0,
"createdAt": "2020-07-17T05:54:00Z",
"updatedAt": "2020-12-10T03:00:18Z",
"channel": 1
}
],
"pageNumber": 2,
"totalCount": 7,
"totalPages": 4,
"pageSize": 2,
"sort": "UNSORTED"
}
2.3. Campaign Target
2.3.1. Get Campaign Target Detail
Request
Http Method | GET |
---|---|
Path | /campaign/target/{targetId} |
Description | You can get campaign target detail information by this API. One campaign target could only assign to one campaign. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Path Parameters | targetId | Long | Campaign target id | Required |
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/campaign/target/63?contactCenterId=1' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description | Nullable |
---|---|---|---|---|
Response Body | id | Long | Campaign id | |
name | String | Campaign target name | ||
description | String | Campaign description | Y | |
targetNumbers | List | Campaign target phone number list | ||
id | Long | Target phone number id It auto-generated when you create campaign target. | ||
number | String | Target phone number | ||
key1 | String | Custom information. Provided by user when create campaign target. | Y | |
key2 | String | Custom information. Provided by user when create campaign target. | Y |
Response example
Http Status: 200
Response Body
{
"id": 63,
"name": "test100088",
"description": "description1",
"targetNumbers": [
{
"id": 170,
"number": "1020304050"
},
{
"id": 171,
"number": "1122334455",
"key1": "e123qa",
"key2": "3f"
}
]
}
2.4. Campaign
2.4.1. Search Campaign List
Request
Http Method | GET |
---|---|
Path | /campaign |
Description | You can search campaign list by this API. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | name | String | Campaign name | Optional |
Query Parameters | agentIds | List | agentId list | Optional |
Query Parameters | targetId | Long | Campaign targetId | Optional |
Query Parameters | status | Integer | Campaign status.. 0: not ready 1: ready to run 2: stopped 3: completed 4: terminated 5: running 6: expired null: search all campaigns. | Optional |
Query Parameters | page | Integer | Current page, from 1. | Optional |
Query Parameters | size | Integer | Max element count in one page. Default 20. | Optional |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/campaign?contactCenterId=1&page=1&size=10' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description | Nullable |
---|---|---|---|---|
Response Body | paged | Boolean | Paged or not | |
content | List | Page content | ||
id | Long | Campaign id | ||
name | String | Campaign name | ||
status | Integer | Campaign status 0: not ready 1: ready to run 2: stopped 3: completed 4: terminated 5: running 6: expired | ||
createdAt | String | Campaign create time | ||
updatedAt | String | Campaign update time | ||
channel | Integer | Count of channel. | ||
callerDisplayNumber | String | Registered phone number. | Y | |
agent | Json Object | Assigned agent information. | ||
id | Integer | Agent id | ||
name | String | Agent name | ||
number | String | Agent phone number | ||
deletedAt | String | If agent is deleted, this is the delete time. Agent could be deleted after campaign completed. | Y | |
pageNumber | Integer | Current page number | ||
totalCount | Long | Total count | ||
totalPages | Integer | Total pages | ||
pageSize | Integer | Max data elements count. | ||
sort | Boolean | Sort or not. Currently we do not support sorting, you can ignore this field. |
Response example
Http Status: 200
Response Body
{
"paged": **true**,
"content": [
{
"id": 79,
"name": "test_dev_114",
"status": 3,
"createdAt": "2020-11-04T08:53:01Z",
"updatedAt": "2020-11-04T08:53:01Z",
"channel": 1,
"agent": {
"id": 79,
"name": "test_dev_114",
"number": "07011111111",
"deletedAt": "2020-11-04T08:53:01Z"
}
},
{
"id": 77,
"name": "test_dev_2",
"status": 0,
"createdAt": "2020-10-15T08:57:54Z",
"updatedAt": "2020-11-03T07:09:16Z",
"agentId": 75,
"agentName": "1015",
"agentPhone": "222",
"channel": 1,
"callerDisplayNumber": "1588000000",
"agent": {
"id": 79,
"name": "test_dev_114",
"number": "07011111111"
}
}
],
"pageNumber": 1,
"totalCount": 2,
"totalPages": 1,
"pageSize": 20,
"sort": "UNSORTED"
}
2.4.2. Search Campaign Result List
Request
Http Method | GET |
---|---|
Path | /campaign/result/{campaignId} |
Description | You can search campaign results by this API. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Path Parameters | campaignId | Long | Campaign id | Required |
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | resultCode | Integer | Result code | Optional |
Query Parameters | resultMessage | String | Result message | Optional |
Query Parameters | number | String | Campaign target phone number | Optional |
Query Parameters | page | Integer | Current page, from 1. | Optional |
Query Parameters | size | Integer | Max element count in one page. Default 20. | Optional |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/campaign/result/74?contactCenterId=1&resultCode=1&page=1&size=10' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description | Nullable |
---|---|---|---|---|
Response Body | paged | Boolean | Paged or not | |
content | List | Page content | ||
id | Long | Result id | ||
campaignId | Long | Campaign id | ||
callerNumber | String | Caller phone number. Campaign agent assign number. | ||
calleeNumber | String | Callee phone number. Campaign target number. | ||
resultCode | Integer | Result code | Y | |
resultMessage | String | Result message | Y | |
callTryTime | String | The time to try calling to customer. | Y | |
callEndTime | String | End time of call. | Y | |
dialSequence | Integer | Current dial times. If set retry when create campaign, when call no response, will dial several times. | Y | |
createdAt | String | The time when send campaign targets to Hanmac | ||
updatedAt | String | The time when Hanmac callback to update call result | ||
key1 | String | Custom information of campaign target. Provided by user when create campaign target. | ||
key2 | String | Custom information of campaign target. Provided by user when create campaign target. | ||
pageNumber | Integer | Current page Number | ||
totalCount | Long | Total count | ||
totalPages | Integer | Total pages | ||
pageSize | Integer | Max data elements count. | ||
sort | Boolean | Sort or not. Currently we do not support sorting, you can ignore this field. |
Response example
Http Status: 200
Response Body
Response example | |
---|---|
Http Status | 200 |
Response Body | { "paged": true, "content": [ { "id": 10, "campaignId": "4", "callerNumber": "0215881588", "calleeNumber": "01012345683", "resultCode": 1, "resultMessage": "응답", "callTryTime": "2019-07-10T10:09:00Z", "callEndTime": "2019-07-10T10:09:02Z", "dialSequence": 3, "createdAt": "2020-09-04T07:03:38Z", "updatedAt": "2020-12-10T03:00:15Z" }, { "id": 5, "campaignId": "4", "callerNumber": "0215881588", "calleeNumber": "01012345682", "resultCode": 1, "resultMessage": "응답", "callTryTime": "2019-07-10T10:09:00Z", "callEndTime": "2019-07-10T10:09:02Z", "dialSequence": 3, "createdAt": "2020-09-04T07:00:17Z", "updatedAt": "2020-12-10T03:00:15Z" } ], "pageNumber": 1, "totalCount": 2, "totalPages": 1, "pageSize": 20, "sort": "UNSORTED" } |
{
"paged": **true**,
"content": [
{
"id": 10,
"campaignId": "4",
"callerNumber": "0215881588",
"calleeNumber": "01012345683",
"resultCode": 1,
"resultMessage": "응답",
"callTryTime": "2019-07-10T10:09:00Z",
"callEndTime": "2019-07-10T10:09:02Z",
"dialSequence": 3,
"createdAt": "2020-09-04T07:03:38Z",
"updatedAt": "2020-12-10T03:00:15Z"
},
{
"id": 5,
"campaignId": "4",
"callerNumber": "0215881588",
"calleeNumber": "01012345682",
"resultCode": 1,
"resultMessage": "응답",
"callTryTime": "2019-07-10T10:09:00Z",
"callEndTime": "2019-07-10T10:09:02Z",
"dialSequence": 3,
"createdAt": "2020-09-04T07:00:17Z",
"updatedAt": "2020-12-10T03:00:15Z"
}
],
"pageNumber": 1,
"totalCount": 2,
"totalPages": 1,
"pageSize": 20,
"sort": "UNSORTED"
}
Result code/message Reference | |
---|---|
01 | 응답 |
02 | 무응답 |
03 | 통화중 |
04 | 자동응답 |
05 | 팩스 |
06 | 결번 |
07 | 묵음 |
08 | 상담끊음 |
09 | 고객끊음 |
10 | 제외고객 |
13 | 다이얼오류 |
14 | 호전환실패 |
16 | 소리샘통화 |
17 | 소리샘꺼짐 |
18 | 소리샘무응 |
19 | 시스템오류 |
20 | 연결성공 |
21 | 착신정지 |
22 | 발송취소 |
31 | 번호없음 |
2.4.3. Get Campaign Call Stop Detail
Request
Http Method | GET |
---|---|
Path | /campaign/call/stop/{callStopId} |
Description | You can get one call stop request detail information. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Path Parameters | callStopId | Long | Call Stop ID | Required |
Query Parameters | campaignId | Long | Campaign ID | Required |
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/campaign/call/stop/1? campaignId=74&contactCenterId=1&page=1&size=10' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | contactCenterId | Long | Contact Center ID |
campaignId | Long | Campaign id | |
targetNumbers | List | Stop call target number list. Number,key1, key2 are combination condition. | |
number | String | Campaign target phone number(length limit:4-20, start with 0 or 1) | |
key1 | String | Custom information for number (length limit:0-10), just used to record custom information. Will response when get campaign target detail or get campaign result. | |
key2 | String | Custom information for number (length limit:0-2), just used to record custom information. Will response when get campaign target detail or get campaign result. |
Response example
Http Status: 200
Response Body
{
"campaignId": 74,
"targetNumbers": [
{
"number": "11111111",
"key1": "e123qa",
"key2": "3f"
},
{
"number": "11111111111"
}
]
}
2.4.4. Get Campaign Call Stop Number List
Request
Http Method | GET |
---|---|
Path | /campaign/call/stop/number/{campaignId} |
Description | You can get all call stop numbers of campaign. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Path Parameters | campaignId | Long | Campaign id | Required |
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | callStopId | Long | Call Stop ID | Optional |
Query Parameters | number | String | Campaign target phone number | Optional |
Query Parameters | key1 | String | Custom information for number | Optional |
Query Parameters | key2 | String | Custom information for number | Optional |
Query Parameters | page | Integer | Current page, from 1. | Optional |
Query Parameters | size | Integer | Max element count in one page. Default 10. | Optional |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/campaign/call/stop/number/74?contactCenterId=1&page=1&size=10' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | paged | Boolean | Paged or not |
content | List | Page content. Stop call target numbers. Empty means no stop call number. | |
callStopId | Long | Campaign call stop id. | |
campaignTargetNumberId | Long | Campaign target phone number id. | |
number | String | Campaign target phone number(length limit:4-20, start with 0 or 1) | |
key1 | String | Custom information for number (length limit:0-10), just used to record custom information. Will response when get campaign target detail or get campaign result. | |
key2 | String | Custom information for number (length limit:0-2), just used to record custom information. Will response when get campaign target detail or get campaign result. | |
pageNumber | Integer | Current page Number | |
totalCount | Long | Total count | |
totalPages | Integer | Total pages | |
pageSize | Integer | Max data elements count. | |
sort | Boolean | Sort or not. Currently we do not support sorting, you can ignore this field. |
Response example
Http Status: 200
Response Body
{
"paged": **true**,
"content": [
{
"callStopId ": 1,
"campaignTargetNumberId ": 1,
"number": "11111111",
"key1": "e123qa",
"key2": "3f"
},
{
"callStopId ": 1,
"campaignTargetNumberId ": 2,
"number": "11111111111"
}
],
"pageNumber": 1,
"totalCount": 1,
"totalPages": 1,
"pageSize": 10,
"sort": "UNSORTED"
}
2.5. Dashboard
2.5.1. Get Dashboard Detail
Request
Http Method | GET |
---|---|
Path | /dashboard/detail |
Description | You can get detail info of dashboard. |
**Request Parameters **
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Request example
curl --location --request GET ' https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/dashboard/detail?contactCenterId=1' \
--header 'X-CLOVA-AICALL-API-KEY: 4839dffb-6493-4c95-b708-c2595261c1ad' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | agentCount | Integer | The number of agents in the contact center. |
phoneNumberCount | Integer | The number of phone numbers used in the contact center. | |
channelCount | Integer | The number of channels used in the contact center. | |
campaignCount | Integer | The number of campaigns in the contact center. |
**Response example **
Http Status: 200
Response Body
{
"agentCount": 7,
"phoneNumberCount": 1,
"channelCount": 10,
"campaignCount": 5
}
2.5.2. Get Dashboard Chart
**Request **
Http Method | GET |
---|---|
Path | /dashboard/chart |
Description | You can get charts of dashboard. |
**Request Parameters **
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | agentId | Long | Agent id | Required |
Query Parameters | startTime | String | Start time of statistics | Required |
Query Parameters | endTime | String | End time of statistics | Required |
Query Parameters | type | String | “SESSION_TIME”: Count the number of sessions “SESSION_COUNT”: Count the total duration of the session | Required |
Request example
curl --location --request GET ' https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/dashboard/chart?contactCenterId=1&agentId=-1&startTime=2021-04-12+0:00:00&endTime=2021-04-12+16:00:00&type=SESSION_TIME' \
--header 'X-CLOVA-AICALL-API-KEY: 4839dffb-6493-4c95-b708-c2595261c1ad' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | content | List | Content |
content.startTime | String | Start time of statistics | |
content.count. | Long | Count according to type | |
statsType | String | “DAY”: Count in days “HOUR”: Count in hours If the “startTime” and “endTime” in request parameter are the same day, then “statsType” in response is " HOUR ", otherwise it is " DAY". |
Response example
Http Status: 200
Response Body
{
"content": [
{
"startTime": "2021-04-12 00:00:00",
"count": 0
},
{
"startTime": "2021-04-12 01:00:00",
"count": 0
},
{
"startTime": "2021-04-12 02:00:00",
"count": 0
},
{
"startTime": "2021-04-12 03:00:00",
"count": 0
},
{
"startTime": "2021-04-12 04:00:00",
"count": 0
},
{
"startTime": "2021-04-12 05:00:00",
"count": 0
},
{
"startTime": "2021-04-12 06:00:00",
"count": 0
},
{
"startTime": "2021-04-12 07:00:00",
"count": 0
},
{
"startTime": "2021-04-12 08:00:00",
"count": 0
},
{
"startTime": "2021-04-12 09:00:00",
"count": 0
},
{
"startTime": "2021-04-12 10:00:00",
"count": 0
},
{
"startTime": "2021-04-12 11:00:00",
"count": 0
},
{
"startTime": "2021-04-12 12:00:00",
"count": 0
},
{
"startTime": "2021-04-12 13:00:00",
"count": 0
},
{
"startTime": "2021-04-12 14:00:00",
"count": 0
},
{
"startTime": "2021-04-12 15:00:00",
"count": 0
},
{
"startTime": "2021-04-12 16:00:00",
"count": 0
}
],
"statsType": "HOUR"
}
2.5.3. Get Dashboard Chart In Builder
Request
Http Method | GET |
---|---|
Path | /dashboard/builder/chart |
Description | You can get charts of dashboard. (Except for the url, this api is exactly the same as 2.5.2) |
**Request Parameters **
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | agentId | Long | Agent id | Required |
Query Parameters | startTime | String | Start time of statistics | Required |
Query Parameters | endTime | String | End time of statistics | Required |
Query Parameters | type | String | “SESSION_TIME”: Count the number of sessions “SESSION_COUNT”: Count the total duration of the session | Required |
Request example
curl --location --request GET ' https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/dashboard/builder/chart?contactCenterId=1&agentId=-1&startTime=2021-04-12+00:00:00&endTime=2021-04-12+16:00:00&type=SESSION_TIME' \
--header 'X-CLOVA-AICALL-API-KEY: 4839dffb-6493-4c95-b708-c2595261c1ad' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | content | List | Content |
content.startTime | String | Start time of statistics | |
content.count. | Long | Count according to type | |
statsType | String | “DAY”: Count in days “HOUR”: Count in hours If the “startTime” and “endTime” in request parameter are the same day, then “statsType” in response is " HOUR ", otherwise it is " DAY". |
Response example
Http Status: 200
Response Body
{
"content": [
{
"startTime": "2020-08-26 00:00:00",
"count": 4630
},
{
"startTime": "2020-08-27 00:00:00",
"count": 0
}
],
"statsType": "DAY"
}
2.5.4. Get Channel Count
Request
Http Method | GET |
---|---|
Path | /dashboard/channel |
Description | You can get channel count of dashboard. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | startTime | String | Start time of statistics | Required |
Query Parameters | endTime | String | End time of statistics | Required |
Request example
curl --location --request GET ' https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/dashboard/channel?contactCenterId=1&startTime=2021-04-12+00:00:00&endTime=2021-04-12+16:00:00' \
--header 'X-CLOVA-AICALL-API-KEY: 4839dffb-6493-4c95-b708-c2595261c1ad' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | content | List | Content |
content.startTime | String | Start time of statistics | |
content.count. | Long | Count according to statsType | |
statsType | String | “DAY”: Count in days “HOUR”: Count in hours If the “startTime” and “endTime” in request parameter are the same day, then “statsType” in response is " HOUR ", otherwise it is " DAY". |
Response example
Http Status: 200
Response Body
{
"content": [
{
"startTime": "2021-04-12 00:00:00",
"count": 0
},
{
"startTime": "2021-04-12 01:00:00",
"count": 0
},
{
"startTime": "2021-04-12 02:00:00",
"count": 0
},
{
"startTime": "2021-04-12 03:00:00",
"count": 0
},
{
"startTime": "2021-04-12 04:00:00",
"count": 0
},
{
"startTime": "2021-04-12 05:00:00",
"count": 0
},
{
"startTime": "2021-04-12 06:00:00",
"count": 0
},
{
"startTime": "2021-04-12 07:00:00",
"count": 0
},
{
"startTime": "2021-04-12 08:00:00",
"count": 0
},
{
"startTime": "2021-04-12 09:00:00",
"count": 0
},
{
"startTime": "2021-04-12 10:00:00",
"count": 0
},
{
"startTime": "2021-04-12 11:00:00",
"count": 0
},
{
"startTime": "2021-04-12 12:00:00",
"count": 0
},
{
"startTime": "2021-04-12 13:00:00",
"count": 0
},
{
"startTime": "2021-04-12 14:00:00",
"count": 0
},
{
"startTime": "2021-04-12 15:00:00",
"count": 0
},
{
"startTime": "2021-04-12 16:00:00",
"count": 0
}
],
"statsType": "HOUR"
}
2.5.5. Get Outbound Call Time
Request
Http Method | GET |
---|---|
Path | /dashboard/outbound/call-time |
Description | You can count the time of outbound call |
**Request Parameters **
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | agentId | Long | Agent id | Required |
Query Parameters | startTime | String | Start time of statistics, must begin with 00:00:00 | Required |
Query Parameters | endTime | String | End time of statistics | Required |
Request example
curl --location --request GET 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/read/v1/dashboard/outbound/call-time?contactCenterId=1&agentId=-1&startTime=2021-04-12+00:00:00&endTime=2021-04-12+16:00:00' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' --header 'X-CLOVA-AICALL-API-VERSION: 2' --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | mobile | List | Content of mobile phone statistics |
mobile.startTime | String | Start time of statistics | |
mobile.count. | Long | Count the time of outbound call | |
internet | List | Content of internet phone statistics | |
internet.startTime | String | Start time of statistics | |
internet.count. | Long | Count the time of outbound call | |
telephone | List | Content of telephone statistics | |
telephone.startTime | String | Start time of statistics | |
telephone.count. | Long | Count the time of outbound call | |
statsType | String | “DAY”: Count in days “HOUR”: Count in hours If the “startTime” and “endTime” in request parameter are the same day, then “statsType” in response is " HOUR ", otherwise it is " DAY". |
**Response example **
Http Status: 200
Response Body
{
"mobile": [
{
"startTime": "2021-04-12 00:00:00",
"count": 0
},
{
"startTime": "2021-04-12 01:00:00",
"count": 0
},
{
"startTime": "2021-04-12 02:00:00",
"count": 0
},
{
"startTime": "2021-04-12 03:00:00",
"count": 0
},
{
"startTime": "2021-04-12 04:00:00",
"count": 0
},
{
"startTime": "2021-04-12 05:00:00",
"count": 0 },
{
"startTime": "2021-04-12 06:00:00",
"count": 0
},
{
"startTime": "2021-04-12 07:00:00",
"count": 0
},
{
"startTime": "2021-04-12 08:00:00",
"count": 0
},
{
"startTime": "2021-04-12 09:00:00",
"count": 0
},
{
"startTime": "2021-04-12 10:00:00",
"count": 0
},
{
"startTime": "2021-04-12 11:00:00",
"count": 0
},
{
"startTime": "2021-04-12 12:00:00",
"count": 0
},
{
"startTime": "2021-04-12 13:00:00",
"count": 0
},
{
"startTime": "2021-04-12 14:00:00",
"count": 0
},
{
"startTime": "2021-04-12 15:00:00",
"count": 0
},
{
"startTime": "2021-04-12 16:00:00",
"count": 0
}
],
"internet": [
{
"startTime": "2021-04-12 00:00:00",
"count": 0
},
{
"startTime": "2021-04-12 01:00:00",
"count": 0
},
{
"startTime": "2021-04-12 02:00:00",
"count": 0
},
{
"startTime": "2021-04-12 03:00:00",
"count": 0
},
{
"startTime": "2021-04-12 04:00:00",
"count": 0
},
{
"startTime": "2021-04-12 05:00:00",
"count": 0
},
{
"startTime": "2021-04-12 06:00:00",
"count": 0
},
{
"startTime": "2021-04-12 07:00:00",
"count": 0
},
{
"startTime": "2021-04-12 08:00:00",
"count": 0
},
{
"startTime": "2021-04-12 09:00:00",
"count": 0
},
{
"startTime": "2021-04-12 10:00:00",
"count": 0
},
{
"startTime": "2021-04-12 11:00:00",
"count": 0
},
{
"startTime": "2021-04-12 12:00:00",
"count": 0
},
{
"startTime": "2021-04-12 13:00:00",
"count": 0
},
{
"startTime": "2021-04-12 14:00:00",
"count": 0
},
{
"startTime": "2021-04-12 15:00:00",
"count": 0
},
{
"startTime": "2021-04-12 16:00:00",
"count": 0
}
],
"telephone": [
{
"startTime": "2021-04-12 00:00:00",
"count": 0
},
{
"startTime": "2021-04-12 01:00:00",
"count": 0
},
{
"startTime": "2021-04-12 02:00:00",
"count": 0
},
{
"startTime": "2021-04-12 03:00:00",
"count": 0
},
{
"startTime": "2021-04-12 04:00:00",
"count": 0
},
{
"startTime": "2021-04-12 05:00:00",
"count": 0
},
{
"startTime": "2021-04-12 06:00:00",
"count": 0
},
{
"startTime": "2021-04-12 07:00:00",
"count": 0
},
{
"startTime": "2021-04-12 08:00:00",
"count": 0
},
{
"startTime": "2021-04-12 09:00:00",
"count": 0
},
{
"startTime": "2021-04-12 10:00:00",
"count": 0
},
{
"startTime": "2021-04-12 11:00:00",
"count": 0
},
{
"startTime": "2021-04-12 12:00:00",
"count": 0
},
{
"startTime": "2021-04-12 13:00:00",
"count": 0
},
{
"startTime": "2021-04-12 14:00:00",
"count": 0
},
{
"startTime": "2021-04-12 15:00:00",
"count": 0
},
{
"startTime": "2021-04-12 16:00:00",
"count": 0
}
],
"statsType": "HOUR"
}
3. Write API
Request endpoint: “API_URL/write/v1”.
3.1. Campaign Target
3.1.1. Create Campaign Target
Request
Http Method | POST | |
---|---|---|
Path | /campaign/target | |
Description | You can add Campaign target by this API. One campaign target could only assign to one campaign. |
**Request Parameters **
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Request Body | name | String | Campaign target name | Required |
description | String | Campaign target description | Optional | |
targetNumbers | List | Campaign target phone number list(length limit <5000) | Required | |
number | String | Campaign target phone number(length limit:4-20, start with 0 or 1) | Required | |
key1 | String | Custom information for number (length limit:0-10), just used to record custom information. Will response when get campaign target detail or get campaign result. | Optional | |
key2 | String | Custom information for number (length limit:0-2), just used to record custom information. Will response when get campaign target detail or get campaign result. | Optional |
Request example
curl --location --request POST 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/write/v1/campaign/target?contactCenterId=1' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' \
--header 'X-CLOVA-AICALL-API-VERSION: 2' \
--header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test0121",
"description": "description",
"targetNumbers": [
{
"number": "11111111",
"key1": "e123qa",
"key2": "3f"
},
{
"number": "11111111111"
}
]
}'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | id | Long | Campaign target id |
Response example
Http Status: 200
Response Body
{
"id": 62
}
3.2. Campaign
3.2.1. Create Campaign
Request
Http Method | POST | |
---|---|---|
Path | /campaign | |
Description | You can create campaign by this API. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Request Body | name | String | Campaign name | Required |
agentId | Long | Campaign need to assign an agent and then use agent’s number as caller. You can get agent id by API “2.2.1 Search Agent List” | Required | |
retryTimes | Integer | Retry times(value limit:0<=retryTimes <=10) 0: no retry | Required | |
scheduleFromDate | String | yyyy-MM-dd | Required | |
scheduleToDate | String | yyyy-MM-dd | Required | |
scheduleFromTime | String | HH:mm | Required | |
scheduleToTime | String | HH:mm | Required | |
targetId | Long | Campaign target id. Could get it from response of “3.1.1 Create Campaign Target”. | Required | |
callerDisplayNumberId | Long | A registered phone number id. If not set, will show agent’s number to user. You can get phone number id by API “2.1.1 Search Available Number List” | Optional |
Request example
curl --location --request POST 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/write/v1/campaign?contactCenterId=1' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' \
--header 'X-CLOVA-AICALL-API-VERSION: 2' \
--header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test_0129",
"agentId": 1,
"retryTimes": 3,
"scheduleFromDate": "2021-11-01",
"scheduleToDate": "2021-11-11",
"scheduleFromTime": "09:00",
"scheduleToTime": "11:00",
"targetId": 73,
"callerDisplayNumberId":74
}'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | id | Long | Campaign id |
Response example
Http Status: 200
Response Body
{
"id": 62
}
3.2.2. Update Campaign Status
Request
Http Method | PUT |
---|---|
Path | /campaign/status/{campaignId} |
Description | You can update campaign status by this API. Only campaign status = 0 or 2 or 6 can start. Only campaign status = 1 or 5 can stop. Only campaign status = 2 or 6 can terminate. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Path Parameters | campaignId | Long | Campaign id | Required |
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Query Parameters | status | Integer | Campaign status 1:start 2:stop 4:terminate | Required |
Request example
Request example |
---|
curl --location --request PUT 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/write/v1/campaign/status/93?contactCenterId=1&status=1' \ --header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' \ --header 'X-CLOVA-AICALL-API-VERSION: 2' \ --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57' |
curl --location --request PUT 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/write/v1/campaign/status/93?contactCenterId=1&status=1' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' \ --header 'X-CLOVA-AICALL-API-VERSION: 2' \ --header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57'
Response
Http Status: 200
Response Body: No Response body
3.2.3. Campaign Add Call Stop
Request
Request | |
---|---|
Http Method | POST |
Path | /campaign/call/stop |
Description | When you need stop dialing some specific target numbers in campaign, you can use this API. |
Request Parameters
Parameter Type | Parameter name | Data Type | Description | Required |
---|---|---|---|---|
Query Parameters | contactCenterId | Long | Contact Center ID | Required |
Request Body | campaignId | Long | Campaign id | Required |
targetNumbers | List | Stop call target number list. Number, key1, key2 are combination condition. List size limit: 1~20. | Required | |
number | String | Campaign target phone number(length limit:4-20, start with 0 or 1) | Required | |
key1 | String | Custom information for number (length limit: 0-10), just used to record custom information. Will response when get campaign target detail or get campaign result. | Optional | |
key2 | String | Custom information for number (length limit: 0-2), just used to record custom information. Will response when get campaign target detail or get campaign result. | Optional |
Request example
curl --location --request POST 'https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com/write/v1/campaign/call/stop?contactCenterId=1' \
--header 'X-CLOVA-AICALL-API-KEY: 90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea' \
--header 'X-CLOVA-AICALL-API-VERSION: 2' \
--header 'X-CLOVA-AICALL-TRACE-ID: caab126fedf14575b66b554f21b84a57' \
--header 'Content-Type: application/json' \
--data-raw '{
"campaignId": 74,
"targetNumbers": [
{
"number": "11111111",
"key1": "e123qa",
"key2": "3f"
},
{
"number": "11111111111"
}
]
}'
Response
Parameter Type | Parameter name | Data Type | Description |
---|---|---|---|
Response Body | id | Long | Call Stop ID |
Response example
Http Status: 200
Response Body
{
"id": 62
}
4. Java Code Demo
import java.io.IOException;
import java.util.UUID;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class Demo {
private static final String *url* = "https://ac86e44bd82542c39b6bfbc2fb6f488a.test-apigw.ntruss.com";
private static final String *key* = "90d97f24-6f0b-4d9a-bbf9-ed391b44c6ea";
private static final String *version* = "2";
private static final String *write_api_prefix* = "/write/v1";
private static final String *read_api_prefix* = "/read/v1";
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Response addCampaignTargetResponse = *invokeAddCampaignTarget*(client);
System.*out*.println("Response:" + addCampaignTargetResponse.body().string());
Response getCampaignResultResponse = *invokeGetCampaignResult*(client);
System.*out*.println("Response:" + getCampaignResultResponse.body().string());
Response campaignCallStopResponse = *invokeCampaignCallStop*(client);
System.*out*.println("Response status:" + campaignCallStopResponse.code());
Response getCampaignListResponse = *invokeGetCampaignList*(client);
System.*out*.println("Response:" + getCampaignListResponse.body().string());
Response addCampaigResponse = *invokeAddCampaign*(client);
System.*out*.println("Response:" + addCampaigResponse.body().string());
Response updateCampaignStatusResponse = *invokeUpdateCampaignStatus*(client);
System.*out*.println("Response status:" + updateCampaignStatusResponse.code());
Response getPhoneListResponse = *invokeGetPhoneList*(client);
System.*out*.println("Response:" + getPhoneListResponse.body().string());
Response getAgentListResponse = *invokeGetAgentList*(client);
System.*out*.println("Response:" + getAgentListResponse.body().string());
Response getCampaignTargetDetailResponse = *invokeGetCampaignTargetDetail*(client);
System.*out*.println("Response:" + getCampaignTargetDetailResponse.body().string());
}
public static Response invokeAddCampaignTarget(OkHttpClient client) throws IOException {
String json = "{\n"
+ " \"name\": \"test100088\",\n"
+ " \"description\": \"description1\",\n"
+ " \"targetNumbers\": [\n"
+ " {\n"
+ " \"number\": \"1122334455\",\n"
+ " \"key1\": \"e123qa\",\n"
+ " \"key2\": \"3f\"\n"
+ " },\n"
+ " {\n"
+ " \"number\": \"1020304050\"\n"
+ " }\n"
+ " ]\n"
+ "}";
RequestBody body = RequestBody.*create*(MediaType.*parse*("application/json"), json);
Request request = new Request.Builder()
.url(
*url* + *write_api_prefix* + "/campaign/target?contactCenterId=1")
.method("POST", body)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeGetCampaignResult(OkHttpClient client) throws IOException {
Request request = new Request.Builder()
.url(*url* + *read_api_prefix* + "/campaign/result/74?contactCenterId=1")
.method("GET", null)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeCampaignCallStop(OkHttpClient client) throws IOException {
String json = "{\n"
+ " \"campaignId\": 34,\n"
+ " \"targetNumbers\": [\n"
+ " {\n"
+ " \"number\": \"1122334455\",\n"
+ " \"key1\": \"e123qa\",\n"
+ " \"key2\": \"3f\"\n"
+ " },\n"
+ " {\n"
+ " \"number\": \"1020304050\"\n"
+ " }\n"
+ " ]\n"
+ "}";
RequestBody body = RequestBody.*create*(MediaType.*parse*("application/json"), json);
Request request = new Request.Builder()
.url(*url* + *write_api_prefix* + "/campaign/call/stop?contactCenterId=1")
.method("POST", body)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeGetCampaignList(OkHttpClient client) throws IOException {
Request request = new Request.Builder()
.url(*url* + *read_api_prefix* + "/campaign?contactCenterId=1")
.method("GET", null)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeGetPhoneList(OkHttpClient client) throws IOException {
Request request = new Request.Builder()
.url(*url* + *read_api_prefix* + "/phone?page=1&size=10&createType=REGISTER&contactCenterId=1")
.method("GET", null)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeGetAgentList(OkHttpClient client) throws IOException {
Request request = new Request.Builder()
.url(*url* + *read_api_prefix* + "/agent?page=1&size=10&contactCenterId=1")
.method("GET", null)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeGetCampaignTargetDetail(OkHttpClient client) throws IOException {
Request request = new Request.Builder()
.url(*url* + *read_api_prefix* + "/campaign/target/1?contactCenterId=1")
.method("GET", null)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeAddCampaign(OkHttpClient client) throws IOException {
String json = "{\n"
+ " \"name\": \"test_0119\",\n"
+ " \"agentId\": 1,\n"
+ " \"retryTimes\": 3,\n"
+ " \"scheduleFromDate\": \"2021-11-01\",\n"
+ " \"scheduleToDate\": \"2021-11-11\",\n"
+ " \"scheduleFromTime\": \"09:00\",\n"
+ " \"scheduleToTime\": \"09:00\",\n"
+ " \"targetId\": 63,\n"
+ " \"callerDisplayNumberId\":74\n"
+ "}";
RequestBody body = RequestBody.*create*(MediaType.*parse*("application/json"), json);
Request request = new Request.Builder()
.url(*url* + *write_api_prefix* + "/campaign?contactCenterId=1")
.method("POST", body)
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
public static Response invokeUpdateCampaignStatus(OkHttpClient client) throws IOException {
Request request = new Request.Builder()
.url(*url* + *write_api_prefix* + "/campaign/status/94?contactCenterId=1&status=1")
.method("PUT", RequestBody.*create*(MediaType.*parse*("application/json"), "{}"))
.addHeader("X-CLOVA-AICALL-API-KEY", *key*)
.addHeader("X-CLOVA-AICALL-API-VERSION", *version*)
.addHeader("X-CLOVA-AICALL-TRACE-ID", UUID.*randomUUID*().toString())
.build();
System.*out*.println(request);
return client.newCall(request).execute();
}
}