Get key info

GET
https://www.digicert.com/services/v2/key/{{key_id}}

Use this endpoint to get details about an API key.

The API key itself will not be returned.

cURL
curl -X GET \
  'https://www.digicert.com/services/v2/services/v2/key/{{key_id}}' \
  -H 'Content-Type: application/xml' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/key/{{key_id}}"

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/key/{{key_id}}"

	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/key/{{key_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);
});
200 OK (api key)
{
  "id": 184,
  "user": {
    "id": 125039,
    "first_name": "John",
    "last_name": "Smith"
  },
  "status": "active",
  "create_date": "2018-08-07T23:27:58+00:00",
  "last_used_date": "2018-08-18T19:08:19+00:00",
  "name": "Key Name",
  "is_legacy": false,
  "restricted_to_role_id": 0
}
200 OK (acme url)
{
  "id": 15,
  "user": {
    "id": 10,
    "first_name": "Jill",
    "last_name": "Valentine"
  },
  "status": "active",
  "create_date": "2018-11-20T22:27:47+00:00",
  "name": "ACME URL Name",
  "is_legacy": false,
  "restricted_to_role_id": 0,
  "acme_directory_url": "******nnAA",
  "product_name_id": "ssl_plus",
  "product_name": "Standard SSL",
  "organization_id": 123456,
  "validity_days": "0",
  "validity_years": "2"
}

Response parameters

Name Type Description
id int Key ID.
user object Details about the user linked to the key.
.. id int User ID.
.. first_name string First name of user.
.. last_name string Last name of user.
status string Key status.
Possible values: active, revoked
create_date string Timestamp of when the key was created.
Format: UTC timezone and ISO 8601 date
last_used_date string Timestamp of the last time the key was used.
Format: UTC timezone and ISO 8601 date
name string Name of the key.
is_legacy bool Legacy status of the key.
restricted_to_role_id int Specifies if the API key permissions are restricted to a defined set of actions.
See Glossary – API key roles
acme_directory_url string Obfuscated ACME directory URL.
Only returned for ACME keys.
product_name_id string Name ID of the product ordered via ACME.
Only returned for ACME keys.
See Glossary – Product identifiers
product_name string Friendly name of the product ordered via ACME.
Only returned for ACME keys.
See Glossary – Product identifiers
organization_id string Organization associated with certificate orders via ACME.
Only returned for ACME keys.
validity_days string Number of days the certificate will be valid.
Only returned for ACME keys.
validity_years string Number of years the certificate will be valid.
Only returned for ACME keys.