Gateway Protocol
Services are provided in the form of APIs. The gateway protocol is a set of rules that facilitates message transmission between your application and Quantum Metal.
Message Structure
Messages consist of requests from the end client to Quantum Metal server and responses from Quantum Metal server to your application. This section describes the structure of requests and responses.
Request Structure
A request is a standard HTTP request, which is composed of Request-URI, method, header, and body. The following shows the structure of an HTTP request:
- Request URI, e.g.
https://{host}/v{majorVersion}/{path}
- HTTP Method, e.g.
POST
- HTTP Headers
Content-Type: application/json
Key
: Your API key.Sign
: Signature of the request message.
- HTTP Body
Request URI
The format of the request URI is https://{host}/v{majorVersion}/{path}
, where
- host: The host of the API.
- majorVersion: The major version of the API. The current major version is 1.
- path: The path of the API. For example,
bill/create
.
Request Headers
The request headers contains additional information about the request. In Quantum Metal's gateway protocol, the following headers are required:
Content-Type (Required)
The Content-Type
header specifies the format of the request body. The value of the Content-Type
header must be application/json
.
Key (Required)
The Key
header specifies your API key. The value of the Key
header is your API key. Refer to Authenticate for more information.
Sign (Required)
The Sign
header specifies the signature of the request message. The value of the Sign
header is the signature of the request message. Refer to Message Signing for more information.