Synadia Cloud

HTTP Gateway

A first-class HTTP interface for NATS.

The KV Store API is currently available in preview to all users.

Connecting

The HTTP Gateway is exposed via a standard endpoint over HTTPS https://api.ngs.global. Refer to the interactive OpenAPI Spec for details on the available endpoints and methods.

An HTTP Gateway token is required to connect and is scoped to a User within an Account. This can be ontained through the user interface or through the Synadia Cloud API.

User Interface

To obtain a token through the user interface, go to a specific User page and click the "Get Connected" dropdown and click on the "HTTP Gateway" dialog to generate the token.

To obtain an HTTP Gateway token through the Synadia Cloud API, you can use the OpenAPI interface or use an HTTP client to make the request.

curl -X POST -H "Accept: application/json" \
    "https://cloud.synadia.com/api/core/beta/nats-users/{userId}/http-gw-token"

Where {userId} is the ID of the User you want to generate the token for.

The token will look something like this:

nhg_2DDZKG2rmX7HBhETu_2ZapvJoSwwrs9JibstLG6d7cUW1p6RYSXF68hCTLqgFX

You can confirm it works by trying it out with any standard HTTP client such as curl:

curl -H "Authorization: Bearer <API_TOKEN>" \
    https://api.ngs.global/v1/kvm/buckets

If there are existing KV buckets in your account, you will see them listed, otherwise the response will be an empty array.

Token Management

It is recommended to create dedicated Users for applications that will be using the HTTP Gateway, separate from the NATS-centric applications. A User provides the ability to set permissions and expiry as well as rotate and revoke the associated credentials.

API Reference

Refer to the full OpenAPI Reference for more details on the available endpoints and methods.

Previous
Placement Tags