修改报告

PUT
https://api.digicert.com/reports/v1/report/{{report_identifier}}

使用此端点修改报告模板。使用来自“创建报告”端口的响应提供report-identifier

必须在帐户中启用报告库功能,该端点才能成功响应。

cURL
curl --location -g --request PUT 'https://www.digicert.com/services/v1/reports/preview/report/{report-indentifier}' \
--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":[]
    }        
    }
}
Python
import requests

url = "https://www.digicert.com/services/v1/report/{report-indentifier}"

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("PUT", url, headers=headers, data=payload)

print(response.text)
Go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://www.digicert.com/services/v1/report/%7Breport-indentifier%7D"
  method := "PUT"

  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))
}
NodeJS
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://www.digicert.com/services/v1/report/{report-indentifier}',
  'headers': {
    'Content-Type': 'application/json',
    'X-DC-DEVKEY': '{api_key}',
    'Cookie': 'visid_incap_1323850=KAk7FceETTODSOcubQ6RxzER+V8AAAAAQUIPAAAAAACT+abPwAMvJuYXiY7OiuId'
  },
  body: JSON.stringify({"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":[]}}})

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
204 No Content
<BLANK>
400 Missing fields
{
"code": "missing_mandatory_fields",
"message": "Please provide values for mandatory fields"
}
400 Invalid request
{
"code": "invalid_request",
"message": "Please provide correct input for fields: [|display_name has an invalid value|]"
}
400 Already exists
{ 
   "code": "report_exists", 
   "message": "Report already exists"
}
400 Invalid value
{
"code": "invalid_request",
"message": "Please provide correct input for fields: [|run_until has an invalid value|]"
}
400 Invalid date
{
"code": "invalid_date",
"message": "Backdated run_until is not allowed"
}
400 Invalid format
{
"code": "report_format_inapplicable",
"message": "The given report format is not applicable for the template/report."
}
400 Format missing
{
"code": "invalid_request",
"message": "Please provide correct input for fields: [|format must contain at least 1 item|]"
}
400 Invalid type
{
"code": "invalid_report_type",
"message": "Invalid report_type specified"
}
400 Invalid column
{
"code": "invalid_column_identifiers",
"message": "Invalid column identifiers specified"
}
400 Invalid schedule
{
"code": "invalid_schedule",
"message": "Provided schedule values are not correct"
}

请求参数

名称 请求/选项 类型 描述
display_name 必填 string 为报告指定的显示名称。
schedule 必填 object 容器。
.. frequency 必填 string 创建报告的频率。可能的值:ON_DEMAND, WEEKLY, MONTHLY. 值区分大小写。
.. weekday_to_run 必填 string 每周创建报告的日期。可能的值:SUNDAYSATURDAY。值区分大小写。
.. weekday_frequency 必填 string 每个月指定生成报告的周次。可能的值: FIRST, SECOND, THIRD, FOURTH, LAST. 值区分大小写。
.. run_until 必填 string 停止生成报告的日期。格式:年-月-日。
format 必填 string 报告的格式。对于此端点,可能的值是CSV。如需返回 JSON 格式的报告,请参阅获取 JSON 报告 API
report_metadata 必填 object 容器。
.. report_type 必填 string 需要修改的报告的类型。
.. columns 必填 object 容器。
.. .. identifier 必填 string 报告库 API 支持的列标识符。有关所有支持的列的列表,请参阅报告库 API 列
.. filters 可选 object 容器。
.. .. filter_identifier 必填 string 在筛选中使用的标识符。有关使用筛选器的信息,请参阅“使用筛选器创建库报告”。
.. .. coliumn_identifier 必填 string 指定用于筛选的列标识符。有关使用筛选器的更多信息,请参阅“使用筛选器创建库报告”。
.. .. values 必填 string/lint 列中指定用于筛选的标识符。有关使用筛选器的更多信息,请参阅“使用筛选器创建库报告”。
.. sources 可选 object 容器。
.. .. include_all_sub_accounts 必填 boolean 在创建报告时是否包括所有子帐户。可能的值:TRUEFALSE
.. .. sub_accounts 必填 integer 在创建报告时必须包括的子帐户的 ID。
.. .. divisions 必填 integer 在创建报告时需要包括的帐户分区。

路径参数

名称 请求/选项 类型 描述
report-identifier 必填 uuid 创建报告 API 响应中显示的报告 ID。