### Authenticating with API Key (GET Clients) Source: https://www.campaignmonitor.com/api/v3-3/getting-started Demonstrates how to authenticate API requests using an API key with HTTP Basic Authentication. This example shows how to retrieve a list of clients in JSON format using both a web browser and cURL. ```APIDOC ## GET /api/v3.3/clients.json ### Description Retrieves a list of all clients associated with your Campaign Monitor account in JSON format. Authentication is performed using your API key as the username with HTTP Basic Authentication. ### Method GET ### Endpoint `https://api.createsend.com/api/v3.3/clients.json` ### Parameters #### Query Parameters - **pretty** (boolean) - Optional - Formats the JSON output for better readability. ### Request Example (Browser) `https://api.createsend.com/api/v3.3/clients.json` *(When prompted, enter your API key as the username and a blank or dummy value as the password.)* ### Request Example (cURL) ```bash curl -u "YOUR_API_KEY:x" https://api.createsend.com/api/v3.3/clients.json?pretty=true ``` ### Response #### Success Response (200) - **ClientID** (string) - The unique identifier for the client. - **Name** (string) - The name of the client. #### Response Example ```json [ { "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122", "Name": "Client One" }, { "ClientID": "a206def0582eec7dae47d937a4109cb2", "Name": "Client Two" } ] ``` ``` -------------------------------- ### Campaign Monitor API Pretty Formatting Example Source: https://www.campaignmonitor.com/api/v3-2/getting-started This example demonstrates how to enable human-readable output in the Campaign Monitor API by appending `pretty=true` to the query string of a request. It shows the difference in response formatting with and without the parameter. ```http https://api.createsend.com/api/v3.2/clients.json ``` ```json [{"ClientID":"4a397ccaaa55eb4e6aa1221e1e2d7122","Name":"Client One"},{"ClientID":"a206def0582eec7dae47d937a4109cb2","Name":"Client Two"}] ``` ```http https://api.createsend.com/api/v3.2/clients.json?pretty=true ``` ```json [ { "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122", "Name": "Client One" }, { "ClientID": "a206def0582eec7dae47d937a4109cb2", "Name": "Client Two" } ] ``` -------------------------------- ### cURL Example: Get Clients API Call Source: https://www.campaignmonitor.com/api/v3-3/getting-started This cURL command shows how to fetch a list of clients from the Campaign Monitor API using an access token. It includes the necessary Authorization header and the API endpoint. ```bash curl -H "Authorization: Bearer MDRmODIzNTBhODQ1ZWU5ZDkz" https://api.createsend.com/api/v3.3/clients.json?pretty=true ``` -------------------------------- ### API Response Example: List of Clients Source: https://www.campaignmonitor.com/api/v3-3/getting-started This is an example of a JSON response from the Campaign Monitor API when retrieving a list of clients. It includes the ClientID and Name for each client. ```json [{"ClientID":"4a397ccaaa55eb4e6aa1221e1e2d7122","Name":"Client One"},{"ClientID":"a206def0582eec7dae47d937a4109cb2","Name":"Client Two"}] ``` -------------------------------- ### Send Smart Email Request Example Source: https://www.campaignmonitor.com/api/v3-2/transactional This example demonstrates the structure of a POST request to send a smart email. It includes recipients, optional CC/BCC, attachments, and custom data. The 'ConsentToTrack' field controls recipient tracking preferences. ```http POST https://api.createsend.com/api/v3.2/transactional/smartEmail/{:smartEmailID}/send Content-Type: application/json; charset=utf-8 { "To": [ "Joe Smith ", "jamesmith@example.com" ], "CC": null, "BCC": [ "joesmith@example.com" ], "Attachments": [ { "Content": "base64encoded", "Name": "Invoice.pdf", "Type": "application/pdf" } ], "Data": { "new_password_url": "https://mywebapp.com/newpwd?uid=jguf45h74gf", "username": "joesmith1" }, "AddRecipientsToList": true, "ConsentToTrack": "Yes" } ``` -------------------------------- ### Make API Call with Bearer Token (cURL Example) Source: https://www.campaignmonitor.com/api/v3-2/getting-started This example shows how to authenticate an API request by passing the OAuth access token as a Bearer token in the Authorization header. It uses cURL to fetch a list of clients from the Campaign Monitor API. The request includes the necessary Authorization header and the target API endpoint. ```shell curl -H "Authorization: Bearer MDRmODIzNTBhODQ1ZWU5ZDkz" https://api.createsend.com/api/v3.2/clients.json?pretty=true ``` -------------------------------- ### Transactional Smart Email Listing Response Example - JSON Source: https://www.campaignmonitor.com/api/v3-2/transactional Example JSON response for the transactional smart email listing endpoint. It includes the ID, Name, Creation Timestamp, and Status for each smart email found. ```json [ { "ID": "fg84jd3vbask48fjh59dnfls", "Name": "Welcome email", "CreatedAt": "2014-01-15T16:09:19-05:00", "Status": "Active" }, ... ] ``` -------------------------------- ### Getting Templates Source: https://www.campaignmonitor.com/api/v3-3/clients Retrieves a list of templates belonging to a specific client, including their ID, name, and preview URLs. ```APIDOC ## GET /api/v3.3/clients/{clientid}/templates.{xml|json} ### Description Contains a list of the templates belonging to the client including the ID, name and a URL for a screenshot and HTML preview of the template. ### Method GET ### Endpoint `https://api.createsend.com/api/v3.3/clients/{clientid}/templates.{xml|json}` ### Parameters #### Path Parameters - **clientid** (string) - Required - The ID of the client for which templates should be retrieved. ### Response #### Success Response (200) Returns an array of template objects (JSON) or a `` element (XML). - **TemplateID** (string) - The unique identifier for the template. - **Name** (string) - The name of the template. - **PreviewURL** (string) - A URL for an HTML preview of the template. - **ScreenshotURL** (string) - A URL for a screenshot of the template. ### Response Example (JSON) ```json [ { "TemplateID": "5cac213cf061dd4e008de5a82b7a3621", "Name": "Template One", "PreviewURL": "https://preview.createsend.com/templates/publicpreview/01AF532CD8889B33?d=r", "ScreenshotURL": "https://preview.createsend.com/ts/r/14/833/263/14833263.jpg?0318092541" } ] ``` ### Response Example (XML) ```xml ``` ``` -------------------------------- ### Send Smart Email Response Example Source: https://www.campaignmonitor.com/api/v3-2/transactional This example shows the expected '202 Accepted' response when a smart email is successfully sent. The response is an array, with each element containing the status, a unique MessageID, and the recipient's email address. ```json [ { "Status": "Accepted", "MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd", "Recipient": "Joe Smith " }, ... ] ``` -------------------------------- ### GET /clients.xml Source: https://www.campaignmonitor.com/api/v3-2/getting-started Retrieves a list of clients in XML format. The Content-Type header will be application/xml; charset=utf-8. ```APIDOC ## GET /api/v3.2/clients.xml ### Description Retrieves a list of clients in XML format. ### Method GET ### Endpoint https://api.createsend.com/api/v3.2/clients.xml ### Parameters None ### Request Example None ### Response #### Success Response (200) - **ClientID** (string) - The unique identifier for the client. - **Name** (string) - The name of the client. #### Response Example ```xml 4a397ccaaa55eb4e6aa1221e1e2d7122 Client One a206def0582eec7dae47d937a4109cb2 Client Two ``` ``` -------------------------------- ### Transactional Smart Email Details Response Example - JSON Source: https://www.campaignmonitor.com/api/v3-2/transactional Example JSON response detailing a specific transactional smart email. It includes ID, creation date, status, name, and properties such as sender, reply-to, subject, content, and preview URLs. It also indicates the list ID for adding recipients. ```json HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "SmartEmailID": "c475db61-665e-11eb-b2b7-51b1f4471faa", "CreatedAt": "2014-01-15T16:09:19-05:00", "Status": "Active", "Name": "Welcome email", "Properties": { "From": "Hello ", "ReplyTo": "mike@webapp123.com", "Subject": "Thanks for signing up to web app 123", "Content": { "Html": "...", "Text": "...", "EmailVariables": [ "username", "user_id" ], "InlineCss": true }, "TextPreviewUrl": "http://siteaddress.createsend.com/path/text/preview", "HtmlPreviewUrl": "http://siteaddress.createsend.com/path/html/preview" }, "AddRecipientsToList": "62eaaa0338245ca68e5e93daa6f591e9" } ``` -------------------------------- ### Creating a Client (POST) Source: https://www.campaignmonitor.com/api/v3-3/getting-started Shows how to create a new client using the API. You can specify the input data format as either XML or JSON. ```APIDOC ## POST /api/v3.2/clients ### Description Creates a new client within your Campaign Monitor account. You can specify the input data format by appending `.xml` or `.json` to the endpoint. ### Method POST ### Endpoint `https://api.createsend.com/api/v3.2/clients.[xml|json]` ### Parameters #### Request Body (XML) - **Client** (object) - Required - Contains client details. - **CompanyName** (string) - Required - The company name for the client. - **ContactName** (string) - Required - The contact person's name. - **EmailAddress** (string) - Required - The contact person's email address. - **TimeZone** (string) - Required - The client's time zone. - **Country** (string) - Required - The client's country. ### Request Example (XML) ```xml Client Company Three Client Three client3@example.com (GMT+10:00) Canberra, Melbourne, Sydney Australia ``` #### Request Body (JSON) - **CompanyName** (string) - Required - The company name for the client. - **ContactName** (string) - Required - The contact person's name. - **EmailAddress** (string) - Required - The contact person's email address. - **TimeZone** (string) - Required - The client's time zone. - **Country** (string) - Required - The client's country. ### Request Example (JSON) ```json { "CompanyName": "Client Company Three", "ContactName": "Client Three", "EmailAddress": "client3@example.com", "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney", "Country": "Australia" } ``` ### Response #### Success Response (200) *The response body will be the created client object.* ``` -------------------------------- ### Get Campaign Monitor Countries List (XML) Source: https://www.campaignmonitor.com/api/v3-2/account Fetches a list of all valid countries accepted by the Campaign Monitor API in XML format. This information is vital for client creation and account setup processes that require country input. The response is an XML structure containing country names. ```xml HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 Afghanistan Albania Algeria American Samoa etc... ``` -------------------------------- ### Create Client using XML Input Format Source: https://www.campaignmonitor.com/api/v3-3/getting-started Shows how to create a new client via the Campaign Monitor API using XML as the input data format. This involves sending an HTTP POST request with the client details enclosed in XML tags in the request body. ```xml Client Company Three Client Three client3@example.com (GMT+10:00) Canberra, Melbourne, Sydney Australia ``` -------------------------------- ### Create Client using JSON Input Format Source: https://www.campaignmonitor.com/api/v3-3/getting-started Illustrates how to create a new client via the Campaign Monitor API using JSON as the input data format. This involves sending an HTTP POST request with the client details formatted as a JSON object in the request body. ```json HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "CompanyName": "Client Company Three", "ContactName": "Client Three", "EmailAddress": "client3@example.com", "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney", "Country": "Australia" } ``` -------------------------------- ### RuleGroup Collection Example in JSON Source: https://www.campaignmonitor.com/api/v3-2/segments Example of a RuleGroup collection in JSON format. This structure is used as input for creating or updating segments, and as output when retrieving segment details. It allows for complex filtering criteria by grouping multiple rules. ```json { "RuleGroups": [ { "Rules": [ { "RuleType": "EmailAddress", "Clause": "CONTAINS @domain.com" } ] }, { "Rules": [ { "RuleType": "DateSubscribed", "Clause": "AFTER 2009-01-01" }, { "RuleType": "DateSubscribed", "Clause": "EQUALS 2009-01-01" } ] }, { "Rules": [ { "RuleType": "DateSubscribed", "Clause": "BEFORE 2010-01-01" } ] }, { "Rules": [ { "RuleType": "[Frequency]", "Clause": "NOT_EQUALS Emergency Only" } ] }, { "Rules": [ { "RuleType": "CampaignOpened", "Clause": "1234123412341234" }, { "RuleType": "CampaignOpened", "Clause": "abcdabcdabcdabcd" } ] } ] } ``` -------------------------------- ### Create Client using JSON Input Format Source: https://www.campaignmonitor.com/api/v3-2/getting-started This snippet demonstrates how to create a client using JSON as the input data format. It involves sending an HTTP POST request to the clients endpoint with a JSON payload in the request body, specifying the content type as application/json. ```json { "CompanyName": "Client Company Three", "ContactName": "Client Three", "EmailAddress": "client3@example.com", "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney", "Country": "Australia" } ``` -------------------------------- ### Creating a Client Source: https://www.campaignmonitor.com/api/v3-2/getting-started This endpoint allows you to create a new client in your Campaign Monitor account. You can specify the input data format as either XML or JSON. ```APIDOC ## Creating a Client ### Description Creates a new client in your Campaign Monitor account. Supports both JSON and XML input formats. ### Method POST ### Endpoint - `https://api.createsend.com/api/v3.2/clients.xml` (for XML input) - `https://api.createsend.com/api/v3.2/clients.json` (for JSON input) ### Parameters #### Request Body (XML) - **CompanyName** (string) - Required - The company name for the client. - **ContactName** (string) - Required - The contact name for the client. - **EmailAddress** (string) - Required - The email address for the client. - **TimeZone** (string) - Required - The time zone for the client (e.g., "(GMT+10:00) Canberra, Melbourne, Sydney"). - **Country** (string) - Required - The country for the client. ### Request Example (XML) ```xml Client Company Three Client Three client3@example.com (GMT+10:00) Canberra, Melbourne, Sydney Australia ``` #### Request Body (JSON) - **CompanyName** (string) - Required - The company name for the client. - **ContactName** (string) - Required - The contact name for the client. - **EmailAddress** (string) - Required - The email address for the client. - **TimeZone** (string) - Required - The time zone for the client (e.g., "(GMT+10:00) Canberra, Melbourne, Sydney"). - **Country** (string) - Required - The country for the client. ### Request Example (JSON) ```json { "CompanyName": "Client Company Three", "ContactName": "Client Three", "EmailAddress": "client3@example.com", "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney", "Country": "Australia" } ``` ### Response #### Success Response (200) Returns the created client details, including the `ClientID`. #### Response Example (JSON) ```json { "ClientID": "newly_generated_client_id", "Name": "Client Company Three", "CompanyName": "Client Company Three", "ContactName": "Client Three", "EmailAddress": "client3@example.com", "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney", "Country": "Australia" } ``` ``` -------------------------------- ### Get Client Templates (JSON/XML) Source: https://www.campaignmonitor.com/api/v3-3/clients Retrieves a list of templates associated with a client. Returns template details including ID, name, and URLs for previews. The client ID is required in the URL. ```json GET https://api.createsend.com/api/v3.3/clients/{clientid}/templates.json ``` ```xml GET https://api.createsend.com/api/v3.3/clients/{clientid}/templates.xml ``` -------------------------------- ### Get Client List via API (JSON) Source: https://www.campaignmonitor.com/api/v3-3/getting-started Retrieve a list of clients from the Campaign Monitor API in JSON format. This involves making an HTTP GET request to the '/clients.json' endpoint. The response will be in JSON, detailing client IDs and names, with a Content-Type of 'application/json; charset=utf-8'. ```HTTP GET https://api.createsend.com/api/v3.2/clients.json ``` ```JSON HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 [ { "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122", "Name": "Client One" }, { "ClientID": "a206def0582eec7dae47d937a4109cb2", "Name": "Client Two" } ] ``` -------------------------------- ### Creating a list Source: https://www.campaignmonitor.com/api/v3-2/lists Creates a new list into which subscribers can be added or imported. This endpoint allows setting the list title, landing pages, confirmation settings, and unsubscribe settings. ```APIDOC ## POST /api/v3.2/lists/{clientid}.{xml|json} ### Description Creates a new list into which subscribers can be added or imported. Set the list title, landing pages, confirmation setting, and unsubscribe setting. Unsubscribe setting must be either `AllClientLists` or `OnlyThisList`. ### Method POST ### Endpoint `https://api.createsend.com/api/v3.2/lists/{clientid}.{xml|json}` ### Parameters #### Path Parameters - **clientid** (string) - Required - The ID of the client. - **xml|json** (string) - Required - Specifies the response format. #### Request Body - **Title** (string) - Required - The title of the list. - **UnsubscribePage** (string) - Optional - The URL of the unsubscribe page. - **UnsubscribeSetting** (string) - Required - The unsubscribe setting. Must be either `AllClientLists` or `OnlyThisList`. - **ConfirmedOptIn** (boolean) - Optional - Whether confirmed opt-in is enabled. - **ConfirmationSuccessPage** (string) - Optional - The URL of the confirmation success page. ### Request Example ```json { "Title": "Website Subscribers", "UnsubscribePage": "http://www.example.com/unsubscribed.html", "UnsubscribeSetting": "AllClientLists", "ConfirmedOptIn": false, "ConfirmationSuccessPage": "http://www.example.com/joined.html" } ``` ### Response #### Success Response (201 Created) - **string** (string) - The ID of the newly created list. #### Response Example ```json "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1" ``` ##### Error responses: - **250: Duplicate list title** Cannot create a list with the same title as another. - **251: List Title Empty** The list title cannot be empty. - **261: Invalid List Unsubscribe Setting** Invalid unsubscribe setting. Unsubscribe setting must be either AllClientLists or OnlyThisList. ``` -------------------------------- ### Get Client List via API (XML) Source: https://www.campaignmonitor.com/api/v3-3/getting-started Retrieve a list of clients from the Campaign Monitor API in XML format. This involves making an HTTP GET request to the '/clients.xml' endpoint. The response will be in XML, detailing client IDs and names, with a Content-Type of 'application/xml; charset=utf-8'. ```HTTP GET https://api.createsend.com/api/v3.2/clients.xml ``` ```XML 4a397ccaaa55eb4e6aa1221e1e2d7122 Client One a206def0582eec7dae47d937a4109cb2 Client Two ``` -------------------------------- ### RuleGroup Collection Example in XML Source: https://www.campaignmonitor.com/api/v3-2/segments Example of a RuleGroup collection in XML format. This structure mirrors the JSON representation and is used for segment management within the Campaign Monitor API. It defines rules for filtering subscribers based on various criteria. ```xml CONTAINS @domain.com EmailAddress AFTER 2009-01-01 DateSubscribed EQUALS 2009-01-01 DateSubscribed BEFORE 2010-01-01 DateSubscribed NOT_EQUALS Emergency Only [Frequency] 1234123412341234 CampaignOpened abcdabcdabcdabcd CampaignOpened ``` -------------------------------- ### GET /clients.json Source: https://www.campaignmonitor.com/api/v3-2/getting-started Retrieves a list of clients in JSON format. The Content-Type header will be application/json; charset=utf-8. ```APIDOC ## GET /api/v3.2/clients.json ### Description Retrieves a list of clients in JSON format. ### Method GET ### Endpoint https://api.createsend.com/api/v3.2/clients.json ### Parameters None ### Request Example None ### Response #### Success Response (200) - **ClientID** (string) - The unique identifier for the client. - **Name** (string) - The name of the client. #### Response Example ```json [ { "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122", "Name": "Client One" }, { "ClientID": "a206def0582eec7dae47d937a4109cb2", "Name": "Client Two" } ] ``` ``` -------------------------------- ### Import Subscribers via API (JSON) Source: https://www.campaignmonitor.com/api/v3-2/subscribers This snippet demonstrates how to import multiple subscribers into a Campaign Monitor list using the API with JSON format. It includes examples of setting email addresses, names, mobile numbers, custom fields (including multi-valued ones and clearing values), consent to track, and SMS consent. Existing subscribers will have their details updated. ```json HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Subscribers": [ { "EmailAddress": "subscriber1@example.com", "Name": "New Subscriber One", "MobileNumber": "+8012398752", "CustomFields": [ { "Key": "website", "Value": "http://example.com" }, { "Key": "interests", "Value": "magic" }, { "Key": "interests", "Value": "romantic walks" }, { "Key": "age", "Value": "", "Clear": true } ], "ConsentToTrack": "Yes", "ConsentToSendSms": "Yes" }, { "EmailAddress": "subscriber2@example.com", "Name": "New Subscriber Two", "MobileNumber": "+80-(123)-98754", "ConsentToTrack": "No", "ConsentToSendSms": "No" }, { "EmailAddress": "subscriber3@example.com" } ] } ``` -------------------------------- ### Example Campaign HTML Structure Source: https://www.campaignmonitor.com/api/v3-3/campaigns This HTML represents a sample campaign generated from a template using the Campaign Monitor API. It illustrates how singleline, multiline, image, and repeater content are rendered within the campaign's structure, including links and image attributes. ```HTML My Template

This is a heading

This is example

multiline content...

This is alt text for an image

This is a repeater heading

This is example

multiline content...

This is alt text for a repeater image

Unsubscribe

``` -------------------------------- ### GET /api/v3.2/clients.json Source: https://www.campaignmonitor.com/api/v3-3/getting-started Retrieves a list of clients in JSON format. The Content-Type header will be 'application/json; charset=utf-8'. ```APIDOC ## GET /api/v3.2/clients.json ### Description Retrieves a list of clients in JSON format. ### Method GET ### Endpoint https://api.createsend.com/api/v3.2/clients.json ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **ClientID** (string) - The unique identifier for the client. - **Name** (string) - The name of the client. #### Response Example ```json [ { "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122", "Name": "Client One" }, { "ClientID": "a206def0582eec7dae47d937a4109cb2", "Name": "Client Two" } ] ``` ``` -------------------------------- ### Setting PAYG Billing Source: https://www.campaignmonitor.com/api/v3-3/clients Configure Pay-As-You-Go billing for a client. This allows clients to pay for their own campaigns, design, and spam tests. You can set markup percentages and whether the client can purchase their own email credits. ```APIDOC ## PUT /api/v3.3/clients/{clientid}/setpaygbilling.{xml|json} ### Description Set if a client can pay for their own campaigns and design and spam tests using our PAYG billing. Set the mark-up percentage on each type of fee, and if the client can purchase their own email credits to access bulk discounts. ### Method PUT ### Endpoint `https://api.createsend.com/api/v3.3/clients/{clientid}/setpaygbilling.{xml|json}` ### Parameters #### Path Parameters - **clientid** (string) - Required - The ID of the client for which PAYG billing settings should be set. #### Query Parameters None #### Request Body - **Currency** (string) - Required - The currency to be used (e.g., USD, GBP, EUR, CAD, AUD, NZD). - **CanPurchaseCredits** (boolean) - Required - Whether the client can purchase their own email credits. - **ClientPays** (boolean) - Required - Whether the client pays for their own services. - **MarkupPercentage** (number) - Optional - The overall markup percentage to apply. - **MarkupOnDelivery** (number) - Optional - Specific markup value for delivery fees (major unit of currency). - **MarkupPerRecipient** (number) - Optional - Specific markup value per recipient (minor unit of currency). ### Request Example ```json { "Currency": "AUD", "CanPurchaseCredits": false, "ClientPays": true, "MarkupPercentage": 20, "MarkupOnDelivery": 5, "MarkupPerRecipient": 4 } ``` ### Response #### Success Response (200) An empty response body indicates success. #### Response Example ``` HTTP/1.1 200 OK ``` ##### Error responses: - **110: Deprecated Method** - **152: Invalid Timezone** - **154: Empty Company Name** - **157: Invalid Country** - **167: Invalid Currency Code** - **170: Markup Rate Too Low** - **173: Cannot set billing without access** ``` -------------------------------- ### GET /api/v3.2/clients.xml Source: https://www.campaignmonitor.com/api/v3-3/getting-started Retrieves a list of clients in XML format. The Content-Type header will be 'application/xml; charset=utf-8'. ```APIDOC ## GET /api/v3.2/clients.xml ### Description Retrieves a list of clients in XML format. ### Method GET ### Endpoint https://api.createsend.com/api/v3.2/clients.xml ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **ClientID** (string) - The unique identifier for the client. - **Name** (string) - The name of the client. #### Response Example ```xml 4a397ccaaa55eb4e6aa1221e1e2d7122 Client One a206def0582eec7dae47d937a4109cb2 Client Two ``` ``` -------------------------------- ### POST /api/v3.3/admins.{xml|json} Source: https://www.campaignmonitor.com/api/v3-3/account Adds a new administrator to the account. An invitation will be sent to the new administrator via email. ```APIDOC ## POST /api/v3.3/admins.{xml|json} ### Description Adds a new administrator to the account. An invitation will be sent to the new administrator via email. ### Method POST ### Endpoint https://api.createsend.com/api/v3.3/admins.{xml|json} ### Parameters #### Query Parameters None #### Request Body - **EmailAddress** (string) - Required - The email address of the new administrator. - **Name** (string) - Required - The name of the new administrator. ### Request Example ```json { "EmailAddress": "sally@sparrow.com", "Name": "Sally Sparrow" } ``` ### Response #### Success Response (200) - **EmailAddress** (string) - The email address of the newly added administrator. #### Response Example ```json { "EmailAddress": "sally@sparrow.com" } ``` ##### Error Responses: - **1: Invalid Email Address**: Email address is missing or incorrectly formatted. - **150: Email Taken**: A person with that email address is already associated with this client. - **751: Empty Administrator Name**: Administrator name cannot be empty. ``` -------------------------------- ### Get Primary Contact API Source: https://www.campaignmonitor.com/api/v3-3/account Retrieves the email address of the administrator designated as the primary contact for the account. ```APIDOC ## GET /api/v3.3/primarycontact.{xml|json} ### Description Returns the email address of the administrator who is selected as the primary contact for this account. ### Method GET ### Endpoint `https://api.createsend.com/api/v3.3/primarycontact.{xml|json}` ### Response #### Success Response (200) - **EmailAddress** (string) - The email address of the current primary contact. #### Response Example (JSON) ```json { "EmailAddress": "john@jones.com" } ``` #### Response Example (XML) ```xml john@jones.com ``` ##### Error responses: Please see our response status codes documentation for details of potential error responses for any API request. ``` -------------------------------- ### Setting PAYG billing Source: https://www.campaignmonitor.com/api/v3-2/clients Allows setting up Pay-As-You-Go billing for a client, including currency, credit purchasing options, and markup percentages for delivery and recipients. ```APIDOC ## PUT /api/v3.2/clients/{clientid}/setpaygbilling.{xml|json} ### Description Set if a client can pay for their own campaigns and design and spam tests using our PAYG billing. Set the mark-up percentage on each type of fee, and if the client can purchase their own email credits to access bulk discounts. ### Method PUT ### Endpoint `https://api.createsend.com/api/v3.2/clients/{clientid}/setpaygbilling.{xml|json}` ### Parameters #### Path Parameters - **clientid** (string) - Required - The ID of the client for which PAYG billing settings should be set. #### Query Parameters None #### Request Body - **Currency** (string) - Required - The currency to be used for billing (e.g., USD, GBP, EUR, CAD, AUD, NZD). - **CanPurchaseCredits** (boolean) - Required - Whether the client can purchase their own email credits. - **ClientPays** (boolean) - Required - Whether the client pays for their own campaigns and tests. - **MarkupPercentage** (integer) - Optional - The default markup percentage to apply to fees. - **MarkupOnDelivery** (number) - Optional - Specific markup value for delivery fees (in major currency unit). - **MarkupPerRecipient** (number) - Optional - Specific markup value for per recipient fees (in minor currency unit). ### Request Example ```json { "Currency": "AUD", "CanPurchaseCredits": false, "ClientPays": true, "MarkupPercentage": 20, "MarkupOnDelivery": 5, "MarkupPerRecipient": 4 } ``` ### Response #### Success Response (200) An empty response with a 200 OK status code indicates success. #### Response Example ``` HTTP/1.1 200 OK ``` #### Error Responses - **110: Deprecated Method** - **152: Invalid Timezone** - **154: Empty Company Name** - **157: Invalid Country** - **167: Invalid Currency Code** - **170: Markup Rate Too Low** - **173: Cannot set billing without access** ``` -------------------------------- ### GET /api/v3.3/admins.{xml|json} Source: https://www.campaignmonitor.com/api/v3-3/account Retrieves a list of all administrators associated with the account, including active and invited ones. ```APIDOC ## GET /api/v3.3/admins.{xml|json} ### Description Contains a list of all (active or invited) administrators associated with a particular account. ### Method GET ### Endpoint https://api.createsend.com/api/v3.3/admins.{xml|json} ### Parameters #### Path Parameters None #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **Administrators** (array) - A list of administrator objects. - **EmailAddress** (string) - The email address of the administrator. - **Name** (string) - The name of the administrator. - **Status** (string) - The status of the administrator (e.g., "Active", "Waiting to Accept the Invitation"). #### Response Example ```json [ { "EmailAddress": "sally@sparrow.com", "Name": "Sally Sparrow", "Status": "Waiting to Accept the Invitation" }, { "EmailAddress": "john@jones.com", "Name": "John Jones", "Status": "Active" } ] ``` ##### Error Responses: Please see our response status codes documentation for details of potential error responses for any API request. ``` -------------------------------- ### POST /api/v3.2/clients.{xml|json} Source: https://www.campaignmonitor.com/api/v3-2/clients Creates a new client in your account with basic contact information. Client billing options are set once the client is created. Supports both JSON and XML formats. ```APIDOC ## POST /api/v3.2/clients.{xml|json} ### Description Creates a new client in your account with basic contact information and no access to the application. Client billing options are set once the client is created. ### Method POST ### Endpoint `https://api.createsend.com/api/v3.2/clients.{xml|json}` ### Parameters #### Query Parameters - **format** (string) - Required - The response format, either `json` or `xml`. #### Request Body ##### JSON - **CompanyName** (string) - Required - The name of the company. - **Country** (string) - Required - The country of the client. - **TimeZone** (string) - Required - The timezone of the client. ##### XML - **CompanyName** (string) - Required - The name of the company. - **Country** (string) - Required - The country of the client. - **TimeZone** (string) - Required - The timezone of the client. ### Request Example #### JSON ```json { "CompanyName": "My Company", "Country": "Australia", "TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney" } ``` #### XML ```xml My Company Australia (GMT+10:00) Canberra, Melbourne, Sydney ``` ### Response #### Success Response (201 Created) - **string** (string) - The unique identifier for the created client. #### Response Example #### JSON ```json "aa164e9c8ab0471294fe6148fc9cf634" ``` #### XML ```xml aa164e9c8ab0471294fe6148fc9cf634 ``` ##### Error responses: Please see our [response status codes documentation](link-to-status-codes) for details of potential error responses for any API request. If you receive a `400 Bad Request` response for this request, these are the possible errors which may be included in the body of the response: * **152: Invalid Timezone** Timezone string is not in the correct format. See here for accessing a list of all timezones. * **154: Empty Company Name** Company name cannot be empty * **157: Invalid Country** Country string is either empty or invalid * **172: Client Creation Limit** You can create a maximum of five (5) clients per thirty (30) minutes ```