The REST API reference documents the available REST resources, along with expected HTTP response codes and sample requests. REST stands for Representational State Transfer. It is developed as an alternative to the HTTP and SOAP-based WebServices API.
You can use the REST API to design and deploy campaigns, develop integrations between the platform and other applications, and script contact management. The REST resources are defined by nouns indicated which feature is affected, such as Lists, Templates, or Campaigns. Each resource supports the ability to create, read, update, and delete using standard HTTP POST, GET, PUT, PATCH, and DELETE requests.
The REST API provides access to resources via URI paths. The Header provides authentication and supported data formatting instructions. To use a REST API, make an HTTP request and parse the response. The REST API uses the JSON format to communicate requests and output results.
Resource Requirements
The resource requires the following information:
Name |
Req? |
Description |
Details |
Yes |
Defines the resource to use. |
http://[siteurl]/rest/[resourceName] |
|
Request Method |
Yes |
Method to manipulate or request data. |
POST, GET, PUT, DELETE |
Yes |
Authentication code for API access as a Base64 encoded string. This is required. The command will fail if the Realm and password do not match. |
Authorization: Basic [realmName:apiPassword] |
|
|
Authentication for API Client* as a Base64 string. Client authentication provides another level of user access and security. This is optional instead of using the Default API Client. |
x-api-key: [apiClientName:apiClientAuth] |
|
Yes |
Acceptable data format. Only JSON is supported. |
Content Type: application/json |
|
|
API version. Most current version is v1. |
Accept: application/vnd.whatcounts-v1+json |
HTTP Request Types
The following HTTP Request types are supported:
- POST - Create a new item
- PUT - Update all fields defined in JSON with the defined values, update undefined values with NULL
- PATCH - Update all fields defined in JSON with the defined values, ignore fields that are not defined in JSON
- GET - Get the fields for the item identified in the request
- DELETE - Delete the item identifed in the request
Supported Resources
The REST API supports the following system features as resources: