Services API

DigiCert Services API is a powerful API that allows you to automate typical certificate processes to save time and streamline certificate management. Services API uses modern RESTful conventions and is simple to use.

Why use it?

  • Access all the features available in CertCentral without needing to log in to the platform.
  • Customize and automate virtually any workflow within the certificate management platform.
  • Create your own version of the platform with your organization's branding.
  • Seamlessly integrate with your existing tools.

Base URL

Use this base URL when constructing API requests:

bash
https://www.digicert.com/services/v2

URL query strings

Some endpoints use URL query strings to filter results. URL query strings are appended to the endpoint URL using ?, with additional query strings appended using &.

This example uses the container_id query string to filter results to the specified container. It also uses the limit query string to return only ten results.

bash
https://www.digicert.com/services/v2/user?container_id=123&limit=10

Requests

All API requests are submitted via RESTful URLs using REST features, including header-based authentication and JSON/XML request types.

The data character set encoding for requests is UTF-8. A well-formed request uses port 443 and has the user-agent and content-length headers specified.

Method

DigiCert Services API uses these standard HTTP methods:

  • GET
  • POST
  • PUT
  • DELETE

Body

Most requests require passing either JSON or XML formatted data. If an endpoint supports or requires a different format, it will be noted for that endpoint.

Supported content-type values include:

  • application/json
  • application/xml
  • application/zip
  • image/jpeg
  • image/png

Filters, sorting, and pagination parameters

Some GET requests support the option to filter and sort response data by using the filters[], sort, offset, and limit query parameters in the request URL.

To use filter or sorting parameters in a request, append them to the request URL with a ?. To apply multiple filters, append each filter parameter with an &.

For example:

generic
https://www.digicert.com/services/v2/account/subaccount/invite?filters[status]=pending&sort=date_created

To see which properties an endpoint supports for filtering, check the reference documentation for the endpoint. For general information and examples of the syntax to use when applying filters and sorting results, see the parameter descriptions in the table below.

Name Description
filters[{{property_name}}] Limits response to results where the chosen property_name contains a specific value. Replace {{property_name}} in your request with the property to use for filtering.

If the value of the property is a date, you can filter by date range. To filter by date range, separate the start date and end date with an ellipsis (...). To return all results before or after a specific date, prefix the date with a less than (<) or greater than (>) symbol, respectively.

Examples:

  • filters[email]=myname@email.com
    Limits response to results where the email address is myname@gmail.com.
  • filters[common_name]=example.com&filters[product_name_id]=ssl_basic
    Limit response to results where the common name is example.com and the product ID is ssl_basic.
  • filters[date_created]=2020-09-01+00:00:00
    Limits response to results with a date_created value of 2020-09-01+00:00:00.
  • filters[date_created]=2018-01-01+12:00:00...2020-12-31+23:59:59
    Limits response results with a date_created value between 2018-01-01+12:00:00 and 2020-12-31+23:59:59.
  • filters[date_created]=>2020-07-01
    Limits response to results with a date_created value after 2020-07-01.
filters[search] Limits response to results where the value of a searched property matches or contains a specific string of characters. To see a list of the searched properties for an endpoint, check the reference documentation for the endpoint.

To search for values that contain a specific string of characters, prefix the string with a %. To search for values that are an exact match for a string of characters, omit the % from the request.

Examples:

  • filters[search]=%gmail
    Limits response to results where the value of a searched property contains the string gmail.
  • filters[search]=myname@gmail.com
    Limits response to results where the value of a searched property is an exact match for the string myname@gmail.com.
sort Sorts results by the value of one or more properties.

By default, sorts results in ascending alphabetical order (0-9, A-Z). To sort in descending alphabetical order (9-0, Z-A), prefix the property name with a minus (-).

To sort by multiple properties, separate the name of each property with a comma. Sort hierarchy matches the order of properties in this list.

Examples:

  • sort=-common_name
    Sorts results in descending alphabetical order by the value of the common_name property.
  • sort=email,-last_invite_date
    Sorts results in ascending alphabetical order by the value of the email property first, then in descending alphabetical order by the value of the last_invite_date property.
offset Index of the first result to return.
limit Total number of results to include in the response.

Responses

Responses consist of headers and a body. The body is formatted based on the content-type specified in the request.

See Glossary – Headers for information about HTTP header response codes.

Examples

Adding a note to an order

cURL
curl -X POST \
  'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
  "text": "This is a note"
}'
Python
import requests

url = "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note"

payload = "{\n\t\"text\": \"This is a note\"\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/xml"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note"

	payload := strings.NewReader("{\n\t\"text\": \"This is a note\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/xml")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'POST',
  url: 'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note',
  headers: 
   { 'Content-Type': 'application/xml',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: '{\n\t"text": "This is a note"\n}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
201 Created
{  
   "id": 1,
   "date_created": "2018-09-26T20:29:09+00:00",
   "text": "This is a note",
   "user": {  
      "id": 125039,
      "first_name": "John",
      "last_name": "Smith",
      "email": "john.smith@digicert.com"
   }
}

Retrieving all notes on an order

cURL
curl -X GET \
  'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note"

headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/xml"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/xml")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'GET',
  url: 'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note',
  headers: 
   { 'Content-Type': 'application/xml',
     'X-DC-DEVKEY': '{{api_key}}' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
200 OK
{  
   "notes": [  
      {  
         "id": 1,
         "date_created": "2018-09-26T20:29:09+00:00",
         "text": "This is a note",
         "user": {  
            "id": 125039,
            "first_name": "John",
            "last_name": "Smith",
            "email": "john.smith@digicert.com"
         }
      }
   ]
}

Deleting a note on an order

cURL
curl -X DELETE \
  'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note/{{note_id}}' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note/{{note_id}}"

headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/xml"
    }

response = requests.request("DELETE", url, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note/{{note_id}}"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/xml")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/note/{{note_id}}',
  headers: 
   { 'Content-Type': 'application/xml',
     'X-DC-DEVKEY': '{{api_key}}' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
204 No Content
// empty