Mark domain as primary.
POST
/v1/accounts/{account}/apps/{app}/environments/{environment}/domainMappings/{domain}:markPrimary
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/domainMappings/example:markPrimary"
payload := strings.NewReader("{}")
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://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/domainMappings/example:markPrimary';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{}'};
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://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/domainMappings/example:markPrimary \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{}'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”account
required
string
Name of your WP Engine Headless Platform account
app
required
string
Name of your Headless Platform application
environment
required
string
ID of your environment
domain
required
string
Domain name of the domain associated with the environment by this DomainMapping Must be a valid domain name as defined in RFC-1123
Request Body
Section titled “Request Body”Media typeapplication/json
Request to set domain mapping as primary
object
Examplegenerated
{}Responses
Section titled “Responses”A successful response.
Media typeapplication/json
Response of MakePrimaryDomainMappingRequest
For now we don't have feedback from this operation
The response is defined as empty message
Following AIP-151 (https://google.aip.dev/151)
object
Examplegenerated
{}