Wait for a request's outcome (SSE)
const url = 'https://example.com/api/certs/requests/example/events';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/certs/requests/example/eventsA real text/event-stream, separate from the creating POST because an
EventSource-style client is GET-only. Safe to reconnect any number of
times.
The SSE event name carries the terminal status (approved, denied,
expired, enrolled, failed); each event’s data is an envelope whose
data half carries the certificate, or the enrollment code together with
the service account it was approved for and when the code expires. That
shape is not in this document: the response body is a stream rather than
JSON, so there is nowhere to declare a schema for what individual events
carry.
Unauthenticated: the request ID is the credential.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The certificate request’s UUID
Responses
Section titled “Responses”The stream, closed after one terminal event
No such request
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
Example
certificate request "9f1c…" not foundErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
not_foundThe certificate was issued but is no longer available. They are never persisted, so a client that missed delivery must re-request.
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
Example
certificate request "9f1c…" not foundErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
not_foundThis instance is shutting down. The request is still pending: reconnect.
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
Example
certificate request "9f1c…" not foundErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
not_found