API Reference – Marketing API – Add Contacts to Lists By Id

Marketing API Method Documentation

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

PUT /lists/{listId}/contacts/{contactId}

Synopsis:

Adds a contact to a list.

Recommended Usage:

This PUT method allows you to easily add a contact to a contact list by using a contact ID.

If both the contact and the list exist, the contact will be added to that list. Otherwise, a 404 Not Found will be returned indicating that either the list or the contact does not exist. 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/{contactId}

Response Format Types:

JSON or XML

Request Parameters:

id
The contact’s integer ID. If the contact ID does not exist for your server, will return a 404 Not Found result. Note that this is passed in the URL (see URL above).
listId
The contact list’s unique integer ID. To obtain the list ID see GET /marketing/v1/lists.

Example Request:

PUT /marketing/v1/lists/123/contacts/4567 HTTP/1.1
Host: api.socketlabs.com
Authorization: Basic XXXXXXXXXXXXXXXXXXXx==
Cache-Control: no-cache

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
}

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!