Newsletters API — Signup


This method will sign a user up to one or more Condé Nast Newsletters. This endpoint expects a JSON payload which describes the user to be signed up, which newsletters (if any) they wish to be signed up to, as well as a couple of other marketing preferences.


Definition

POST https://newsletters.api.condenet.co.uk/signup

Response

On success, the endpoint will return a 200 OK. On error, it will return a 400 Bad Request


JSON Payload

You must send a JSON payload (in the request body) to this endpoint, and you must also specify a content-type of application/json.

Key Value / Description type Required
email Must be set to a valid email address, e.g., jane.smith@gmail.com string (email address) Yes
cn_site If supplied, must be set to a valid Condé Nast brand abbreviation, e.g., vg for Vogue, or woi for World Of Interiors.

See the Brands API - Abbreviations for a full set of abbreviations.
string No
newsletters A list of newsletters to sign the user up to.

See the newsletters section below for more information
list of strings No
optin_condenast Opt the user into Condé Nast marketing. If not set, defaults to false. boolean No
optin_thirdparty Opt the user into third party marketing. If not set, defaults to false. boolean No

Example JSON payload

Below is an example JSON payload which must be sent as the body of your POST request.

{
    "email": "me@myISP.com",
    "cn_site": "gq",
    "newsletters": ["gq"],
    "optin_condenast": true,
    "optin_thirdparty": false
}

Newsletters

Below is a table describing the possible newsletter names/values which can be used to sign a user up to certain newsletters. One or more of these values can be used in the newsletters key in the JSON payload.

Value Description
glamour-daily-celebrity-news Glamour's daily celebrity news newsletter
glamour-daily-features Glamour's daily features newsletter
glamour-weekly-competitions Glamour's weekly competition newsletter
gq GQ's newsletter
houseandgarden House and Garden's newsletter
tatler Tatler's newsletter
traveller Traveller's newsletter
vogue-daily Vogue's daily newsletter
vogue-weekly Vogue's weekly newsletter
vogue-monthly Vogue's monthly newsletter
vogue-breaking Vogue's breaking news newsletter
wired Wired's newsletter
woi The World of Interior's newsletter
brides Brides' Newsletter
vanityfair-alist VanityFair's A List newsletter
johansens-vip Johansens VIP Club Newsletter

Examples

Below are a series of example requests. Here we're mostly showing examples using CURL on the command line for clarity, but have also included a PHP example as many agencies we work with tend to use PHP as their back-end technology. You can of course use any HTTP library you like to communicate with our Newsletters API.

Example request 1 (curl)

The request shown below signs a user up to Vogue's default newsletter, opting them into Condé Nast marketing, but not opting them into third party marketing.

$ curl https://newsletters.api.condenet.co.uk/signup \
-X POST \
-H 'Content-type: application/json' \
--data '{ \
 "email": "you@wherever.com", \
 "cn_site": "vg", \
 "optin_condenast": true, \
 "optin_thirdparty": false \
}'

Example request 2 (curl)

The below request signs a user up and opts them into Vogue's breaking and weekly newsletter, as well as Condé Nast marketing.

$ curl https://newsletters.api.condenet.co.uk/signup \
-X POST \
-H 'Content-type: application/json' \
--data '{ \
 "email": "you@wherever.com", \
 "cn_site": "vg", \
 "newsletters": ["vogue-breaking", "vogue-weekly"], \
 "optin_condenast": true, \
}'

Example PHP request

Here's an example using PHP and CURL. This request signs a user up to World Of Interior's newsletter.

<?php

// define the payload which we will later encode as JSON
$data = array(
	'email'            => 'you@wherever.com',    // the user's email address
	'cn_site'          => 'woi',                 // woi is the site of origin
	'newsletters'      => array('woi'),          // woi is the World of Interiors Newsletter. note, this is always a list (array)
	'optin_condenast'  => false,                 // set this to true or false depending upon what the user wants
	'optin_thirdparty' => false                  // set this to true or false depending upon what the user wants
);

// encode our payload as JSON
$json_payload = json_encode($data);

// create a CURL request object
$request = curl_init('https://newsletters.api.condenet.co.uk/signup');

// set this request to use the HTTP POST method
curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST");

// set the payload as the body of the request
curl_setopt($request, CURLOPT_POSTFIELDS, $json_payload);

// tell curl we want to capture the response
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);

// set the Content-Type and Content-Length headers
curl_setopt($request, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($json_payload))
);

// execute the request
$response = curl_exec($request);

Example response

{
  "success': true,
  "contact": {
    "id": 123456
  }
}