You are reviewing MouseStats documentation: Take a look to the product!

Reseller API

We are providing white-labeled program for our partners. The basic API is available now to automate creating and managing accounts within partner’s website.

What we will provide you?

  1. _partnerId
    a unique name to identify you in the system.
  2. _partnerSecret
    a secret code for request authorization.

(You need to protect your Secret like a password. It is private)

APIs

Here we will introduce all functions available.

(You should make a HTTP GET request to MouseStats API using your partnerId, partnerSecrent and other parameters those are required for specified task.)

New Account

You can create a new account in MouseStats using this code. Also you are allowed to active a free plan for them.

https://ssl.mousestats.com/api/CreateAccount

HTTP GET

Parameters:

  1. _partnerId
  2. _partnerSecret
  3. _userEmail email
  4. _userPassword password
  5. _activeFreePlan true/false

Sample Request:
https://ssl.mousestats.com/api/CreateAccount?_partnerId=partnername&_partnerSecret=bvdj436hdas&_userEmail=test@example.com&_userPassword=thePass36&_activeFreePlan=true

Get Account Info

You can access user details and used credit here. All information about users will be returned.

https://ssl.mousestats.com/api/GetAccount

HTTP GET

Parameters:

  1. _partnerId
  2. _partnerSecret
  3. _userEmail email

Sample Request:
https://ssl.mousestats.com/api/GetAccount?_partnerId=partnername&_partnerSecret=bvdj436hdas&_userEmail=test@example.com

Sample Output:
{ “Email” : “test@test1.com(partnername)”, “PlanName” : “SaneEgg”, “PlanDaysLeft” : 30, “PlanUsedHeatmapProjects” : 0, “PlanUsedPlaybackProjects” : 0, “PlanUsedHeatmapVisits” : 0, “PlanUsedPlaybackVisits” : 0 }

User Authorization

Obviously, you need to authorize your users for login. Using /CreateAccount you have made an account, here is steps is required for accessing the account by users. You need to create a login token in server-side using API first and pass this token to doLogin page for authorization.

https://ssl.mousestats.com/api/GenerateLoginToken

HTTP GET

Parameters:

  1. _partnerId
  2. _partnerSecret
  3. _userEmail email
  4. _validHours optional integer between 1 and 24 that indicate how long in hours the token should be valid. default value is 1.

Sample Request:
https://ssl.mousestats.com/api/GenerateLoginToken?_partnerId=partnername&_partnerSecret=bvdj436hdas&_userEmail=test@example.com&_validHours=1

Sample Output:
The output is a raw text. If login info be correct, a token will be returned. If the information not be true(our user not found), the result is "permission-denied".

  • Token Sample: 03C879E18F6AA4E15E1EB81C88E91B01
  • permission-denied

Now you just need to forward your user to:
http://www.mousestats.com/api/doLogin?_token=[TheTokenWeGotLastStep]

Example:
http://www.mousestats.com/api/doLogin?_token=03C879E18F6AA4E15E1EB81C88E91B01

If you have a custom domain on your white-labeled panel, please use your domain. example:
http://heatmaps.example.com/api/doLogin?_token=03C879E18F6AA4E15E1EB81C88E91B01



Related: How to upgrade customer's plan as a reseller?