Hitsteps Whitelabel API Documentation (1.0)

This documentation provide guideline on how to interact with Hitsteps whitelabel backend.

Initialization

Receive whitelabel token code

This API receive email and password of main account where whitelabel is purchased and return whitelabel token of the account.

Request Body schema: multipart/form-data
username
string
password
string

Responses

Response Schema: application/json
error
integer
main_account
string
token
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "main_account": "1234",
  • "token": "b91267234abc2354b2324c134ad3454f2c"
}

Get whitelabel detail

Given Token and main account, return whitelabel detail

Request Body schema: multipart/form-data
token
string
main_account
string

Responses

Response Schema: application/json
object
error
integer

Response samples

Content type
application/json
{
  • "0": {
    },
  • "1": {
    },
  • "error": 0
}

Get list of whitelabel brand accounts

Get list of accounts under a whitelabel brand

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{
  • "0": {
    },
  • "1": {
    },
  • "error": 0
}

Account

Get account ID from email

Given email, return account ID

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_email
string

Responses

Response Schema: application/json
error
integer
user_account_id
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_account_id": "18"
}

Get account detail

Given accout ID, return account detail.

Request Body schema: application/x-www-form-urlencoded
token
string
whitelabel_id
integer
user_account_id
integer

Responses

Response Schema: application/json
error
integer
user_account_id
string
user_account_email
string
user_timezone
string
user_country
string
user_language
string
user_nickname
string
user_account_statusmode
string
user_license_code
string
user_trial_status
string
user_license_expiry
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_account_id": "22",
  • "user_account_email": "sales@hitsteps.com",
  • "user_timezone": "8",
  • "user_country": "my",
  • "user_language": "en",
  • "user_nickname": "Hitsteps",
  • "user_account_statusmode": "1",
  • "user_license_code": "1",
  • "user_trial_status": "0",
  • "user_license_expiry": "1586041271"
}

Get account ID from API key

Given API key, return account ID

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
tracking_api_key
string

Responses

Response Schema: application/json
user_account_id
integer
APIKey
string
error
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_account_id": 3,
  • "APIKey": "b21345654321b4233232b"
}

Get account and website detail given website URL

Given Website Full URL, return account and website detail.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
website_url
string

Responses

Response Schema: application/json
error
integer
user_email
string
user_account_id
string
website_name
string
website_url
string
website_id
string
APIKey
string
submission_date
string
total_pageviews
integer
total_visitors
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_email": "sales@hitsteps.com",
  • "user_account_id": "33",
  • "website_name": "Hitsteps",
  • "website_url": "hitsteps.com",
  • "website_id": "18",
  • "APIKey": "34567645332b42354224a4242343544c345b",
  • "submission_date": "1089804558",
  • "total_pageviews": 1000,
  • "total_visitors": 200
}

Get account and website detail given website URL

Given Website URL, return account and website detail that match website domain.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
website_url
string

Responses

Response Schema: application/json
error
integer
user_email
string
user_account_id
string
website_name
string
website_url
string
website_id
string
APIKey
string
submission_date
string
total_pageviews
integer
total_visitors
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_email": "sales@hitsteps.com",
  • "user_account_id": "33",
  • "website_name": "Hitsteps",
  • "website_url": "hitsteps.com",
  • "website_id": "18",
  • "APIKey": "34567645332b42354224a4242343544c345b",
  • "submission_date": "1089804558",
  • "total_pageviews": 1000,
  • "total_visitors": 200
}

Get website detail from API key

Given API Key, return website detail associated with the API key.

Request Body schema: multipart/form-data
token
string
whitelabel_id
string
tracking_api_key
string

Responses

Response Schema: application/json
error
integer
user_email
string
user_account_id
string
website_name
string
website_url
string
website_id
string
APIKey
string
submission_date
string
total_pageviews
integer
total_visitors
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_email": "sales@hitsteps.com",
  • "user_account_id": "33",
  • "website_name": "Hitsteps",
  • "website_url": "hitsteps.com",
  • "website_id": "18",
  • "APIKey": "34567645332b42354224a4242343544c345b",
  • "submission_date": "1089804558",
  • "total_pageviews": 1000,
  • "total_visitors": 200
}

Get list of whitelabel brand accounts

Get list of accounts under a whitelabel brand

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{
  • "0": {
    },
  • "1": {
    },
  • "error": 0
}

Change account email address

Update a customer account email address

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer
new_email
string

Responses

Response Schema: application/json
error
integer
oldemail
string
newemail
string
msg
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "oldemail": "old@example.com",
  • "newemail": "new@example.com",
  • "msg": "Email changed from old to new."
}

Change account password

Given account id and new password, update account's password.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer
new_password
string

Responses

Response Schema: application/json
error
integer

Response samples

Content type
application/json
{
  • "error": 0
}

Register a new account

Create a new account under whitelabel brand.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
email
string
password
string
nickname
string
language
string

Responses

Response Schema: application/json
error
integer
user_account_id
integer
msg
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_account_id": 213,
  • "msg": "Account created."
}

Website

Get account and website detail given website URL

Given Website Full URL, return account and website detail.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
website_url
string

Responses

Response Schema: application/json
error
integer
user_email
string
user_account_id
string
website_name
string
website_url
string
website_id
string
APIKey
string
submission_date
string
total_pageviews
integer
total_visitors
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_email": "sales@hitsteps.com",
  • "user_account_id": "33",
  • "website_name": "Hitsteps",
  • "website_url": "hitsteps.com",
  • "website_id": "18",
  • "APIKey": "34567645332b42354224a4242343544c345b",
  • "submission_date": "1089804558",
  • "total_pageviews": 1000,
  • "total_visitors": 200
}

Get account and website detail given website URL

Given Website URL, return account and website detail that match website domain.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
website_url
string

Responses

Response Schema: application/json
error
integer
user_email
string
user_account_id
string
website_name
string
website_url
string
website_id
string
APIKey
string
submission_date
string
total_pageviews
integer
total_visitors
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_email": "sales@hitsteps.com",
  • "user_account_id": "33",
  • "website_name": "Hitsteps",
  • "website_url": "hitsteps.com",
  • "website_id": "18",
  • "APIKey": "34567645332b42354224a4242343544c345b",
  • "submission_date": "1089804558",
  • "total_pageviews": 1000,
  • "total_visitors": 200
}

Get website detail from API key

Given API Key, return website detail associated with the API key.

Request Body schema: multipart/form-data
token
string
whitelabel_id
string
tracking_api_key
string

Responses

Response Schema: application/json
error
integer
user_email
string
user_account_id
string
website_name
string
website_url
string
website_id
string
APIKey
string
submission_date
string
total_pageviews
integer
total_visitors
integer

Response samples

Content type
application/json
{
  • "error": 0,
  • "user_email": "sales@hitsteps.com",
  • "user_account_id": "33",
  • "website_name": "Hitsteps",
  • "website_url": "hitsteps.com",
  • "website_id": "18",
  • "APIKey": "34567645332b42354224a4242343544c345b",
  • "submission_date": "1089804558",
  • "total_pageviews": 1000,
  • "total_visitors": 200
}

Get list of account websites

Given account id, return list of websites that are being tracked in an account

Responses

Response Schema: application/json
object
object
error
integer

Response samples

Content type
application/json
{
  • "0": {
    },
  • "1": {
    },
  • "error": 0
}

Add a site to track under an account

Add a new site to track under account.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer
site_name
string
site_url
string

Responses

Response Schema: application/json
error
integer
msg
string
APIKey
string
user_account_id
integer
website_id
integer
site_url
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "msg": "Website added.",
  • "APIKey": "b123b3432b5b23232ab324",
  • "user_account_id": 32,
  • "website_id": 34,
  • "site_url": "hitsteps.com"
}

Add a site to track under an account (Full URL)

Add a new site to track under account given Full URL.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer
site_name
string
site_url
string

Responses

Response Schema: application/json
error
integer
msg
string
APIKey
string
user_account_id
integer
website_id
integer
site_url
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "msg": "Website added.",
  • "APIKey": "b123b3432b5b23232ab324",
  • "user_account_id": 32,
  • "website_id": 34,
  • "site_url": "hitsteps.com"
}

Billing

Request free trial

Request free 14 days trial activation for an account.

Request Body schema: multipart/form-data
token
string
whitelabel_id
string
user_account_id
string

Responses

Response Schema: application/json
error
integer
expire
integer
msg
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "expire": 123436234,
  • "msg": "Trial activated"
}

Request free plan activation

Free plan provide limited functionality. An account can be converted to free account to avoid dashboard asking user to pay for basic analytics features.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer

Responses

Response Schema: application/json
error
integer
msg
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "msg": "Free account activated"
}

Purchase a license for an account

Allow purchasing a license for an account under your whitelabel, and receive invoice to pay our share at end of the month.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer
plan
integer
duration
integer

months. for example 1, 3, 6, 9 or 12.

Responses

Response Schema: application/json
error
integer
msg
string
license_converted
integer
license_convert_old_plan
integer
license_convert_new_plan
integer
license_convert_old_price
integer
license_convert_new_price
number
license_convert_old_price_days
integer
license_convert_new_price_days
integer
license_convert_total_days
integer
hitsteps_share
number
license_plan_id
integer
license_plan_name
string
license_plan_months
integer
license_expiry
integer
license_expiry_processed
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "msg": "License activated",
  • "license_converted": 0,
  • "license_convert_old_plan": 0,
  • "license_convert_new_plan": 3,
  • "license_convert_old_price": 0,
  • "license_convert_new_price": 9.99,
  • "license_convert_old_price_days": 2,
  • "license_convert_new_price_days": 28,
  • "license_convert_total_days": 30,
  • "hitsteps_share": 6.99,
  • "license_plan_id": 3,
  • "license_plan_name": "Pro",
  • "license_plan_months": 12,
  • "license_expiry": 1234623540,
  • "license_expiry_processed": "2016-09-16"
}

Convert an existing license to other license

Upgrade or downgrade an license without charging a fee by converting remaining days of a license to new license by pro rata calculation.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
user_account_id
integer
newplan
integer

Responses

Response Schema: application/json
error
integer
msg
string
license_converted
integer
license_convert_old_plan
integer
license_convert_new_plan
integer
license_convert_old_price
integer
license_convert_new_price
number
license_convert_old_price_days
integer
license_convert_new_price_days
integer
license_convert_total_days
integer
hitsteps_share
integer
license_plan_id
integer
license_plan_name
string
license_plan_months
integer
license_expiry
integer
license_expiry_processed
string

Response samples

Content type
application/json
{
  • "error": 0,
  • "msg": "License converted successfully",
  • "license_converted": 0,
  • "license_convert_old_plan": 0,
  • "license_convert_new_plan": 3,
  • "license_convert_old_price": 0,
  • "license_convert_new_price": 9.99,
  • "license_convert_old_price_days": 2,
  • "license_convert_new_price_days": 28,
  • "license_convert_total_days": 30,
  • "hitsteps_share": 0,
  • "license_plan_id": 3,
  • "license_plan_name": "Pro",
  • "license_plan_months": 12,
  • "license_expiry": 1234623540,
  • "license_expiry_processed": "2016-09-16"
}

Return list of plans available for purchase

Return list of plans available for purchase along with the pricing set by whitelabel brand.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer

Responses

Response Schema: application/json
object
object

Response samples

Content type
application/json
{
  • "0": {
    },
  • "-1": {
    }
}

Analytics

Get last 7 days statistics

Request last 7 days statistics of a website.

Request Body schema: multipart/form-data
token
string
whitelabel_id
integer
website_id
integer

Responses

Response Schema: application/json
object
object
object
object
object
object
object
error
integer

Response samples

Content type
application/json
{
  • "0": {
    },
  • "1": {
    },
  • "2": {
    },
  • "3": {
    },
  • "4": {
    },
  • "5": {
    },
  • "6": {
    },
  • "error": 0
}
Feedback
Leave message