Get a disruption
const url = 'https://api.headcode.dev/v1/disruptions/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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://api.headcode.dev/v1/disruptions/example \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Disruption identifier, for example station_message:123 or train_alert:ABC.
Responses
Section titled “ Responses ”The requested disruption.
object
Darwin source concept, such as OW or trainAlert.
Example
{ "id": "train_alert:12345", "type": "station_message"}API key is missing or invalid.
Authentication is missing or invalid.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/unauthorized", "title": "Unauthorized", "status": 401, "detail": "missing or malformed Bearer token", "code": "HEADCODE.GENERAL.UNAUTHORIZED"}API key does not have the required scope.
The API key does not have the required scope.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/forbidden", "title": "Forbidden", "status": 403, "detail": "API key does not have the required scope 'reference:read'.", "code": "HEADCODE.GENERAL.FORBIDDEN"}Disruption not found.
No disruption matches the supplied identifier.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/disruptions/not-found", "title": "Disruption Not Found", "status": 404, "detail": "No disruption found for id 'station_message:123'.", "code": "HEADCODE.DISRUPTIONS.NOT_FOUND"}The client has exceeded its rate limit.
The client has sent too many requests in a given amount of time.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/rate-limited", "title": "Too Many Requests", "status": 429, "detail": "Rate limit exceeded. Please retry after 30 seconds.", "code": "HEADCODE.GENERAL.RATE_LIMITED"}An unexpected internal error occurred.
An internal error occurred.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/internal-server-error", "title": "Internal Server Error", "status": 500, "detail": "An internal error occurred.", "code": "HEADCODE.GENERAL.INTERNAL_SERVER_ERROR"}