Pregenerated API Calls to Automate Certificate Management

SSL’s RESTful SWS API simplifies automation of certificate issuance and lifecycle. To make things even simpler, you can retrieve preformatted API strings from your SSL.com account portal, allowing you to easily access a variety of API calls from your command line and/or scripts. This how-to will walk you through finding and using these API strings.

Note: All of the preformatted API strings available in the user portal are set up to work with live orders (and real money) in your SSL.com account. We strongly encourage you to get familiar with the API through SSL.com’s Sandbox before using it with live orders in a production environment. For more information on SWS API and testing in the Sandbox, please read our Introduction to SSL.com’s SWS API.

1. Log into your SSL.com user account account and go the Orders tab.

Orders Tab

 

2. Scroll down to the order you want to view API strings for and click the Open link.

Open link

 

3. Click the preformatted api strings link, located under the for developers heading.

preformatted api strings

 

4. A page with preformatted API strings will appear. Note: these commands are preformatted for cURL, but can be easily translated into other formats.

Preformatted API strings

 

5. For all of these commands, you will need to manually add your account key and secret key. These values can be retrieved either via the API itself or in your account portal. Use the clickable tabs below for instructions for these two different methods:

APIPortal

To retrieve your account key and secret key via the API, issue the following command (replace USERNAME and PASSWORD with the values for your account):

$ curl -L --request GET --data-urlencode 'password=PASSWORD' 'https://sws.sslpki.com/user/USERNAME'

To retrieve your account key and secret key from the portal, navigate to your account’s dashboard and click the api credentials link to open a page with your credentials.

API credentials

Your account key will be visible in the Account Key column. To view your secret key, click Click to view, in the Secret Key column.

6. As an example, we’ll use the API to collect a list of orders associated with an account. First, copy the line of code under List Orders.

List Orders

 

7. The text for the command is below. Replace the first instance of [REDACTED] with your account key, and the second instance with your secret key:

$ curl -k -H "Accept: application/json" -H "Content-type: application/json" -X GET -d "{\"account_key\":\"[REDACTED]\",\"secret_key\":\"[REDACTED]\",\"per_page\":\"10\",\"page\":\"1\"}" https://sws.sslpki.com/certificates

Thank you for choosing SSL.com! If you have any questions, please contact us by email at Support@SSL.com, call 1-877-SSL-SECURE, or just click the chat link at the bottom right of this page.