Legacy Dev Forum Posts

 View Only

Sign Up

Add contact to contactlist via API

  • 1.  Add contact to contactlist via API

    Posted 06-05-2025 18:24

    tmill | 2023-01-05 07:24:17 UTC | #1

    I am trying to add a contact via the API ( /api/v2/outbound/contactlists/{contactListId}/contacts). But stuck at this error

    { "message": "The contact columns do not match what is required in the list", "code": "invalid.contact.columns", "status": 400, "messageWithParams": "The contact columns do not match what is required in the list", "messageParams": { "columnName": "[lastName, firstName, mobilePhone, homePhone, email, insuranceType, InsuranceCarrier, insuranceId, address, address2, city, state, zip]" }, "contextId": "contextID", "details": [], "errors": [] }

    I am testing with the following curl request

    curl --location --request POST 'https://api.usw2.pure.cloud/api/v2/outbound/contactlists/contactListId/contacts' \ --header 'Authorization: Bearer myToken' \ --header 'Content-Type: application/json' \ --data-raw '[ { "id": "", "contactListId": contactListId, "data": { "lastName": "Doe", "firstName": "John", "mobilePhone": "1111111111", "homePhone": "1111111111", "email": "test@email.com", "insuranceType": "", "InsuranceCarrier": "", "insuranceId": "", "address": "", "address2": "", "city": "", "state": "", "zip": "" }, "callable": true, "phoneNumberStatus": { "mobilePhone": {"callable": true}, "homePhone": {"callable": true} } } ] '

    Sample data via csv upload looks like

    lastName,firstName,mobilePhone,homePhone,email,insuranceType,InsuranceCarrier,insuredId,address,address2,city,state,zip Doe,John,11111111111,2222222222,test@email.com,some,blah,12345,123,Some St,New York,NY,12345


    Jerome.Saint-Marc | 2023-01-05 12:52:25 UTC | #2

    Hello,

    One of your attribute name is incorrect (in the curl request). Having a look the column names you defined in your csv, you created an "insuredId" column. In the curl request, you have used "insuranceId" as attribute name - it must be "insuredId".

    Regards,


    tmill | 2023-01-05 12:51:36 UTC | #3

    Hello, thanks. That was it, it is working now. Sorry, I should of caught that.

    Thanks


    system | 2023-02-05 12:52:08 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 17855