AnsweredAssumed Answered

How to create campaign in CCX through rest API's

Question asked by Ehtasham123 on Aug 31, 2015
Latest reply on Sep 3, 2015 by vdheenad

I want to create a campaign through java language with the help of CCX rest API's. I have all the configuration right but somehow i am receiving 400 bad request error. Though i have send same request with same parameter through poster and it work perfectly fine.

 

Campaign campaign = new Campaign();

        campaign.setCampaignName("Agentbasefromcode");

        campaign.setDescription("Sample Campaign");

        campaign.setEnabled(true);

        campaign.setStartTime("00:00");

        campaign.setEndTime("23-59");

        campaign.setTimeZone("India Standard Time");

        campaign.setCampaignType("AGENT");

        campaign.setDialerType("DIRECT_PREVIEW");

        campaign.setPendingContacts(0);

 

       ObPreviewInfo obPreviewInfo=new ObPreviewInfo();

        obPreviewInfo.setMaxDialAttempts(3);

        obPreviewInfo.setCacheSize(20);

        obPreviewInfo.setAnsMachineRetry(false);

        obPreviewInfo.setCallbackTimeLimit(15);

        obPreviewInfo.setMissedCallbackAction("NEXT_DAY");

 

        NameUriPair applicationTrigger = new NameUriPair();

        applicationTrigger.setName("5");

        applicationTrigger.setRefURL("https://192.168.200.200:8443/adminapi/csq/5");

 

        CsqList csqList=new CsqList();

 

        csqList.getCsq().add(applicationTrigger);

        obPreviewInfo.setAssignedCSQs(csqList);

        CampaignTypeSpecificInfo specificInfo = new CampaignTypeSpecificInfo();

        specificInfo.setObPreview(obPreviewInfo);

        campaign.setTypeSpecificInfo(specificInfo);

wr.accept("Text/xml").entity(campaign, "Text/xml").post();

 

I am getting this error .

 

Capture.PNG

 

a quick help is much appreciated.

Outcomes