DigiCert Services API는 시간을 절약하고 인증서 관리를 간소화하기 위해 일반적 인증서 절차를 자동화할 수 있는 강력한 API입니다. Services API는 최신 RESTful 규칙을 사용하며 사용하기 간단합니다.
API 요청을 구성할 때 이 기준 URL을 사용합니다:
https://www.digicert.com/services/v2
각 엔드포인트 페이지는 엔드포인트 URL의 마지막 부분(예, /orders)만 제공합니다. 요청을 구성할 때 기준 URL을 엔드포인트 앞에 추가해야 합니다.
일부 엔드포인트는 URL 쿼리 문자열을 사용하여 결과를 필터링합니다. URL 쿼리 문자열은 ?을(를) 사용하여 엔드포인트 URL 끝에 추가하고, 추가적 쿼리 문자열은 &을(를) 사용하여 추가합니다.
이 예제는 container_id
쿼리 문자열을 사용하여 결과를 지정된 컨테이너에 필터링합니다. 또한 limit
쿼리 문자열을 사용하여 10개 결과만 반환합니다.
https://www.digicert.com/services/v2/user?container_id=123&limit=10
모든 API 요청은 헤더-기반 인증 및 JSON/XML 요청 유형을 포함한 REST 기능을 사용하는 RESTful URL을 통해 제출합니다.
요청에 대한 데이터 문자 집합 인코딩은 UTF-8입니다. 적합하게 구성된 요청은 포트 443을 사용하며 user-agent 및 content-length 헤더가 지정되어 있습니다.
DigiCert Services API는 다음과 같은 표준 HTTP 방법을 사용합니다
GET
POST
PUT
HEAD
DELETE
대부분 요청은 JSON 또는 XML 형식 데이터를 전달해야 합니다. 엔드포인트가 다른 형식을 지원하거나 요구하는 경우 해당 엔드포인트에서 참고할 수 있습니다.
지원하는 content-type 값은 다음을 포함합니다.
application/json
application/xml
image/jpeg
image/png
응답은 헤더 및 본문으로 구성됩니다. 본문은 요청에 지정된 content-type을 기반으로 형식을 사용합니다.
HTTP 헤더 응답 코드에 대한 자세한 정보는 용어집 – 헤더를 참조하십시오
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"
}'
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)
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))
}
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);
});
{
"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"
}
}
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}}'
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)
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))
}
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);
});
{
"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"
}
}
]
}
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}}'
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)
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))
}
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);
});
// empty