Information Requests

Requesting the API Version or Spec.

Overview

Information Requests are basic requests used to obtain information about the API and its endpoints. Unlike all other requests, Information Requests do not require an API key to be provided to complete the request. The two types of information requests are the Version and Spec requests, both are dependent on utilizing the API's OpenAPI Specification (spec.yaml), also called the API Spec, in order to successfully complete the request.


Version Request

The Version Request, a GET request sent to the /version endpoint, is a request used to obtain the current version of Sagittarius A* as recorded within the API Spec. The version information is read from the API Spec by the request handler and then returned in the output.

Version Request
curl https://api.sgr-a.xyz/version

When a Version Request completes successfully, the returned output will be in JSON format, and contain the current version of Sagittarius A*.

Version Output
{
    "version": "0.2.0"
}

API Spec Request

The API Spec Request, a GET request sent to the /spec endpoint, is a request used to obtain a copy of the API's current OpenAPI Specification. The entire API Spec is read from spec.yaml by the request handler and then returned in the output.

API Spec Request
curl https://api.sgr-a.xyz/spec

When an API Spec Request completes successfully, the returned output will contain the a copy of the entire API Spec that has been converted into JSON format from the YAML.

API Spec Output
{
    "openapi": "3.0.0",
    "info": {
        "title": "Sagittarius A*",
        "version": "0.2.0"
    },
    "paths": {
        "/version": {
            "get": {
                "summary": "Get the Sagittarius A* version number."
            }
        },
        "/spec": {
            "get": {
                "summary": "Outputs this spec.yaml in JSON format."
            }
        }
    }
}

Last updated