Use this endpoint to send a copy of your SSL/TLS certificate to one or more email addresses.
curl -X PUT \
'https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"emails": [
"jill.valentine@example.com",
"leon.kennedy@example.com"
],
"certificate_collect_format": "attachment",
"custom_message": "Please install this certificate!"
}'
import requests
url = "https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail"
payload = "{\n\t\"emails\": [\n\t\t\"jill.valentine@example.com\",\n\t\t\"leon.kennedy@example.com\"\n\t],\n\"certificate_collect_format\": \"attachment\",\n \"custom_message\": \"Please install this certificate!\"\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json"
}
response = requests.request("PUT", 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/certificate/{{certificate_id}}/sendemail"
payload := strings.NewReader("{\n\t\"emails\": [\n\t\t\"jill.valentine@example.com\",\n\t\t\"leon.kennedy@example.com\"\n\t],\n\"certificate_collect_format\": \"attachment\",\n \"custom_message\": \"Please install this certificate!\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
req.Header.Add("Content-Type", "application/json")
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: 'PUT',
url: 'https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body: { emails: [ 'jill.valentine@example.com', 'leon.kennedy@example.com' ], certificate_collect_format: 'attachment', custom_message: 'Please install this certificate!'},
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
// empty
Name | Req/Opt | Type | Description |
---|---|---|---|
emails | required | array | List of one or more email addresses to receive the certificate. |
certificate_collect_format | required | string |
Select how you want to send the certificate. Allowed values: attachment , plaintext , downloadlink
|
custom_message | optional | string | Custom message to send with the email. |