Campaign Contacts (REST API)

Version 1
    This document was generated from CDN thread

    Created by: Tom Tajic on 11-06-2013 02:58:23 AM
    I need some clarification on the following topics.

    a.       Add Contacts to Campaign (http://<server>:<port>/adminapi/campaign/{id}/contacts). In the documentation there is only Success Result xml description. Is there also a >>Failed Result<< xml? We would need to get the contacts that were not inserted into dialinglist, so that we that customer will be able to repair the data and retry the import.

    b.      Delete All Contacts from Campaign (http://<server>:<port>/adminapi/campaign /{id}/contacts). Does this action acutaly delete the contacts from dialinglist table (db) or are the contacts only marked as "disabled/not active"?

    c.       Add Contacts to Campaign. Can you please specifiy what are the validation rules (RegEx, ...) for inserting contacts into dialing list, so we can eliminate "bad contacts" before we actually prepare CSV for insertion into dialinglist.

    Thank you for your help,
    Tom Tajić

    Subject: RE: Campaign Contacts (REST API)
    Replied by: Siddachetty Mahesh on 22-10-2013 01:57:16 AM
    Hi Tom,

    Given input:
     1 <campaignContacts>
     2    <campaign name="camp1">
     3        <refURL>http://10.78.91.77:8080/adminapi/campaign/2</refURL>
     4    </campaign>    <csvdata>
     5        Account Number, First Name, Last Name,Phone1, Phone2, Phone3, Dial Time       
     6        AAAA, John, Doe, 1001, 1002, 1003, 11:11
     7        BBBB, Jane, Doe, 2001, a2002, 2003, 11:12
     8        CCCC, Jim, Doe, 3001, 3002, 3003, 71:12
     9        AAAA, John, Doe, 1001, 1002, 1003, 11:11
    10    </csvdata>
    11</campaignContacts>

    Error reposnse will be:
     1<campaignContacts>
     2    <campaign name="camp1">
     3        <refURL>http://10.78.91.77:8080/adminapi/campaign/2</refURL>
     4    </campaign>
     5    <csvdata>
     6*** FOLLOWING RECORDS HAD ERRORS/DUPLICATE AND WERE NOT INSERTED ***
     7AAAA, John, Doe, 1001, 1002, 1003, 11:11
     8*** FOLLOWING RECORDS WERE INSERTED BY IGNORING BAD DATA IN THE FOLLOWING FIELD(s) : [ phone2, phone3, dial time ] ***
     9Contact record(BBBB, Jane, Doe, 2001, a2002, 2003, 11:12) with invalid phone2 value(a2002) imported with blank phone2 field
    10Contact record(CCCC, Jim, Doe, 3001, 3002, 3003, 71:12) with invalid dial time value(71:12) imported with blank dial time field
    11    </csvdata>
    12</campaignContacts>

    Deleting all contacts just marks them as inactive in the database. 

    Validation are as follows:
    1. Phone1 must be specified
    2. headers must be specified in the csvdata section - and only the supported headers (as per XSD) are allowed.
    3. Valid phone numbers are "^[0-9]+"
    4. Valid dial time (if specified) is 00:00 to 23:59.
    5. Max of 1 million (1,000,000) active contacts are allowed per campaign. If the import will cause this threshold to exceed, the import will fail.
    Hope this clarifies,
    Mahesh