Updated addSSLOrder (markdown)

master
Andrejs Vasiļevskis 2018-09-07 17:40:28 +03:00
parent 6d3143fde0
commit bf77d74245
1 changed files with 94 additions and 0 deletions

@ -98,3 +98,97 @@ If no errors in request following parameters will be returned:
"tax_rate": "21%" "tax_rate": "21%"
} }
``` ```
### Example code (Single domain SSL)
```PHP
<?php
$CSR = "-----BEGIN CERTIFICATE REQUEST-----
CSR CODE GOES HERE...
-----END CERTIFICATE REQUEST-----";
$request = [
"product_id" => 66,
"period" => 3,
"csr" => $CSR,
"server_count" => -1,
"webserver_type" => -1,
// CommonName - Domain Control Validation
"dcv_method" => "email",
"approver_email" => "admin@gogetssl.com",
// Administrative Person info
'admin_title' => "Mr.",
'admin_firstname' => "John",
'admin_lastname' => "Smith",
'admin_phone' => "+37166164222",
'admin_email' => "admin@gogetssl.com",
// Technical Person info
'tech_title' => "Mr.",
'tech_firstname' => "John",
'tech_lastname' => "Smith",
'tech_phone' => "+37166164222",
'tech_email' => "admin@gogetssl.com",
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://my.gogetssl.com/api/orders/add_ssl_order?auth_key=YOUR_AUTH_HASH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
```
### Example code (Multi-domain SSL)
```PHP
<?php
$CSR = "-----BEGIN CERTIFICATE REQUEST-----
CSR CODE GOES HERE...
-----END CERTIFICATE REQUEST-----";
$request = [
"product_id" => 68,
"period" => 3,
"csr" => $CSR,
"server_count" => -1,
"webserver_type" => -1,
// CommonName - Domain Control Validation
"dcv_method" => "email",
"approver_email" => "admin@gogetssl.com",
// SAN - Domain names (coma separated string)
"dns_names" => implode(",", ["www.gogetssl.com", "my.gogetssl.com", "support.gogetssl.com"]),
// SAN - Domain validation methods (coma separated string)
"approver_emails" => implode(",", ["admin@gogetssl.com", "dns", "http"]),
// Administrative Person info
'admin_title' => "Mr.",
'admin_firstname' => "John",
'admin_lastname' => "Smith",
'admin_phone' => "+37166164222",
'admin_email' => "admin@gogetssl.com",
// Technical Person info
'tech_title' => "Mr.",
'tech_firstname' => "John",
'tech_lastname' => "Smith",
'tech_phone' => "+37166164222",
'tech_email' => "admin@gogetssl.com",
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://my.gogetssl.com/api/orders/add_ssl_order?auth_key=YOUR_AUTH_HASH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
```