-
Notifications
You must be signed in to change notification settings - Fork 2
Usage
Bert Kooij edited this page Jul 29, 2020
·
9 revisions
$client = new Client(
$username,
$password
);Replace $username and $password with the credentials you use to sign in at https://www.versio.nl/login?uri=/customer/. But please be aware for adding the credentials to a (public) Version Control System.
Please make sure that the IP Address of your server is added to the Versio Customer Portal at: https://www.versio.nl/customer/account/api.
The Client instance is providing a way to get the following instances:
-
categories()Category -
contacts()Contacts -
dsnTemplates()DNSTemplate -
domains()Domain -
resellers()ResellerHosting -
resellerPlans()ResellerPlan -
sslApprovers()SSLApprover -
sslCertificates()SSLCertificate -
sslProducts()SSLProduct -
tld()TLD -
webhosting()Webhosting -
webhostingPlans()WebhostingPlan
So for example you can run a request for listing the categories like this:
$client->categories()->list();Sync request
$categoryResponse = $client->categories->list();
if($categoryResponse->getStatusCode() == 200) {
$categories = json_decode($categoryResponse->getBody()->getContents());
} else {
// Error
}Async request
$client->categories->listAsync()->then(
function (ResponseInterface $response) {
// Success
$categories = json_decode($response->getBody()->getContents());
return $response;
},
// The failure callback
function (\Exception $exception) {
$error = json_decode($response->getBody()->getContents())->error;
print $error->message;
throw $exception;
}
);
There is an async and a sync version for all the requests.
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the categories | https://www.versio.nl/RESTapidoc/#api-Categories-List |
create(array $data) |
Creates a category based on the provided data | https://www.versio.nl/RESTapidoc/#api-Categories-Create |
delete($id) |
Deletetes the category based on the provided id | https://www.versio.nl/RESTapidoc/#api-Categories-Delete |
$response = $client->categories()->list();
if($response->getStatusCode() == 200) {
$categories = json_decode($response->getBody()->getContents());
} else {
// Error
}| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the contacts | https://www.versio.nl/RESTapidoc/#api-Contacts-List |
create(array $data) |
Creates a contact based on the provided data | https://www.versio.nl/RESTapidoc/#api-Contacts-Create |
delete($id) |
Deletetes the contact based on the provided id | https://www.versio.nl/RESTapidoc/#api-Contacts-Delete |
resend($id) |
Resent contact validation mail or start up contact validation | https://www.versio.nl/RESTapidoc/#api-Contacts-Contact |
$response = $client->contacts()->list();
if($response->getStatusCode() == 200) {
$contacts = json_decode($response->getBody()->getContents());
} else {
// Error
}| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the DNS templates | https://www.versio.nl/RESTapidoc/#api-DNS_templates-List |
create(array $data) |
Creates a DNS template based on the provided data | https://www.versio.nl/RESTapidoc/#api-DNS_templates-Create |
delete($id) |
Deletetes the DNS template based on the provided id | https://www.versio.nl/RESTapidoc/#api-DNS_templates-Delete |
update($id, $data) |
Updates the DNS template | https://www.versio.nl/RESTapidoc/#api-DNS_templates-Update |
$response = $client->dnsTemplates()->list();
if($response->getStatusCode() == 200) {
$dnsTemplates = json_decode($response->getBody()->getContents());
} else {
// Error
}| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the DNS templates | https://www.versio.nl/RESTapidoc/#api-Domains-List |
create(array $data) |
Registers a domain based on the provided data (Please provide the domain in the data array $data['domain'] = 'domain.com') |
https://www.versio.nl/RESTapidoc/#api-Domains-Register |
get($domain) |
Get a single domain | https://www.versio.nl/RESTapidoc/#api-Domains-Domain |
delete($domain) |
Deletetes the Domain based on the provided id | https://www.versio.nl/RESTapidoc/#api-Domains-Delete |
update($domain, $data) |
Updates the Domain | https://www.versio.nl/RESTapidoc/#api-Domains-Update |
check($domain) |
Checks the availability of the provided Domain | https://www.versio.nl/RESTapidoc/#api-Domains-Update |
renew($domain, $data) |
Renews the Domain | https://www.versio.nl/RESTapidoc/#api-Domains-Renew |
transfer($domain, $data) |
Transfers the Domain | https://www.versio.nl/RESTapidoc/#api-Domains-Transfer |
transferNominet($domain, $data) |
Transfer the provided domain out Nominet (Only *.uk domains) | https://www.versio.nl/RESTapidoc/#api-Domains-Transfer_out |
transferStatus($domain, $process_id) |
Get the status of a transfer process | https://www.versio.nl/RESTapidoc/#api-Domains-Transfer_status |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the reseller hosting accounts | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-List |
create(array $data) |
Creates a new Reseller Hosting Account | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-Create |
get($username) |
Get a single Reseller Hosting Account | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-Get_Resellerhosting_account |
delete($username) |
Deletes the Reseller Hosting Account based on the provided username | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-Delete |
update($username, $data) |
Updates the Reseller Hosting Account | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-Update |
renew($username, $data) |
Renews the Reseller Hosting Account | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-Renew |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the reseller hosting plans | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-List_plans |
get($id) |
Get a single Reseller Hosting Plan | https://www.versio.nl/RESTapidoc/#api-Reseller_hosting-Get_Resellerhosting_plan |
| Code | Description | Versio API |
|---|---|---|
list($data) |
Returns a JSON list of all the SSL approvers for a domain (Provide the domain by: $data['domain'] = 'domain.com';
|
https://www.versio.nl/RESTapidoc/#api-SSL_certificates-List_approvers_e_mailadresses_used_to_validate_ssl_certficate |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the SSL certificates | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-List |
create(array $data) |
Orders a new SSL Certificate | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-Order |
get($id) |
Get a single SSL Certificate | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-Get_SSL_certificate |
cancel($id) |
Cancels the SSL certificate based on the provided id | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-Cancel_SSL_certificate |
update($id, $data) |
Changes or resent the apporver email | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-Change_approver |
renew($username, $data) |
Reisse a SSL certificate with a different csr, but same CN. | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-Reissue_SSL_certificate |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the SSL products | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-List_SSL_products |
get($tld) |
Get a single SSL Product | https://www.versio.nl/RESTapidoc/#api-SSL_certificates-Get_SSL_product |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the TLD's | https://www.versio.nl/RESTapidoc/#api-TLDs-Info_and_prices |
get($tld) |
Get a single TLD info object | https://www.versio.nl/RESTapidoc/#api-TLDs-Get_Specific_tld_and_prices |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the webhosting accounts | https://www.versio.nl/RESTapidoc/#api-Webhosting-List |
create(array $data) |
Creates a new Webhosting Account | https://www.versio.nl/RESTapidoc/#api-Web_hosting-Create |
get($username) |
Get a single Webhosting Account | https://www.versio.nl/RESTapidoc/#api-Web_hosting-Get_Webhosting_account |
delete($username) |
Deletes the Webhosting Account based on the provided username | https://www.versio.nl/RESTapidoc/#api-Webhosting-Delete |
update($username, $data) |
Updates the Webhosting Account | https://www.versio.nl/RESTapidoc/#api-Webhosting-Update |
renew($username, $data) |
Renews the Webhosting Account | https://www.versio.nl/RESTapidoc/#api-Webhosting-Renew |
| Code | Description | Versio API |
|---|---|---|
list() |
Returns a JSON list of all the webhosting plans | https://www.versio.nl/RESTapidoc/#api-Webhosting-List_plans |
get($id) |
Get a single Webhosting Plan | https://www.versio.nl/RESTapidoc/#api-Webhosting-Get_Resellerhosting_plan |