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

Each endpoint page provides only the last part of the endpoint URL (e.g., /orders). Be sure to prepend the base URL to the endpoint when constructing requests.

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
  • HEAD
  • 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
  • image/jpeg
  • image/png

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