Skip to content

REST API

Tatsuro Shibamura edited this page Aug 2, 2023 · 11 revisions

If you only want to use the API externally, disable App Service Authentication and use the Azure Functions Host Key to execute the API.

Common Headers

  • X-Functions-Key
    • Functions Host Key
  • Content-Type
    • application/json

Issue Certificate

Request

POST /api/certificate

Payload

{
  "DnsNames": ["contoso.com", "www.contoso.com"]
}

Response

202 Accepted
Location: /api/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
400 Bad Request

{
  "errors": {
    "DnsNames": [
      "The DnsNames is required."
    ]
  },
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "traceId": "00-e2468d29d2988e4490e92e2768b622b0-92d30024b7066e4d-00"
}
401 Unauthorized

Renew Certificate

Request

POST /api/certificate/{certificate-name}/renew

Response

202 Accepted
Location: /api/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
401 Unauthorized

Revoke Certificate

Request

POST /api/certificate/{certificate-name}/revoke

Response

202 Accepted
Location: /api/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
401 Unauthorized

Async request polling

Request

GET /api/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Response

200 OK
202 Accepted
Location: /api/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
500 Internal Server Error