Append Contacts To List
Using the SDK
// Download the helper library from https://www.npmjs.com/package/dropcowboy
const { DropCowboy } = require("dropcowboy"); // Or, for ESM: import { DropCowboy } from "dropcowboy";
// Find your Team ID and Secret at dropcowboy.com/appv1/#/api
// and set the environment variables.
const teamId = process.env.DROPCOWBOY_TEAM_ID;
const secret = process.env.DROPCOWBOY_SECRET;
const client = new DropCowboy({ teamId: teamId, secret: secret });
async function addContactstToList(listId) {
const list = await client.appendContactsToList(listId, {
fields: ["first_name", "email", "phone"],
values: [
["hunter", "hunter@email.com", "+15552223333"],
["john", "john@email.com", "+15554446666"]
]
});
console.log(list);
};
addContactstToList("00000000-0000-0000-0000-000000000000");API Endpoint
Example Request
Required Headers
Required URL Path Parameters
Required Body Parameters
Optional Body Parameters
Requires two headers: x-team-id and x-secret. Both must be sent with each request.
Array of strings that define the data types being passed in the Values attribute. It is acceptable to have repeat field types specified if your contacts have multiple phone numbers, pass in the value of “phone” multiple times in this array. Possible field types are: record_id, first_name, last_name, company, email, phone, address1, address2, city, state, postal, country, custom1, custom2, custom3, custom4, custom5. (Required)
The ISO country code to use when converting your phone number values to E.164 format. If yourphone numbers are already formatted in E.164 then the region attribute is ignored. Defaults to US.
Returns accepted_count and rejected details.
The number of contacts appended to the list.
Returns accepted_count and rejected details.
Example Response
Last updated
Was this helpful?