이 엔드포인트를 사용하여 보고서를 만듭니다.
이 엔드포인트가 응답하려면 계정에 보고서 라이브러리 기능을 사용해야 합니다.
curl --location --request POST 'https://www.digicert.com/services/v1/reports/preview/report' \
--header 'Content-Type: application/json' \
--header 'X-DC-DEVKEY: {{api_key}}' \
--data-raw '{
"display_name": "Report_1",
"schedule": {
"frequency": “MONTHLY",
"weekday_to_run": "TUESDAY",
"weekday_frequency": "SECOND",
"run_until": "2021-12-24"
},
"format": [
"CSV"
],
"report_metadata": {
"report_type": "orders",
"columns": [
{
"identifier": "account_id"
},
{
"identifier": "number_of_sans"
},
{
"identifier": "certificate_id"
},
{
"identifier": "certificate_validity_days"
},
{
"identifier": "container_id"
},
{
"identifier": "container_name"
}
],
"filters":[
{
"filter_identifier":"in",
"column_identifier":"common_name",
"values":["digiqatest.com"]
},
{
"filter_identifier":"in",
"column_identifier":"organization_name",
"values":["win the customer, LLC"]
},
{
"filter_identifier":"in",
"column_identifier":"status",
"values":["issued","pending"]
},
{
"filter_identifier":"in",
"column_identifier":"user_email",
"values":["dev1@digicert.com"]
},
{
"filter_identifier":"in",
"column_identifier":"product_name",
"values":["Secure Site Pro SSL","GeoTrust TrueBusiness ID OV","Secure Site OV"]
},
{
"filter_identifier":"in",
"column_identifier":"order_placed_via",
"values":["CertCentral","Api"]
},
{
"filter_identifier":"last_30_days",
"column_identifier":"order_created_date",
"values":[]
},
{
"filter_identifier":"in",
"column_identifier":"certificate_id",
"values":[3292682707,3292682692,3292682697]
}
],
"sources": {
"include_all_sub_accounts": true,
"sub_accounts": [],
"divisions":[]
}
}
}
import requests
url = "https://www.digicert.com/services/v1/report"
payload="{\r\n \"display_name\": \"Report_1\",\r\n \"schedule\": {\r\n \"frequency\": “MONTHLY\", \r\n \"weekday_to_run\": \"TUESDAY\", \r\n \"weekday_frequency\": \"SECOND\", \r\n \"run_until\": \"2021-12-24\" \r\n },\r\n \"format\": [\r\n \"CSV\" \r\n ],\r\n \"report_metadata\": {\r\n \"report_type\": \"orders\",\r\n \"columns\": [\r\n {\r\n \"identifier\": \"account_id\"\r\n },\r\n {\r\n \"identifier\": \"number_of_sans\"\r\n },\r\n {\r\n \"identifier\": \"certificate_id\"\r\n },\r\n {\r\n \"identifier\": \"certificate_validity_days\"\r\n },\r\n {\r\n \"identifier\": \"container_id\"\r\n },\r\n {\r\n \"identifier\": \"container_name\"\r\n } \r\n ],\r\n \"filters\":[\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"common_name\",\r\n \"values\":[\"digiqatest.com\"]\r\n },\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"organization_name\",\r\n \"values\":[\"win the customer, LLC\"]\r\n },\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"status\",\r\n \"values\":[\"issued\",\"pending\"]\r\n },\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"user_email\",\r\n \"values\":[\"dev1@digicert.com\"]\r\n },\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"product_name\",\r\n \"values\":[\"Secure Site Pro SSL\",\"GeoTrust TrueBusiness ID OV\",\"Secure Site OV\"]\r\n },\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"order_placed_via\",\r\n \"values\":[\"CertCentral\",\"Api\"]\r\n },\r\n {\r\n \"filter_identifier\":\"last_30_days\",\r\n \"column_identifier\":\"order_created_date\",\r\n \"values\":[]\r\n },\r\n {\r\n \"filter_identifier\":\"in\",\r\n \"column_identifier\":\"certificate_id\",\r\n \"values\":[3292682707,3292682692,3292682697]\r\n }\r\n ],\r\n \"sources\": {\r\n \"include_all_sub_accounts\": true,\r\n \"sub_accounts\": [],\r\n \"divisions\":[]\r\n } \r\n }\r\n}"
headers = {
'Content-Type': 'application/json',
'X-DC-DEVKEY': '{api_key}',
'Cookie': 'visid_incap_1323850=KAk7FceETTODSOcubQ6RxzER+V8AAAAAQUIPAAAAAACT+abPwAMvJuYXiY7OiuId'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v1/report"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"display_name": "Report_1",`+"
"+`
"schedule": {`+"
"+`
"frequency": “MONTHLY", `+"
"+`
"weekday_to_run": "TUESDAY", `+"
"+`
"weekday_frequency": "SECOND", `+"
"+`
"run_until": "2021-12-24" `+"
"+`
},`+"
"+`
"format": [`+"
"+`
"CSV" `+"
"+`
],`+"
"+`
"report_metadata": {`+"
"+`
"report_type": "orders",`+"
"+`
"columns": [`+"
"+`
{`+"
"+`
"identifier": "account_id"`+"
"+`
},`+"
"+`
{`+"
"+`
"identifier": "number_of_sans"`+"
"+`
},`+"
"+`
{`+"
"+`
"identifier": "certificate_id"`+"
"+`
},`+"
"+`
{`+"
"+`
"identifier": "certificate_validity_days"`+"
"+`
},`+"
"+`
{`+"
"+`
"identifier": "container_id"`+"
"+`
},`+"
"+`
{`+"
"+`
"identifier": "container_name"`+"
"+`
} `+"
"+`
],`+"
"+`
"filters":[`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"common_name",`+"
"+`
"values":["digiqatest.com"]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"organization_name",`+"
"+`
"values":["win the customer, LLC"]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"status",`+"
"+`
"values":["issued","pending"]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"user_email",`+"
"+`
"values":["dev1@digicert.com"]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"product_name",`+"
"+`
"values":["Secure Site Pro SSL","GeoTrust TrueBusiness ID OV","Secure Site OV"]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"order_placed_via",`+"
"+`
"values":["CertCentral","Api"]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"last_30_days",`+"
"+`
"column_identifier":"order_created_date",`+"
"+`
"values":[]`+"
"+`
},`+"
"+`
{`+"
"+`
"filter_identifier":"in",`+"
"+`
"column_identifier":"certificate_id",`+"
"+`
"values":[3292682707,3292682692,3292682697]`+"
"+`
}`+"
"+`
],`+"
"+`
"sources": {`+"
"+`
"include_all_sub_accounts": true,`+"
"+`
"sub_accounts": [],`+"
"+`
"divisions":[]`+"
"+`
} `+"
"+`
}`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-DC-DEVKEY", "{api_key}")
req.Header.Add("Cookie", "visid_incap_1323850=KAk7FceETTODSOcubQ6RxzER+V8AAAAAQUIPAAAAAACT+abPwAMvJuYXiY7OiuId")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://www.digicert.com/services/v1/report',
'headers': {
'Content-Type': 'application/json',
'X-DC-DEVKEY': '{api_key}',
'Cookie': 'visid_incap_1323850=KAk7FceETTODSOcubQ6RxzER+V8AAAAAQUIPAAAAAACT+abPwAMvJuYXiY7OiuId'
},
body: '{\r\n "display_name": "Report_1",\r\n "schedule": {\r\n "frequency": “MONTHLY", \r\n "weekday_to_run": "TUESDAY", \r\n "weekday_frequency": "SECOND", \r\n "run_until": "2021-12-24" \r\n },\r\n "format": [\r\n "CSV" \r\n ],\r\n "report_metadata": {\r\n "report_type": "orders",\r\n "columns": [\r\n {\r\n "identifier": "account_id"\r\n },\r\n {\r\n "identifier": "number_of_sans"\r\n },\r\n {\r\n "identifier": "certificate_id"\r\n },\r\n {\r\n "identifier": "certificate_validity_days"\r\n },\r\n {\r\n "identifier": "container_id"\r\n },\r\n {\r\n "identifier": "container_name"\r\n } \r\n ],\r\n "filters":[\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"common_name",\r\n "values":["digiqatest.com"]\r\n },\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"organization_name",\r\n "values":["win the customer, LLC"]\r\n },\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"status",\r\n "values":["issued","pending"]\r\n },\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"user_email",\r\n "values":["dev1@digicert.com"]\r\n },\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"product_name",\r\n "values":["Secure Site Pro SSL","GeoTrust TrueBusiness ID OV","Secure Site OV"]\r\n },\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"order_placed_via",\r\n "values":["CertCentral","Api"]\r\n },\r\n {\r\n "filter_identifier":"last_30_days",\r\n "column_identifier":"order_created_date",\r\n "values":[]\r\n },\r\n {\r\n "filter_identifier":"in",\r\n "column_identifier":"certificate_id",\r\n "values":[3292682707,3292682692,3292682697]\r\n }\r\n ],\r\n "sources": {\r\n "include_all_sub_accounts": true,\r\n "sub_accounts": [],\r\n "divisions":[]\r\n } \r\n }\r\n}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"report_identifier": "e62b02f3-97f9-4fa1-9314-f9ecfdcaf5d7",
"message": "Successfully created Custom Report"
}
{
"code": "missing_mandatory_fields",
"message": "Please provide values for mandatory fields"
}
{
"code": "invalid_request",
"message": "Please provide correct input for fields: [|display_name has an invalid value|]"
}
{
"code": "report_exists",
"message": "Report already exists"
}
{
"code": "missing_mandatory_fields",
"message": "Please provide values for mandatory fields"
}
{
"code": "invalid_request",
"message": "Please provide correct input for fields: [|run_until has an invalid value|]"
}
{
"code": "invalid_date",
"message": "Backdated run_until is not allowed"
}
{
"code": "report_format_inapplicable",
"message": "The given report format is not applicable for the template/report."
}
{
"code": "missing_mandatory_fields",
"message": "Please provide values for mandatory fields"
}
{
"code": "invalid_request",
"message": "Please provide correct input for fields: [|format must contain at least 1 item|]"
}
{
"code": "invalid_report_type",
"message": "Invalid report_type specified"
}
{
"code": "invalid_column_identifiers",
"message": "Invalid column identifiers specified"
}
{
"code": "invalid_schedule",
"message": "Provided schedule values are not correct"
}
{
"code": "user_authentication_error",
"message": "User is not authenticated."
}
{
"code": "user_forbidden",
"message": "User does not have the required permission."
}
{
"code": "custom_reports_not_enabled",
"message": "Custom reports is not enabled"
}
이름 | 필수/옵션 | 유형 | 설명 |
---|---|---|---|
display_name | 필수 | string | 보고서에 표시할 이름입니다. |
schedule | 필수 | object | 컨테이너입니다. |
.. frequency | 필수 | string |
보고서 만들기의 주기입니다. 가능한 값: ON_DEMAND, WEEKLY, MONTHLY . 값은 대/소문자를 구분합니다.
|
.. weekday_to_run | 필수 | string |
보고서를 만드는 요일입니다. 가능한 값: SUNDAY ~ SATURDAY 입니다. 값은 대/소문자를 구분합니다. frequency 이(가) ON_DEMAND 로 지정된 경우 이 매개 변수는 필수가 아닙니다.
|
.. weekday_frequency | 필수 | string |
보고서를 생성하는 지정된 월의 주입니다. 가능한 값: FIRST , SECOND , THIRD , FOURTH , LAST . 값은 대/소문자를 구분합니다.
|
.. run_until | 옵션 | date | 보고서의 생성을 중지하는 날짜입니다. 형식: YY-MM-DD입니다. 값을 지정하지 않은 경우 보고서 만들기를 중지하지 않습니다. |
format | 필수 | string |
보고서 파일 유형입니다. 가능한 값: CSV 및 JSON 을(를) 제공합니다.
|
report_metadata | 필수 | object | 컨테이너 |
.. report_type | 필수 | string | 만들려는 보고서의 유형입니다. |
.. columns | 필수 | object | 컨테이너입니다. |
.. .. identifier | 필수 | string | 보고서 라이브러리 API에서 지원하는 열 식별자입니다. 모든 지원하는 열의 목록은 보고서 라이브러리 API 열을 참조하십시오. |
.. filters | 옵션 | object | 컨테이너입니다. |
.. .. filter_identifier | 필수 | string | 필터에서 사용할 식별자입니다. 필터 사용에 대한 정보는 필터를 포함하여 라이브러리 보고서 만들기를 참조하십시오. |
.. .. column_identifier | 필수 | string | 필터링에 사용할 특정 열 식별자입니다. 필터 사용에 대한 정보는 필터를 포함하여 라이브러리 보고서 만들기를 참조하십시오. |
.. .. values | 필수 | string/lint | 필터링에 사용할 열의 지정된 값입니다. 필터 사용에 대한 정보는 필터를 포함하여 라이브러리 보고서 만들기를 참조하십시오. |
.. sources | 옵션 | object | 컨테이너입니다. |
.. .. include_all_sub_accounts | 필수 | boolean |
보고서 만들기에 모든 하위 계정을 포함 여부입니다. 가능한 값: TRUE 또는 FALSE 입니다.
|
.. .. sub_accounts | 필수 | integer | 보고서 만들기 포함하려면 제공해야 하는 하위 계정의 ID입니다. |
.. .. divisions | 필수 | integer | 보고서 만들기에 포함하려는 계정 부서입니다. |
이름 | 유형 | 설명 |
---|---|---|
.. report_identifier | uuid | 보고서 ID입니다. |
.. message | string | 보고서 표시 이름을 포함하여 만들기 성공 메시지입니다. |