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
messages
required
Array of objects non-empty
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
to_uids
required
Array of strings non-empty
campaign
string

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

Responses

200

Success

401

Unauthorized

422

Unprocessable Entity

500

Internal Server Error

post /notifications

Main Maxtraffic API Server

https://push.mxapis.com/notifications

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true
}

Visitors

Find visitor by ID

View the details of a visitor

Authorizations:
path Parameters
id
required
any

ID of visitor

Responses

200

Visitor

401

Unauthorized

404

Visitor not found

500

Internal Server Error

get /visitors/{id}

Main Maxtraffic API Server

https://push.mxapis.com/visitors/{id}

Response samples

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

Get visitor traits

View visitor traits

Authorizations:
path Parameters
id
required
any

ID of visitor

Responses

200

Visitor Traits

401

Unauthorized

404

Visitor not found

500

Internal Server Error

get /visitors/{id}/traits

Main Maxtraffic API Server

https://push.mxapis.com/visitors/{id}/traits

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "property": "peter@initech.com"
}

Set visitor traits

Set visitor traits. Before setting traits mappings should be created in your website account settings -> trait mappings

Authorizations:
path Parameters
id
required
any

ID of visitor

Request Body schema: application/json
property
string or string or number or array

Responses

200

Success

401

Unauthorized

404

Visitor not found

500

Internal Server Error

post /visitors/{id}/traits

Main Maxtraffic API Server

https://push.mxapis.com/visitors/{id}/traits

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "property": "peter@initech.com"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true
}