Clova AiCall Open API Spec
    • PDF

    Clova AiCall Open API Spec

    • PDF

    기사 요약

    version

    VersionDateChanges
    v2.0.02021-05-271. 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

    ProtocolHttps
    Request Body Content Typeapplication/json
    Request Body CharsetUTF-8
    Required Request HeaderX-CLOVA-AICALL-API-KEY X-CLOVA-AICALL-API-VERSION X-CLOVA-AICALL-TRACE-ID
    Response Body Content Typeapplication/json
    Response Body charsetUTF-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 CodeCodeReasonHave Response Body
    400INVALID_PARAMRequest parameters invalid or constraint problem.Y
    401NOT_LOGINApi secret(X-CLOVA-AICALL-API-KEY) wrong or there is no secret headerN
    403-Not have authority to access resourcesN
    404NOT_FOUNDNot found dataY
    405-Http request method not supportN
    409DUPLICATEData duplicateY
    415-Http request Media Type not supportN
    500UNKNOWNInternal server errorY

    2. Read API

    Request endpoint: “API_URL/read/v1”.

    2.1. Phone Number

    2.1.1. Search Available Number List

    Request

    Http MethodGET
    Path/availableNumber
    DescriptionYou 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 TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersnumberStringPhone numberOptional
    Query ParametersstatusList0: unassigned agent number 1: assigned agent number null: all numbers (contains unassigned phone number and assigned phone number)Optional
    Query ParameterscreateTypeStringISSUANCE or null: issuance number REGISTER: register numberOptional
    Query ParameterspageIntegerCurrent page, from 1.Optional
    Query ParameterssizeIntegerMax 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 TypeParameter nameData TypeDescriptionNullable
    Response BodypagedBooleanPaged or not
    contentListPage content
    idLongphone number id
    numberStringphone number
    channelIntegerCount of phone number’s channel count
    statusInteger[0]: unassigned agent number [1]: assigned aagent number
    descriptionStringPhone number descriptionY
    createdAtStringphone number create time
    updatedAtStringPhone number update time
    contactCenterIdLongContact Center ID
    createTypeStringISSUANCE: issued phone number REGISTER: registered phone number
    agentNameStringAssigned Agent NameY
    pageNumberIntegerCurrent Page Number
    totalCountLongTotal Count
    totalPagesIntegerTotal Pages
    pageSizeIntegerMax data elements count.
    sortBooleanSort 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 MethodGET
    Path/agent
    DescriptionYou can search agent by this API.

    Request Parameter

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersnameStringAgent nameOptional
    Query ParametersnumberStringAssigned phone numberOptional
    Query ParametersstatusInteger0: enabled agent. 1: disabled agent. null: search all agents.Optional
    Query ParametersallBooleantrue: all agents(undeleted and deleted agents). false: only undeleted agents. Default false.Optional
    Query ParameterspageIntegerCurrent page, from 1.Optional
    Query ParameterssizeIntegerMax 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 TypeParameter nameData TypeDescriptionNullable
    Response BodypagedBooleanPaged or not
    contentListPage content
    idLongAgent Id
    nameStringAgent name
    descriptionStringAgent descriptionY
    numberStringAssigned phone number
    csrSpeechLangStringLanguage config of CSR(a voice recognition service)
    cssVoiceLangStringLanguage config of CSS(a voice synthesis service)
    cssVoiceTypeStringVoice type of css
    cssVoiceDetailStringVoice detail config of CSS. It is json string contains the settings of volumn, please refer to response example.
    contactCenterIdLongContact Center ID
    chatbotDomainCodeStringChatbot domain code This filed is used to link “CLOVA Chatbot” service
    statusInteger0: enabled agent 1: disabled agent
    createdAtStringAgent create time
    updatedAtStringAgent update time
    channelIntegerChannel count of assigned phone number.
    pageNumberIntegerCurrent Page Number
    totalCountLongTotal Count
    totalPagesIntegerTotal Pages
    pageSizeIntegerMax data elements count.
    sortBooleanSort 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 MethodGET
    Path/campaign/target/{targetId}
    DescriptionYou can get campaign target detail information by this API.
    One campaign target could only assign to one campaign.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Path ParameterstargetIdLongCampaign target idRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired

    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 TypeParameter nameData TypeDescriptionNullable
    Response BodyidLongCampaign id
    nameStringCampaign target name
    descriptionStringCampaign descriptionY
    targetNumbersListCampaign target phone number list
    idLongTarget phone number id It auto-generated when you create campaign target.
    numberStringTarget phone number
    key1StringCustom information. Provided by user when create campaign target.Y
    key2StringCustom 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 MethodGET
    Path/campaign
    DescriptionYou can search campaign list by this API.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersnameStringCampaign nameOptional
    Query ParametersagentIdsListagentId listOptional
    Query ParameterstargetIdLongCampaign targetIdOptional
    Query ParametersstatusIntegerCampaign status.. 0: not ready 1: ready to run 2: stopped 3: completed 4: terminated 5: running 6: expired null: search all campaigns.Optional
    Query ParameterspageIntegerCurrent page, from 1.Optional
    Query ParameterssizeIntegerMax 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 TypeParameter nameData TypeDescriptionNullable
    Response BodypagedBooleanPaged or not
    contentListPage content
    idLongCampaign id
    nameStringCampaign name
    statusIntegerCampaign status

    0: not ready
    1: ready to run
    2: stopped
    3: completed
    4: terminated
    5: running
    6: expired
    createdAtStringCampaign create time
    updatedAtStringCampaign update time
    channelIntegerCount of channel.
    callerDisplayNumberStringRegistered phone number.Y
    agentJson ObjectAssigned agent information.
    idIntegerAgent id
    nameStringAgent name
    numberStringAgent phone number
    deletedAtStringIf agent is deleted, this is the delete time. Agent could be deleted after campaign completed.Y
    pageNumberIntegerCurrent page number
    totalCountLongTotal count
    totalPagesIntegerTotal pages
    pageSizeIntegerMax data elements count.
    sortBooleanSort 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 MethodGET
    Path/campaign/result/{campaignId}
    DescriptionYou can search campaign results by this API.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Path ParameterscampaignIdLongCampaign idRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersresultCodeIntegerResult codeOptional
    Query ParametersresultMessageStringResult messageOptional
    Query ParametersnumberStringCampaign target phone numberOptional
    Query ParameterspageIntegerCurrent page, from 1.Optional
    Query ParameterssizeIntegerMax 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 TypeParameter nameData TypeDescriptionNullable
    Response BodypagedBooleanPaged or not
    contentListPage content
    idLongResult id
    campaignIdLongCampaign id
    callerNumberStringCaller phone number. Campaign agent assign number.
    calleeNumberStringCallee phone number. Campaign target number.
    resultCodeIntegerResult codeY
    resultMessageStringResult messageY
    callTryTimeStringThe time to try calling to customer.Y
    callEndTimeStringEnd time of call.Y
    dialSequenceIntegerCurrent dial times. If set retry when create campaign, when call no response, will dial several times.Y
    createdAtStringThe time when send campaign targets to Hanmac
    updatedAtStringThe time when Hanmac callback to update call result
    key1StringCustom information of campaign target. Provided by user when create campaign target.
    key2StringCustom information of campaign target. Provided by user when create campaign target.
    pageNumberIntegerCurrent page Number
    totalCountLongTotal count
    totalPagesIntegerTotal pages
    pageSizeIntegerMax data elements count.
    sortBooleanSort or not. Currently we do not support sorting, you can ignore this field.

    Response example

    • Http Status: 200

    • Response Body

    Response example
    Http Status200
    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 MethodGET
    Path/campaign/call/stop/{callStopId}
    DescriptionYou can get one call stop request detail information.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Path ParameterscallStopIdLongCall Stop IDRequired
    Query ParameterscampaignIdLongCampaign IDRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired

    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 TypeParameter nameData TypeDescription
    Response BodycontactCenterIdLongContact Center ID
    campaignIdLongCampaign id
    targetNumbersListStop call target number list. Number,key1, key2 are combination condition.
    numberStringCampaign target phone number(length limit:4-20, start with 0 or 1)
    key1StringCustom information for number (length limit:0-10), just used to record custom information. Will response when get campaign target detail or get campaign result.
    key2StringCustom 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 MethodGET
    Path/campaign/call/stop/number/{campaignId}
    DescriptionYou can get all call stop numbers of campaign.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Path ParameterscampaignIdLongCampaign idRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParameterscallStopIdLongCall Stop IDOptional
    Query ParametersnumberStringCampaign target phone numberOptional
    Query Parameterskey1StringCustom information for numberOptional
    Query Parameterskey2StringCustom information for numberOptional
    Query ParameterspageIntegerCurrent page, from 1.Optional
    Query ParameterssizeIntegerMax 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 TypeParameter nameData TypeDescription
    Response BodypagedBooleanPaged or not
    contentListPage content. Stop call target numbers. Empty means no stop call number.
    callStopIdLongCampaign call stop id.
    campaignTargetNumberIdLongCampaign target phone number id.
    numberStringCampaign target phone number(length limit:4-20, start with 0 or 1)
    key1StringCustom information for number (length limit:0-10), just used to record custom information. Will response when get campaign target detail or get campaign result.
    key2StringCustom information for number (length limit:0-2), just used to record custom information. Will response when get campaign target detail or get campaign result.
    pageNumberIntegerCurrent page Number
    totalCountLongTotal count
    totalPagesIntegerTotal pages
    pageSizeIntegerMax data elements count.
    sortBooleanSort 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 MethodGET
    Path/dashboard/detail
    DescriptionYou can get detail info of dashboard.

    **Request Parameters **

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired

    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 TypeParameter nameData TypeDescription
    Response BodyagentCountIntegerThe number of agents in the contact center.
    phoneNumberCountIntegerThe number of phone numbers used in the contact center.
    channelCountIntegerThe number of channels used in the contact center.
    campaignCountIntegerThe 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 MethodGET
    Path/dashboard/chart
    DescriptionYou can get charts of dashboard.

    **Request Parameters **

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersagentIdLongAgent idRequired
    Query ParametersstartTimeStringStart time of statisticsRequired
    Query ParametersendTimeStringEnd time of statisticsRequired
    Query ParameterstypeString“SESSION_TIME”: Count the number of sessions “SESSION_COUNT”: Count the total duration of the sessionRequired

    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 TypeParameter nameData TypeDescription
    Response BodycontentListContent
    content.startTimeStringStart time of statistics
    content.count.LongCount according to type
    statsTypeString“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 MethodGET
    Path/dashboard/builder/chart
    DescriptionYou can get charts of dashboard. (Except for the url, this api is exactly the same as 2.5.2)

    **Request Parameters **

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersagentIdLongAgent idRequired
    Query ParametersstartTimeStringStart time of statisticsRequired
    Query ParametersendTimeStringEnd time of statisticsRequired
    Query ParameterstypeString“SESSION_TIME”: Count the number of sessions “SESSION_COUNT”: Count the total duration of the sessionRequired

    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 TypeParameter nameData TypeDescription
    Response BodycontentListContent
    content.startTimeStringStart time of statistics
    content.count.LongCount according to type
    statsTypeString“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 MethodGET
    Path/dashboard/channel
    DescriptionYou can get channel count of dashboard.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersstartTimeStringStart time of statisticsRequired
    Query ParametersendTimeStringEnd time of statisticsRequired

    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 TypeParameter nameData TypeDescription
    Response BodycontentListContent
    content.startTimeStringStart time of statistics
    content.count.LongCount according to statsType
    statsTypeString“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 MethodGET
    Path/dashboard/outbound/call-time
    DescriptionYou can count the time of outbound call

    **Request Parameters **

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersagentIdLongAgent idRequired
    Query ParametersstartTimeStringStart time of statistics, must begin with 00:00:00Required
    Query ParametersendTimeStringEnd time of statisticsRequired

    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 TypeParameter nameData TypeDescription
    Response BodymobileListContent of mobile phone statistics
    mobile.startTimeStringStart time of statistics
    mobile.count.LongCount the time of outbound call
    internetListContent of internet phone statistics
    internet.startTimeStringStart time of statistics
    internet.count.LongCount the time of outbound call
    telephoneListContent of telephone statistics
    telephone.startTimeStringStart time of statistics
    telephone.count.LongCount the time of outbound call
    statsTypeString“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 MethodPOST
    Path/campaign/target
    DescriptionYou can add Campaign target by this API. One campaign target could only assign to one campaign.

    **Request Parameters **

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Request BodynameStringCampaign target nameRequired
    descriptionStringCampaign target descriptionOptional
    targetNumbersListCampaign target phone number list(length limit <5000)Required
    numberStringCampaign target phone number(length limit:4-20, start with 0 or 1)Required
    key1StringCustom 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
    key2StringCustom 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 TypeParameter nameData TypeDescription
    Response BodyidLongCampaign target id

    Response example

    • Http Status: 200

    • Response Body

    {    
        "id": 62  
    }
    

    3.2. Campaign

    3.2.1. Create Campaign

    Request

    Http MethodPOST
    Path/campaign
    DescriptionYou can create campaign by this API.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Request BodynameStringCampaign nameRequired
    agentIdLongCampaign 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
    retryTimesIntegerRetry times(value limit:0<=retryTimes <=10) 0: no retryRequired
    scheduleFromDateStringyyyy-MM-ddRequired
    scheduleToDateStringyyyy-MM-ddRequired
    scheduleFromTimeStringHH:mmRequired
    scheduleToTimeStringHH:mmRequired
    targetIdLongCampaign target id. Could get it from response of “3.1.1 Create Campaign Target”.Required
    callerDisplayNumberIdLongA 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 TypeParameter nameData TypeDescription
    Response BodyidLongCampaign id

    Response example

    • Http Status: 200

    • Response Body

    {    
        "id": 62  
    }
    

    3.2.2. Update Campaign Status

    Request

    Http MethodPUT
    Path/campaign/status/{campaignId}
    DescriptionYou 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 TypeParameter nameData TypeDescriptionRequired
    Path ParameterscampaignIdLongCampaign idRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Query ParametersstatusIntegerCampaign status 1:start 2:stop 4:terminateRequired

    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 MethodPOST
    Path/campaign/call/stop
    DescriptionWhen you need stop dialing some specific target numbers in campaign, you can use this API.

    Request Parameters

    Parameter TypeParameter nameData TypeDescriptionRequired
    Query ParameterscontactCenterIdLongContact Center IDRequired
    Request BodycampaignIdLongCampaign idRequired
    targetNumbersListStop call target number list. Number, key1, key2 are combination condition. List size limit: 1~20.Required
    numberStringCampaign target phone number(length limit:4-20, start with 0 or 1)Required
    key1StringCustom 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
    key2StringCustom 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 TypeParameter nameData TypeDescription
    Response BodyidLongCall 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();
        }
    } 
     
    

    이 문서가 도움이 되었습니까?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.