API Reference – Marketing API – Add Contacts to Lists By Email Address

Marketing API Method Documentation

©2009-2017 SocketLabs, Inc., Version 1.0, Last Edit: November 05, 2017

PUT /lists/{listId}/contacts

Synopsis:

Adds a contact to a list.

Recommended Usage:

This PUT method allows you to easily add a contact to a contact list using an email address along with an optional collection of custom fields.

If the contact already exists (matching on the provided email address only), the existing contact will be added to the list. If the server has exceeded its max allowed number of contacts when trying to add a new contact, a 403 Forbidden response will be returned. If the provided email address is poorly formatted or missing, a 400 Bad Request response will be returned.

If the contact is already on the list the response will simply indicate a successful call.

Request Information

HTTP Method:

PUT

URL:

https://api.socketlabs.com/marketing/v1/lists/{listId}/contacts

Response Format Types:

JSON or XML

Request Parameters:

emailAddress
The contact’s email address.
listId
The contact list’s unique integer ID. To obtain the list ID see GET /marketing/v1/lists.
customFields
[optional] An array of name value pairs that contain custom field data. If you set a value for a custom field that does not exist for your server the call will fail. If the call omits any existing custom field values and the contact exists, the existing custom field values will remain unchanged.

Example Request:

PUT /marketing/v1/lists/123456/contacts HTTP/1.1
Host: api.socketlabs.com
Authorization: Basic XXXXXXXXXXXXXXXXXXXx==
Content-Type: application/json
Cache-Control: no-cache

{ 
    "emailAddress" : "[email protected]",
    "CustomFields":
    [
        {
          "Name":"Gender","Value":"Male"
        },
        {
          "Name":"FirstName","Value":"Joe"
        },
    ]
}

Response Parameters

serverId
Your server’s Id.
id
The contact’s unique integer Id.
listId
The contact list’s unique integer ID.

Response Examples

Example Response (JSON):

{
    "serverId": 6789,
    "contactId": 1234,
    "listId": 5678
}

Update Log

June 19, 2017

Customers Who Trust in SocketLabs

You’re in good company when working with SocketLabs. Here are some companies who have also trusted SocketLabs.

Why SocketLabs?

What Our Customers Are Saying!