...
Info | ||
---|---|---|
| ||
For more information on becoming a reseller visit http://www.blesta.com/resellers/. |
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Overview
The Reseller API is a RESTful service. All data is returned in JSON format. The API is located at:
...
No Format |
---|
{ "response": 50.25 } |
Get Packages
Fetches all available reseller packages.
...
No Format |
---|
{ "response":[ { "id":"25", "name":"Blesta Monthly License", "description":"", "description_html":"", "qty":null, "id_code":"25", "pricing":[ { "id":"49", "term":"1", "period":"month", "price":"13.0000", "setup_fee":"0.0000", "cancel_fee":"0.0000", "currency":"USD" } ] }, { "id":"26", "name":"Blesta Owned License", "description":"", "description_html":"", "qty":null, "id_code":"26", "pricing":[ { "id":"32", "term":"0", "period":"onetime", "price":"95.0000", "setup_fee":"0.0000", "cancel_fee":"0.0000", "currency":"USD" } ] } ] } |
...
Get Package Pricing
Fetches pricing for a specific package.
The following parameters must be provided:
- package_id
No Format |
---|
GET https://account.blesta.com/plugin/blesta_reseller/v2/index/getpackagepricing.json |
...
No Format |
---|
{ "response":[ { "id":"49", "term":"1", "period":"month", "price":"13.0000", "setup_fee":"0.0000", "cancel_fee":"0.0000", "currency":"USD" } ] } |
...
Add License
Adds a new license.
The following parameters must be provided:
- vars[pricing_id]
Info | ||
---|---|---|
| ||
If you are a VAR or Tiered VAR reseller, your pricing ID is 364 unless otherwise noted. |
The following parameters are optional:
- vars[test_mode] - "true" or "false"
No Format |
---|
POST https://account.blesta.com/plugin/blesta_reseller/v2/index/addlicense.json |
...
Cancel License
Cancels a license.
The following parameters must be provided:
- vars[license]
The following parameters are optional:
- vars[test_mode] - "true" or "false"
No Format |
---|
POST https://account.blesta.com/plugin/blesta_reseller/v2/index/cancellicense.json |
...
Code Block | ||||
---|---|---|---|---|
| ||||
curl https://account.blesta.com/plugin/blesta_reseller/v2/index/cancellicense.json -u USERNAME:PASSWORD -d "vars[license]=LICENSE_KEY&vars[test_mode]=true" |
...
Suspend License
Suspends a license.
The following parameters must be provided:
- vars[license]
The following parameters are optional:
- vars[test_mode] - "true" or "false"
No Format |
---|
POST https://account.blesta.com/plugin/blesta_reseller/v2/index/suspendlicense.json |
...
Code Block | ||||
---|---|---|---|---|
| ||||
curl https://account.blesta.com/plugin/blesta_reseller/v2/index/suspendlicense.json -u USERNAME:PASSWORD -d "vars[license]=LICENSE_KEY&vars[test_mode]=true" |
...
Unsuspend License
Unsuspends a license.
The following parameters must be provided:
- vars[license]
The following parameters are optional:
- vars[test_mode] - "true" or "false"
No Format |
---|
POST https://account.blesta.com/plugin/blesta_reseller/v2/index/unsuspendlicense.json |
...
Code Block | ||||
---|---|---|---|---|
| ||||
curl https://account.blesta.com/plugin/blesta_reseller/v2/index/unsuspendlicense.json -u USERNAME:PASSWORD -d "vars[license]=LICENSE_KEY&vars[test_mode]=true" |
...
Update License
Updates a license to set it into a reissue state.
The following parameters must be provided:
- vars[license]
- vars[reissue_status]
The following parameters are optional:
- vars[test_mode] - "true" or "false"
No Format |
---|
POST https://account.blesta.com/plugin/blesta_reseller/v2/index/update.json |
...
Code Block | ||||
---|---|---|---|---|
| ||||
curl https://account.blesta.com/plugin/blesta_reseller/v2/index/update.json -u USERNAME:PASSWORD -d "vars[license]=LICENSE_KEY&vars[reissue_status]=reissue&vars[test_mode]=true" |
...
Search
Returns all licenses that match the search criteria, which includes license key, domain, IP, and install path. Only non-canceled licenses are returned. Up to 25 results are returned for each response. To fetch additional results, increment the vars[page] parameter.
The following parameters must be provided:
- vars[search]
The following parameters are optional:
- vars[page]
No Format |
---|
GET https://account.blesta.com/plugin/blesta_reseller/v2/index/search.json |
...
No Format |
---|
{
"response":[{
"status":"suspended",
"date_added":"2012-11-03 17:57:03",
"date_renews":null,
"date_suspended":"2013-08-17 17:00:03",
"date_canceled":null,
"pricing_id":"32",
"term":"0",
"period":"onetime",
"fields":{
"license_module_callhome":"",
"license_module_domains":[
"domain1.com",
"domain2.com"
],
"license_module_ips":[
"192.168.0.1",
"192.168.0.2"
],
"license_module_key":"abcdef0123456789",
"license_module_paths":[
"\/var\/www\/public_html\/"
],
"license_module_status":"",
"license_module_version":""
}
}]
} |
Search Count
Returns the total number of licenses that match the search criteria. Only a count of non-canceled licenses are returned.
It is useful to fetch the search count before performing a search when multiple pages of results are expected. Since up to 25 results may be returned per page of search results, you may divide the total search count by 25 to determine the number of pages you can set vars[page] to when searching.
The following parameters must be provided:
- vars[search]
No Format |
---|
GET https://account.blesta.com/plugin/blesta_reseller/v2/index/searchcount.json |
Code Block | ||||
---|---|---|---|---|
| ||||
curl --globoff "https://account.blesta.com/plugin/blesta_reseller/v2/index/searchcount.json?vars[search]=SEARCH_STRING" -u USERNAME:PASSWORD |
No Format |
---|
{
"response":56
} |