Follow

White Paper SSL - Automate DV ordering process - Examples API commands

To be completed

White Paper SSL - Automate DV ordering process

Examples API commands

During the process of automating the DV ordering process, you need to call the Openprovider API a couple of times. For general information about our API, please consult our documentation pages which includes a step-by-step start guide. This article provides you with information related to the API commands used for SSL automation. The examples are written in PHP as we learned that most of our customers use this scripting language. For more details, refer to the documentation pages that are linked throughout the text.

Customer object creation

As an SSL certificate has a requestor, which Openprovider addresses by means of a customer object, this customer object must be created if it does not yet exist. The createCustomerRequest command is the one that you need.

$request = new OP_Request;
$request->setCommand('createCustomerRequest')
 ->setAuth(array('username' => 'username', 'password' => 'password'))
 ->setArgs(array(
'companyName' => 'Openprovider', 'name' => array( 'initials' => 'J.B.', 'firstName' => 'John', 'prefix' => 'van', 'lastName' => 'Halen', ), 'gender' => 'M', 'phone' => array( 'countryCode' => '+31', 'areaCode' => '10', 'subscriberNumber' => '4482299' ), 'address' => array( 'street' => 'Kipstraat', 'number' => '3', 'suffix' => 'c', 'zipcode' => '3011 RR', 'city' => 'Rotterdam', 'state' => 'Zuid-Holland', 'country' => 'NL', ), 'email' => 'support@openprovider.nl', ));

After sending this command to the Openprovider API and acceptance by Openprovider, you will receive the newly created customer handle, in the form of AB012345-NL. This is the handle you will use in your SSL order command.

SSL order placement

The createSslCertRequest command allows you to place the order automatically. Most fields are self-explaining. Note the product ID to provide, which is 31 for Comodo EssentialSSL and 5 for RapidSSL. If you want to order another type of certificate, refer to the list with product IDs.

Depending on what kind of validation you prefer (DNS, HTTP or HTTPS), the parameter domainValidationMethods must be adapted.

$request = new OP_Request;
$request->setCommand('createSslCertRequest')
  ->setAuth(array('username' => 'username', 'password' => 'password'))
  ->setArgs(array(
    'productId' => 31, // 31=EssentialSSL, 5=RapidSSL
    'period' => 1,
    'csr' => {your CSR},
    'softwareId' => 'linux', // linux or windows
    'organizationHandle' => 'GA003358-NL',
    'technicalHandle' => 'GA003358-NL',
    'domainValidationMethods' => array(
      array(
        'hostName' => {your domain name},
        'method' => 'dns', // dns, http or https
      ),
    ),
  ),
));

If the order could successfully be placed, the response is the order ID. Store this order ID, as you'll need it when retrieving the SSL status! 

SSL order retrieval

With 10-minute intervals (no need to do it more often, as this is our update interval at the CAs), you can retrieve the order status of the SSL certificate with the retrieveOrderSslCertRequest command. The order ID is a required parameter in that command, you have received that in the previous step. As soon as the returned status is ACT, you immediately get the certificateintermediateCertificate and rootCertificate in that same API output. Use these certificates for the installation.

$request = new OP_Request;
$request->setCommand('retrieveOrderSslCertRequest')
  ->setAuth(array('username' => 'username', 'password' => 'password'))
  ->setArgs(array(
    'id' => {the ID number from the previous command}
  ));
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.