CloudServices/Sagrada/ServiceDiscovery/API

From MozillaWiki
Jump to navigation Jump to search

This API has a single method. It could, optionally, be unnamed, we should discuss that.


GET /discover

This is a straightforward GET call, returning a JSON object containing all relevant data.

GET https://directory.services.mozilla.com/discover

HTTP Response Codes

200 Success
404 Resource not found (clients should treat this as a configuration error)
503 Service Unavailable, clients should respect Retry-After if provided, otherwise should retry no more than once per 15 minutes.

Response Object Format

There are two top-level objects, services and urls. services contains the full set of available services, with per-API-version authentication endpoints. urls is for non-service URLs, such as ToS/PP links, and any other non-service URLs that may be necessary/needed for clients.

{
   "services": {
       "simple_storage": {
           "2.0": "https://token.services.mozilla.com/simple_storage/2.0",
           "2.1": "https://token.services.mozilla.com/simple_storage/2.1"
       },
       "durable_storage": {
           "1.0": "https://token.services.mozilla.com/durable_storage/1.0"
       }
   },
   "urls": {
       "privacy_policy": "https://services.mozilla.com/pp/",
       "terms_of_service": "https://services.mozilla.com/tos/"
   }
}