Request a Let's Encrypt certificate
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/domains/e41fa98f-ea80-4654-b229-a9b765d0863a/ssl_certificate"
payload := strings.NewReader("{ \"email_address\": \"jane@example.com\", \"given_name\": \"Jane\", \"family_name\": \"Doe\", \"region_code\": \"US\", \"state\": \"Texas\", \"city\": \"Austin\", \"phone\": \"800-123-4567\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <credentials>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/domains/e41fa98f-ea80-4654-b229-a9b765d0863a/ssl_certificate';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"email_address":"jane@example.com","given_name":"Jane","family_name":"Doe","region_code":"US","state":"Texas","city":"Austin","phone":"800-123-4567"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/domains/e41fa98f-ea80-4654-b229-a9b765d0863a/ssl_certificate \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "email_address": "jane@example.com", "given_name": "Jane", "family_name": "Doe", "region_code": "US", "state": "Texas", "city": "Austin", "phone": "800-123-4567" }'Submits an order for a Let’s Encrypt certificate for the specified domain on an install.
Limitations & Warnings
- Only for domains on the legacy network.
- Asynchronous: the order is accepted for processing, so the certificate isn’t available immediately.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of install
Example
294deacc-d8b8-4005-82c4-0727ba8ddde0ID of domain
Example
e41fa98f-ea80-4654-b229-a9b765d0863aRequest Bodyrequired
Section titled “Request Bodyrequired”Properties
- email_address - required - The certificate’s holder’s email address
- given_name - required - The certificate holder’s first / given name
- family_name - required - The certificate holder’s last / family name
- region_code - required - The two-letter ISO 3166-1 alpha-2 code for the certificate’s country
- state - optional - The certificate’s state / region
- city - optional - The certificate’s city / locality
- phone - optional - The certificate holder’s phone number
object
The certificate’s holder’s email address
Example
jane@example.comThe certificate holder’s first / given name
Example
JaneThe certificate holder’s last / family name
Example
DoeThe two-letter ISO 3166-1 alpha-2 code for the certificate’s country
Example
USThe certificate’s state/region
Example
TexasThe certificate’s city/locality
Example
AustinThe certificate holder’s phone number
Example
800-123-4567Responses
Section titled “Responses”Accepted. The order has been accepted for processing.
Bad Request
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
An array of error objects describing specific errors that arose when servicing the request
object
The name of the resource that was being processed when the error occurred
(Optional) The specific field associated with the error
(Optional) A type associated with the error. invalid_value, access_error, value_unavailable
(Optional) A machine code relating to the error that occurred with the field and resource
(Optional) A human-readable message relating to the error that occurred with the field and resource
Example
{ "message": "Invalid request.", "errors": [ { "resource": "Resource", "field": "field_name", "type": "invalid_value", "code": "invalid", "message": "The value is invalid." } ]}Authentication Error
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
Example
{ "message": "Bad Credentials"}Not authorized
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
Example
{ "message": "You don't have permission to perform that action"}Not found
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
Example
{ "message": "Not Found"}Too many requests
Internal Server Error
object
A message regarding the error that occurred on the server
Example
{ "message": "An unexpected error occurred, please try again in a few minutes"}Service unavailable