Authorization Headers

Each request to the API (Cloud-API and Gateway-API) should include an Authorization header. The Authorization header used for the Cloud-API is different from the Gateway-API.

Get the Cloud-API Authorization Header from the Account Portal

For convenience, clients can find the Authorization Header under Account Details in the Account Portal and use it to send transactions and check account quota.

Reconstruct Authorization Header from the Parameters

REQUEST

Parameters

Gateway-API
Cloud-API
Gateway-API

Parameter

Description

rpc_user

RPC username in case gateway was started with

rpc_password

RPC password in case gateway was started with

Cloud-API

Parameter

Description

Account ID

Account ID received when registering the account

Secret hash

Secret hash received when registering the account

Examples

Gateway-API
Cloud-API
Gateway-API

Authorization header construction code example in Python:

import base64
base64.b64encode(f"{rpc_user}:{rpc_password}".encode("utf-8")).decode("utf-8")
​
Cloud-API

Authorization header construction code example in Python:

import base64
base64.b64encode(f"{account_id}:{secret_hash}".encode("utf-8")).decode("utf-8")
​

Note

Authorization header is not required for gateway started without --rpc-user and --rpc-password.

RESPONSE

Result Field

Description

Authorization

Your authorization header.

Examples

Gateway-API
Cloud-API
Gateway-API

​

MDM0ZmYwMGEtNmRkNy00YmEyLThlY2MtY2IzYjJjYjA1ODhlOjBkYTkyZmY0YmMzODA0MzRlZTY4YWY1N2I1OTU0ZmQ4
​
Cloud-API

​

NzQ4NGJmNzktYzgxMy00NDNkLTljOWQtMDY5MGRlZWFlODNhOjFjNzEzYTMwNDlhMTM4YjE5YzVhNjhkOWUyY2U4MjZm
​