Bondy Connect
Skip to content

API Gateway ​

The Admin HTTP API routes that load, inspect and remove API Gateway specifications.

Each route calls one procedure of the API Gateway WAMP API. That page is the contract for what each operation does and how it fails. This page gives the routes and what is particular to HTTP. The request and error mapping that every Admin HTTP API route shares is in Admin HTTP API.

Routes ​

MethodPathWAMP procedure
POST/api_specsbondy.http_gateway.api.load
POST/services/load_api_specbondy.http_gateway.api.load
GET/api_specsbondy.http_gateway.api.list
GET/api_specs/:idbondy.http_gateway.api.get
GET/api_specs/:id/infobondy.http_gateway.api.get
DELETE/api_specs/:idbondy.http_gateway.api.delete

The two POST routes are equivalent.

Loading a specification ​

The request body is the specification, as JSON. A successful load answers with an empty body.

bash
curl -X POST "http://localhost:18081/api_specs" \
  -H 'Content-Type: application/json; charset=utf-8' \
  --data-binary "@my_api.json"

A specification that fails validation answers with the error as the JSON body, with code set to the error URI. The status follows from the URI:

ErrorStatus
bondy.error.missing_required_value400
wamp.error.invalid_argument400
bondy.error.invalid_value400
bondy.error.http_gateway.invalid_expression500
bondy.error.internal_error500

The load errors say when each one occurs.

Reading specifications ​

GET /api_specs/:id answers with the stored specification. GET /api_specs answers with an array of every stored specification.

GET /api_specs/:id/info answers with a summary of the stored specification: the properties id, name, host and realm_uri, and meta and ts when the specification has them. The summary leaves out the versions and paths.

bash
curl "http://localhost:18081/api_specs/com.market.demo/info"
json
{
  "host": "_",
  "id": "com.market.demo",
  "meta": {},
  "name": "Marketplace Demo API",
  "realm_uri": "com.market.demo"
}

A GET for an id that is not stored answers 404, with code set to bondy.error.not_found.

Deleting a specification ​

DELETE /api_specs/:id deletes the specification and stops serving its paths. It succeeds whether or not the id is stored.

bash
curl -X DELETE "http://localhost:18081/api_specs/com.market.demo"