About Reseller API
This documentation explains how Mozello reseller API works.
Before you can use any of this, you must become an approved Mozello reseller.
Basics
Mozello resellers can control the system by making API calls.
The base URL for all API calls is https://resellers.mozello.com/api/
API calls are made as GET or POST request to the corresponding API URL which, in turn responds with a JSON object.
API requests must pass authorization token as parameter. It can be obtained and invalidated via login API calls.
Example
Request (raw HTTP)
GET /api/website/enable_premium/?apiToken=8712f9767e6a03ab6c8a80d53fc3ef6e&website=55083 HTTP/1.1
Host: resellers.mozello.com
Success response
{
"error": false
}
Error response
{
"error": true,
"errorCode": 401,
"errorMsg": "Unauthorized"
}
API reference
- Authorization
- Authorization: Logout
- Websites
- Website
- Website: Enable
- Website: Disable
- Website: Enable Premium
- Website: Disable Premium
- Website: Set Monthly AI Credits
- Website: Add Extra AI Credits
- Website: Login
- Domains
- Domain: Add
- Domain: Remove
- Settings
- Settings: Set
- Balance
- Password
Authorization
/api/authorize/ - obtains an API token
Parameters
- email - account e-mail address
- password - account password
Example
Request
GET /api/authorize/?email=you@example.com&password=secret HTTP/1.1
Response
{
"error": false,
"apiToken": "63ed7df0b8d8577321e95346e5e1364d"
}
Authorization: Logout
/api/authorize/logout/ - invalidates the API token
Parameters
- apiToken - API token
Websites
/api/websites/ - returns all websites
Parameters
- apiToken - API token
Example response
{
"error": false,
"websites": [
{
"userName": "John Smith",
"userEmail": "johnsmith@squeeezy.com",
"userCountry": "uk",
"userCreated": "2014-05-27 08:34:13",
"userIsConfirmed": false,
"userIsUnsubscribed": false,
"websiteID": 38638,
"websiteBrandname": "Squeeezy",
"websiteAlias": "squeeezy",
"websiteUrl": "https://squeeezy.mozellosite.com",
"websiteType": 2,
"websiteCreated": "2014-05-27 08:34:23",
"websiteModified": "2014-08-15 09:36:48",
"websiteAccessed": "2014-08-14 12:53:16",
"websiteStatus": 1,
"websiteIsPremium": true,
"websiteIsPremiumPlus": false,
"websiteIsPremiumPro": false,
"aiMonthlyLimit": 10000,
"aiSpentThisMonth": 2350,
"aiExtraCredits": 50000,
"aiExtraCreditsValidUntil": "2027-07-28 08:57:18"
},
{
"userName": "Tim Allen",
"userEmail": "tim@allen.com",
"userCountry": "us",
"userCreated": "2014-07-25 16:01:39",
"userIsConfirmed": false,
"userIsUnsubscribed": false,
"websiteID": 55083,
"websiteBrandname": "Tim Allen Recipies",
"websiteAlias": "timallen",
"websiteUrl": "https://timallen.mozellosite.com",
"websiteType": 2,
"websiteCreated": "2014-07-25 16:01:48",
"websiteModified": "2014-07-25 16:03:43",
"websiteAccessed": null,
"websiteStatus": 1,
"websiteIsPremium": false,
"websiteIsPremiumPlus": false,
"websiteIsPremiumPro": false,
"aiMonthlyLimit": 0,
"aiSpentThisMonth": 0,
"aiExtraCredits": 0,
"aiExtraCreditsValidUntil": null
}
]
}
AI fields are in AI credits: aiMonthlyLimit is the website's monthly AI credit limit, aiSpentThisMonth the credits used this month, aiExtraCredits the remaining extra credits (0 when expired) and aiExtraCreditsValidUntil their expiry date.
Website
/api/website/<website>/ - returns one website, with the same fields as in Websites
Parameters
- apiToken - API token
- website - website id (passed in the URL)
Example response
{
"error": false,
"website": {
"websiteID": 38638,
...
}
}
Website: Enable
/api/website/<website>/enable/ - enables a disabled website
Parameters
- apiToken - API token
- website - website id (passed in the URL)
Website: Disable
/api/website/<website>/disable/ - disables a website
Parameters
- apiToken - API token
- website - website id (passed in the URL)
Website: Enable Premium
/api/website/<website>/enable_premium/<subscription>/ - enables paid website subscription (Premium account)
Parameters
- apiToken - API token
- website - website id (passed in the URL)
- subscription - one of
premiumto enable Premium account,premiumplusto enable Premium Plus account, orpremiumproto enable Premium Pro account
Website: Disable Premium
/api/website/<website>/disable_premium/ - stops paid website subscription
Parameters
- apiToken - API token
- website - website id (passed in the URL)
Website: Set Monthly AI Credits
/api/website/<website>/ai_limit/set/ - sets how many AI credits the website may use each month
AI credits used by your websites are billed to you (see reseller pricing). When a website has 0 monthly credits and no extra credits, its AI features are hidden.
While reseller AI credits are free of charge, a website can get at most the AI credits of its plan (a higher value returns error 509 with maxCredits), and enabling Premium raises the limit to the plan's AI credits unless the website is set to 0. Once AI pricing is in effect, the limit is yours to set and plan changes do not touch it.
Parameters
- apiToken - API token
- website - website id (passed in the URL)
- credits - whole number of AI credits per month, from 0 to 1000000
Example request
GET /api/website/38638/ai_limit/set/?apiToken=63ed7df0b8d8577321e95346e5e1364d&credits=20000 HTTP/1.1
An invalid credits value returns error 507 (Bad AI credits amount). Until the reseller signup fee is paid, this call returns error 601 and new websites start with the free plan's AI credits.
Website: Add Extra AI Credits
/api/website/<website>/ai_credits/add/ - adds extra AI credits to the website
Extra credits are used after the monthly credits run out, only while the website has a Premium plan. They are valid for 300 days from the last addition. You are billed only for the credits actually used.
Parameters
- apiToken - API token
- website - website id (passed in the URL)
- credits - whole number of AI credits to add, from 1 to 1000000
An invalid credits value returns error 507 (Bad AI credits amount). Until the reseller signup fee is paid, this call returns error 601. While reseller AI credits are free of charge, it returns error 508.
Website: Login
/api/website/<website>/login/ - creates a one-time auto-login link for a website
Parameters
- apiToken - API token
- website - website id (passed in the URL)
Example response
{
"error": false,
"loginUrl": "https://www.mozello.com/session/resellerlogmein/params/token/c1d3662fed66a732de71c1b9232448e3/"
}
Domains
/api/website/<website>/domains/ - lists domains attached to a website
Parameters
- apiToken - API token
- website - website id (passed in the URL)
Example response
{
"error": false,
"domains": [
{
"domainID": 934,
"domain": "example.com"
},
{
"domainID": 1001,
"domain": "squeeezy.com"
}
]
}
Domain: Add
/api/website/<website>/domain/add/ - lists domains attached to a website
Parameters
- apiToken - API token
- website - website id (passed in the URL)
- domain - domain name without www
Domain: Remove
/api/website/<website>/domain/<domain>/remove/ - removes the domain previously attached to a website
Parameters
- apiToken - API token
- website - website id (passed in the URL)
- domain - domain name ID retrieved with domains API (passed in the URL)
Settings
/api/settings/ - retrieves reseller account data
Parameters
- apiToken - API token
Example response
{
"error": false,
"resellerID": 77,
"company": "Acme Developer Inc.",
"contactName": "John Smith",
"contactWebsite": "http://www.example.com",
"contactEmail": "john@example.com",
"contactPhone": "",
"addrAddress": "742 Evergreen Terrace",
"addrCity": "Springfield",
"addrRegion": "",
"addrPostal": "",
"addrCountry": "us",
"supportEmail": "support@example.com",
"supportPhone": "",
"buyLink": "http://www.example.com/buy.php",
"logoLink": "http://www.example.com/logo.png",
"faviconLink": "http://www.example.com/favicon.ico",
"notifyLink": "http://www.example.com/notify.php",
"termsLink": "http://www.example.com/terms.php",
"privacyLink": "http://www.example.com/privacy.php",
"tlds": "com,net,org",
"type": 1,
"aiDefaultLimit": 10000
}
aiDefaultLimit is the number of monthly AI credits new websites start with (0 = AI off). While reseller AI credits are free of charge, new websites get at most the free plan's AI credits.
Settings: Set
/api/settings/set/ - changes reseller account settings (only the allowed params)
Parameters
- apiToken - API token
- <settingName> - each setting to be changed has to be passed as setting name / value pair
Example request
GET /api/settings/set/?apiToken=63ed7df0b8d8577321e95346e5e1364d&supportEmail=customers@example.com HTTP/1.1
Balance
/api/balance/ - retrieves financial information
Parameters
- apiToken - API token
Example response
{
"error": false,
"premiumWebsites": 3,
"currentBalance": "EUR 5.06",
"billingThreshold": "EUR 100.00",
"aiCreditsThisMonth": 12500,
"aiCostThisMonth": "EUR 1.88"
}
AI usage is added to currentBalance once a month, for the previous month. aiCostThisMonth is the cost of the AI credits used so far this month.
Password
/api/password/set/ - changes reseller account password
Parameters
- apiToken - API token
- password - new password