- API-Referenz
- Domain
- Create a CertificateRequest
Create a CertificateRequest
Request
- Alternativeobject
- certificatestringrequired
- privateKeystringrequired
- projectIdstring (uuid)required
- Alternativeobject
- commonNamestringrequired
- contactobjectrequired
- citystring
- companystring
- countrystring
Two letter abbreviation - country code (ISO 3166-1 Alpha-2).
- organizationalUnitstring
- statestring
- projectIdstring (uuid)required
- Alternativeobject
- commonNamestringrequired
- projectIdstring (uuid)required
Content-Type: application/json
{
"certificate": "string",
"privateKey": "string",
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
Content-Type: application/json
{
"commonName": "string",
"contact": {
"city": "string",
"company": "string",
"country": "DE",
"organizationalUnit": "string",
"state": "string"
},
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
Content-Type: application/json
{
"commonName": "string",
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"oneOf": [
{
"additionalProperties": false,
"properties": {
"certificate": {
"type": "string"
},
"privateKey": {
"type": "string"
},
"projectId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"projectId",
"certificate",
"privateKey"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"commonName": {
"type": "string"
},
"contact": {
"properties": {
"city": {
"type": "string"
},
"company": {
"type": "string"
},
"country": {
"description": "Two letter abbreviation - country code (ISO 3166-1 Alpha-2).",
"example": "DE",
"pattern": "^[A-Z]{2}$",
"type": "string"
},
"organizationalUnit": {
"type": "string"
},
"state": {
"type": "string"
}
},
"type": "object"
},
"projectId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"projectId",
"commonName",
"contact"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"commonName": {
"type": "string"
},
"projectId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"projectId",
"commonName"
],
"type": "object"
}
]
}
Responses
Created
- commonNamestring
- contactobject
- citystring
- companystring
- countrystring
Two letter abbreviation - country code (ISO 3166-1 Alpha-2).
- organizationalUnitstring
- statestring
- dnsNamesArray von string
- Array[
- *string
]
- idstring (uuid)required
- issuerstring
- signingRequeststring
- validFromstring (date-time)
- validTostring (date-time)
Content-Type: application/json
{
"commonName": "string",
"contact": {
"city": "string",
"company": "string",
"country": "DE",
"organizationalUnit": "string",
"state": "string"
},
"dnsNames": [
"string"
],
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"issuer": "string",
"signingRequest": "string",
"validFrom": "1985-10-26T01:21:00.000Z",
"validTo": "1985-10-26T01:21:00.000Z"
}
{
"properties": {
"commonName": {
"type": "string"
},
"contact": {
"properties": {
"city": {
"type": "string"
},
"company": {
"type": "string"
},
"country": {
"description": "Two letter abbreviation - country code (ISO 3166-1 Alpha-2).",
"example": "DE",
"pattern": "^[A-Z]{2}$",
"type": "string"
},
"organizationalUnit": {
"type": "string"
},
"state": {
"type": "string"
}
},
"type": "object"
},
"dnsNames": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"issuer": {
"type": "string"
},
"signingRequest": {
"type": "string"
},
"validFrom": {
"format": "date-time",
"type": "string"
},
"validTo": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
An unexpected Error that occurred while handling the request
- messageeine von 18 Alternativenrequired
- Alternative"certificate_read_failed"
Failed to read the certificate.
- *"certificate_read_failed"
Failed to read the certificate.
- Alternative"certificate_decode_failed"
Failed to decode the certificate.
- *"certificate_decode_failed"
Failed to decode the certificate.
- Alternative"certificate_parsing_failed"
An error occurred while parsing the certificate.
- *"certificate_parsing_failed"
An error occurred while parsing the certificate.
- Alternative"certificate_self_signed"
The certificate is self-signed.
- *"certificate_self_signed"
The certificate is self-signed.
- Alternative"certificate_not_authorized_to_sign"
The certificate is not authorized to sign.
- *"certificate_not_authorized_to_sign"
The certificate is not authorized to sign.
- Alternative"certificate_expired"
The certificate has expired.
- *"certificate_expired"
The certificate has expired.
- Alternative"ca_not_authorized_for_this_name"
The Certificate Authority (CA) is not authorized for this name.
- *"ca_not_authorized_for_this_name"
The Certificate Authority (CA) is not authorized for this name.
- Alternative"too_many_intermediates"
There are too many intermediate certificates.
- *"too_many_intermediates"
There are too many intermediate certificates.
- Alternative"incompatible_usage"
The certificate's usage is incompatible.
- *"incompatible_usage"
The certificate's usage is incompatible.
- Alternative"unknown_authority"
The certificate is signed by an unknown authority.
- *"unknown_authority"
The certificate is signed by an unknown authority.
- Alternative"private_key_read_failed"
Failed to read the private key.
- *"private_key_read_failed"
Failed to read the private key.
- Alternative"private_key_decode_failed"
Failed to decode the private key.
- *"private_key_decode_failed"
Failed to decode the private key.
- Alternative"private_key_parse_failed"
An error occurred while parsing the private key.
- *"private_key_parse_failed"
An error occurred while parsing the private key.
- Alternative"private_key_encrypted"
The private key is encrypted.
- *"private_key_encrypted"
The private key is encrypted.
- Alternative"private_key_not_rsa"
The private key is not RSA.
- *"private_key_not_rsa"
The private key is not RSA.
- Alternative"private_key_mismatch"
The private key does not match the certificate.
- *"private_key_mismatch"
The private key does not match the certificate.
- Alternative"unknown_cloudflare_error"
An unknown error occurred related to Cloudflare.
- *"unknown_cloudflare_error"
An unknown error occurred related to Cloudflare.
- Alternative"unknown"
An unknown error occurred.
- *"unknown"
An unknown error occurred.
Content-Type: application/json
{
"message": "certificate_read_failed"
}
{
"properties": {
"message": {
"oneOf": [
{
"description": "Failed to read the certificate.",
"enum": [
"certificate_read_failed"
],
"type": "string"
},
{
"description": "Failed to decode the certificate.",
"enum": [
"certificate_decode_failed"
],
"type": "string"
},
{
"description": "An error occurred while parsing the certificate.",
"enum": [
"certificate_parsing_failed"
],
"type": "string"
},
{
"description": "The certificate is self-signed.",
"enum": [
"certificate_self_signed"
],
"type": "string"
},
{
"description": "The certificate is not authorized to sign.",
"enum": [
"certificate_not_authorized_to_sign"
],
"type": "string"
},
{
"description": "The certificate has expired.",
"enum": [
"certificate_expired"
],
"type": "string"
},
{
"description": "The Certificate Authority (CA) is not authorized for this name.",
"enum": [
"ca_not_authorized_for_this_name"
],
"type": "string"
},
{
"description": "There are too many intermediate certificates.",
"enum": [
"too_many_intermediates"
],
"type": "string"
},
{
"description": "The certificate's usage is incompatible.",
"enum": [
"incompatible_usage"
],
"type": "string"
},
{
"description": "The certificate is signed by an unknown authority.",
"enum": [
"unknown_authority"
],
"type": "string"
},
{
"description": "Failed to read the private key.",
"enum": [
"private_key_read_failed"
],
"type": "string"
},
{
"description": "Failed to decode the private key.",
"enum": [
"private_key_decode_failed"
],
"type": "string"
},
{
"description": "An error occurred while parsing the private key.",
"enum": [
"private_key_parse_failed"
],
"type": "string"
},
{
"description": "The private key is encrypted.",
"enum": [
"private_key_encrypted"
],
"type": "string"
},
{
"description": "The private key is not RSA.",
"enum": [
"private_key_not_rsa"
],
"type": "string"
},
{
"description": "The private key does not match the certificate.",
"enum": [
"private_key_mismatch"
],
"type": "string"
},
{
"description": "An unknown error occurred related to Cloudflare.",
"enum": [
"unknown_cloudflare_error"
],
"type": "string"
},
{
"description": "An unknown error occurred.",
"enum": [
"unknown"
],
"type": "string"
}
]
}
},
"required": [
"message"
],
"type": "object"
}
The requested resource was not found
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-X POST \
-d '{"certificate":"string","privateKey":"string","projectId":"f0f86186-0a5a-45b2-aa33-502777496347"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/certificate-requests
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.domain.sslCreateCertificateRequest({
"data": {
"certificate": "string",
"privateKey": "string",
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\Domain\SslCreateCertificateRequest\SslCreateCertificateRequestRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Domain\SslCreateCertificateRequest\SslCreateCertificateRequestRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// SslCreateCertificateRequestRequestBody to learn how to construct a valid instance
$body = new SslCreateCertificateRequestRequestBody(/* TODO: ... */);
$request = (new SslCreateCertificateRequestRequest(
body: $body
));
$response = $client->domain()->sslCreateCertificateRequest($request);
var_dump($response->getBody();