Download OpenAPI specification:Download
Documentation for MaxTraffic REST API Features.
Example how to use API to send Cart Abandonment notifications
How to check if visitor has subscribed to push notifications?
Send personalised Push Notifications using API.
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.
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 |
The response format for the API is JSON. To get that response request must have Accept header with 'application/json' value.
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 |
It indicates that the REST API successfully carried out whatever action the client requested
Wrong or empty Authorization header
Is returned if requested resource doesn`t exists. For instance if non existing Visitor id is provided.
The request cannot be processed either because it omitted required fields or because it contained invalid data.
Servers are not working as expected. Please report an issue to support@maxtraffic.com
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.
Authorization: key=YOUR_API_KEY
Security Scheme Type | API Key |
---|---|
Header parameter name: | Authorization |
Sends notification to visitors
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. |
{- "messages": [
- {
- "language": "en",
- "title": "A message title",
- "body": "A message body",
- "buttons": [
- {
- "title": "string",
- "click_url": "string",
- "icon": "string"
}
]
}
], - "to_ids": [
- "a865e214-370d-11e7-a919-92ebcb67fe33"
], - "to_uids": [
- "ee144c5007cf7f67b0837ac9d75dfbbb"
], - "campaign": "Cart abandonment"
}
{- "success": true
}
Get all campaign leads
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. |
{- "email": "email@example.com",
- "timestamp": "2021-11-05T11:20:03.000Z",
- "campaign": "Summer sale"
}
Get campaign leads by campaign id
id required | any ID of campaign |
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. |
{- "email": "email@example.com",
- "timestamp": "2021-11-05T11:20:03.000Z",
- "campaign": "Summer sale"
}