Get key info
3 minute read
GET
Use this endpoint to get details about an API key.https://www.digicert.com/services/v2/key/{{key_id}}
Note
The API key itself will not be returned.Example requests and responses
curl -X GET \
'https://www.digicert.com/services/v2/key/{{key_id}}' \
-H 'Content-Type: application/xml' \
-H 'X-DC-DEVKEY: {{api_key}}'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)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))
}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);
});{
"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
}{
"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,
"organization_name": "STARS",
"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 | Key creation timestamp. 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 | Access role ID that limits API key permissions 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 name associated with certificate orders via ACME. Only returned for ACME keys. |
| organizatin_name | string | Organization name 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. |
Was this page helpful?
Provide feedback