MaxTraffic API (1.0.1)

Download OpenAPI specification:Download

API Call Structure

Request

All request you want to send to our API must contain authorization header. We accept GET and POST HTTP methods. Every POST request must have Content-Type header. Currently we accept only 'application/json' content-type.

Headers

Header Description
Authorization: key=YOUR_API_KEY An API Key is required to be sent as part of every request to the MaxTraffic API
Accept: application/json To recieve response in JSON
Content-Type: application/json To be able to send JSON data to an API

Response

The response format for the API is JSON. To get that response request must have Accept header with 'application/json' value.

Headers

Header Description
X-RateLimit-Limit The maximum number of requests that the consumer is permitted to make per minute
X-RateLimit-Remaining The number of requests remaining in the current rate limit window

Status Codes

200 (OK)

It indicates that the REST API successfully carried out whatever action the client requested

401 (Unauthorized)

Wrong or empty Authorization header

404 (Not Found)

Is returned if requested resource doesn`t exists. For instance if non existing Visitor id is provided.

422 (Client Error)

The request cannot be processed either because it omitted required fields or because it contained invalid data.

500 (Server Error)

Servers are not working as expected. Please report an issue to support@maxtraffic.com

Authentication

Api key

MaxTraffic controls access to the API and data via an API Key. The API key is the primary data authentication method for your account. Also your usage is recorded and reported via the API Key. You can get the API key at the MaxTraffic Console APIs page.

Example

Authorization: key=YOUR_API_KEY

Security Scheme Type API Key
Header parameter name: Authorization

Notifications

Send notification

Sends notification to visitors

Authorizations:
Request Body schema: application/json
required
Array of objects non-empty unique
icon
string

Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 192x192 (at least 96x96) to display well on high DPI devices. If blank the default website icon is used.

image
string

Sets the web push notification's large image to be shown below the notification's title and text.

to_ids
required
Array of strings non-empty unique
to_uids
required
Array of strings non-empty unique
campaign
string

Notification campaign name, if not set 'default' used.

Responses

Request samples

Content type
application/json
{
  • "messages": [
    ],
  • "to_ids": [
    ],
  • "to_uids": [
    ],
  • "campaign": "Cart abandonment"
}

Response samples

Content type
application/json
{
  • "success": true
}

Visitors

Find visitor by ID

View the details of a visitor

Authorizations:
path Parameters
id
required
any

ID of visitor

Responses

Response samples

Content type
application/json
{
  • "id": "ed6ada8dc2adf6f16a1a4c1d0b8dca33",
  • "user_id": "3122de02-d105-481d-80e4-110fa3047a6c",
  • "web_push_subscriber": true
}

Leads

Get all leads

Get all campaign leads

Authorizations:
query Parameters
from
string <date-time>

Restrict the response to leads collected after the set time. Uses ISO 8601 time format.

to
string <date-time>

Restrict the response to leads collected before the set time. Uses ISO 8601 time format.

Responses

Response samples

Content type
application/json
{
  • "email": "email@example.com",
  • "timestamp": "2021-11-05T11:20:03.000Z",
  • "campaign": "Summer sale"
}

Get campaign leads

Get campaign leads by campaign id

Authorizations:
path Parameters
id
required
any

ID of campaign

query Parameters
from
string <date-time>

Restrict the response to leads collected after the set time. Uses ISO 8601 time format.

to
string <date-time>

Restrict the response to leads collected before the set time. Uses ISO 8601 time format.

Responses

Response samples

Content type
application/json
{
  • "email": "email@example.com",
  • "timestamp": "2021-11-05T11:20:03.000Z",
  • "campaign": "Summer sale"
}