A complete guide of external billing transfer API for Virusdie partners.
2019-02-04
Send HTTPS requests to //virusdie.ru/partners-api/. A common request format is:
GET /partners-api/<method>/[?query]
method* - The method (action) to perform. Described in section Methods List.query - Named parameters, query stringYou should use your personal API key for authorization.
It should be transfered through the cookies under the name apikey (Cookie: apikey=...).
In response to each request, there will be a JSON object returned along format below:
{
status: int Error code. More in a section [Errors],
message: str Error message, if any,
result: mix Response to the request (the format depends on the requested method),
}
The format of the .result field depends on the specific method (parameter method).
See Methods List.
The HTTP response status code will always be 200.
The error code is sent to the field .status of the result.
Value 200 means that there were no critical errors and you can process the .result field.
Otherwise (.status not a 200) you should not process the .result field.
In the .message field, a text message is sent about the error that occurred.
GET /partners-api/add-site/? &domain=str
domain* - Domain name{
"id": int, // Site ID (0 on errors)
"domain": "str" // Domain name
}
GET /partners-api/create-user/? &login=str
login* - Customer login (email){
"login": "str", // Login name of new customer
"password": "str", // Password for the newly registered customer (it will be omitted for existing users)
"url": "str", // Direct login URL
"expires": int // The expiration time of the direct login URL (UNIX timestamp)
}
The URL in the .url field will be valid until the time specified in the .expires field.
You can refresh this at any time by calling the user method.
GET /partners-api/delete-user/? &login=str
login* - Customer login (email){
"login": "str", // User login (email)
}
GET /partners-api/delete-site/? &website=str|int
website* - Domain name or site ID{
"id": int, // Site ID (0 on errors)
"domain": "str" // Domain name
}
GET /partners-api/delete-user-site/? &website=str|int &login=str
website* - Domain name or site IDlogin* - Login name (email) of the customer{
"id": int, // Site ID (0 on errors)
"domain": "str" // Domain name
}
GET /partners-api/add-user-site/? &domain=str &login=str
domain* - Domain namelogin* - Login name (email) of the customer{
"id": int, // Site ID (0 on errors)
"domain": "str" // Domain name
}
Register new customer/website.
GET /partners-api/activate-site/? &login=str &domain=str [&rate=int]
login* - Login name (email) of new customerdomain* - Add this domain into the customer’s websites listrate - The rate (plan) ID (one year by default):
0 - One year (default)1 - 6 months{
"login": "str", // Login name of new customer
"password": "str", // Password for the newly registered customer (it will be omitted for existing users)
"domain": "str", // The domain added into the customer's website list
"url": "str", // Direct login URL
"expires": int // The expiration time of the direct login URL (UNIX timestamp)
}
The URL in the .url field will be valid until the time specified in the .expires field.
You can refresh this at any time by calling the user method.
GET /partners-api/set-site-option/? &login=str &website=str|int [&sendreports=int]
login* - Login name (email) of new customerwebsite* - Domain name or site IDsendreports - Send scan results (reports) by email:
0 - off1 - on{
"website": "str", // The domain name from the request
"sendreports": int // sendreports status (optional)
}
GET /partners-api/update-plan/? &login=str &website=str|int &plan=int &days=int
login* - Login name (email) of new customerwebsite* - Domain name or site IDplan* - Set/prolong payment plan for this site:
0 - Completely disable the current plan6 - Enable the special plan (specialist service)7 - Enable free plandays* - Prolong the specified plan by specified number of days{
"website": "str", // The domain name from the request
"plan": int, // The plan id from the request
"days": int // Total number of days the plan expires in
}
GET /partners-api/last-report/? &login=str &website=str|int
login* - Login name (email) of new customerwebsite* - Domain name or site ID{
"statistic": { // Report summary
"domain": "str", // Domain name
"checkedbytes": int, // Total bytes scanned
"checkedfiles": int, // Total files scanned
"checkeddirs": int, // Total directories scanned
"detectedfiles": int, // Total files detected
"result": { // Files summary
"malicious": { // Malicious files
"cleaned": int, // The number of files cleaned
"deleted": int, // The number of files deleted
"notcleaned": int // The number of not cleaned files
},
"suspicious": int // The number of suspicious (doubt) files
}
},
"detectedfiles": { // The list of detected files
"file/path/name": { // File path name (== .name)
"name": "str", // File path name
"backup": int, // Backup ID or 0
"time": int, // Original file modification time
"time2": int, // File modification time after treatment
"mode": int, // File permissions (decimal)
"size": int, // File size
"statustext": "str", // The one of: "CLEANED_FILE", "NOT_CLEANED_FILE", "DELETED_FILE", "CURABLE_FILE", "INCURABLE_FILE"
"statustext2": "str", // Result status, the one of: "INFECTED_FILE", "SUSPICIOUS_FILE" (ignored if .statustext is CLEANED_FILE/DELETED_FILE)
// Threats in the file:
"infected": [ threat_id, ... ], // Malicious threats
"suspicious": [ threat_id, ... ], // Suspicions (doubt)
"incurable": [ threat_id, ... ], // Incurable threats
"treated": [ threat_id, ... ] // Threats removed
}
},
"blacklisted": { // Blacklists lookup results (can be null)
"Kaspersky": { "detected":true, "result":"malware site", "detail":"" },
...
},
"externalscan": [ // Virusdie external scan results (can be null)
["url", threat_id, "threat_title", doubt (1/0), "code_sample_base64"],
...
]
}
GET /partners-api/site-list/? &start=int &limit=int &order=str &find=str
start - Start offsetlimit - Limit the number of sites in response (default is 200)order - Order by (field name)find - Search by domain name substring{
"start": int, // See &start argument
"limit": int, // See &limit argument
"order": "str", // See &order argument
"find": "str", // See &find argument
"websites": [ // The list of user's websites
{
"id": int, // Site ID
"domain": "str", // Domain Name
"dateadded": int, // Date and time the site has been added to the list (UNIX timestamp)
"paidtodate": int, // Paid to date along basic plan (UNIX timestamp)
"plan": int, // Paid plan ID
"firewallstatus": int, // Firewall On/Off status (1/0)
"expertservice": int, // The date when the expert service expires (UNIX timestamp)
"scanperiod": int, // Automatic scan period (seconds) (0 - disabled)
"lastscan": int, // Last scan date (UNIX timestamp)
"nextscan": int, // Next scan date (UNIX timestamp)
"detectedfiles": int, // Number of malicious and suspicious files found (along last scan, summary)
"malicious": int, // Number of malicious files found (along last scan)
"suspicious": int, // Number of suspicious files found (along last scan)
"autocleanup": int, // Automatic cleanup On/Off status (1/0)
"extrnalscan": int, // There are threats detected by Virusdie external scan (1/0)
"blacklisted": int // The domain is blacklisted by some safebrowsing services (1/0)
},
...
]
}
GET /partners-api/user/? &login=str
login* - Login name (email) of the customer{
"login": "str", // Login name of the customer
"url": "str", // Direct login URL
"expires": int, // The expiration time of the direct login URL (UNIX timestamp)
"websites": [ // The list of user's websites
{
"id": int, // Site ID
"domain": "str", // Domain Name
"dateadded": int, // Date and time the site has been added to the list (UNIX timestamp)
"paidtodate": int, // Paid to date along basic plan (UNIX timestamp)
"plan": int, // Paid plan ID
"firewallstatus": int, // Firewall On/Off status (1/0)
"expertservice": int, // The date when the expert service expires (UNIX timestamp)
"scanperiod": int, // Automatic scan period (seconds) (0 - disabled)
"lastscan": int, // Last scan date (UNIX timestamp)
"nextscan": int, // Next scan date (UNIX timestamp)
"detectedfiles": int, // Number of malicious and suspicious files found (along last scan, summary)
"malicious": int, // Number of malicious files found (along last scan)
"suspicious": int, // Number of suspicious files found (along last scan)
"autocleanup": int, // Automatic cleanup On/Off status (1/0)
"extrnalscan": int, // There are threats detected by Virusdie external scan (1/0)
"blacklisted": int // The domain is blacklisted by some safebrowsing services (1/0)
},
...
]
}
The URL in the .url field will be valid until the time specified in .expires field.
You should always check the URL expiration time before showing the URL to the user.
You can request the new URL at any time. Any previously created URL will continue
to work as expected until it will be expired.
GET /partners-api/users/
[
{
"login": "str", // Login name of the customer
"url": "str", // Direct login URL
"expires": int, // The expiration time of the direct login URL (UNIX timestamp)
},
...
]
If You need to connect the user’s site to Virusdie SAAS,
You need to place the user’s synchronization file in the root directory of this site.
This file can be downloaded from syncfile endpoint.
GET /partners-api/syncfile/? &login=str
login* - Login name (email) of the customer.User’s synchronizaion file contents (PHP code) will be sent in response.
File name is sent in Content-Disposition HTTP header.
The file must be saved under this name.
Any error will be reported via HTTP status codes (400, 404, 500).