Gateway API

The Gateway Protocol API (“API”) gives developers access to all aspects of the PDA. Developers can use the API to Authenticate users, define Data Models, and essential Create, Read, Update, and Delete functionality.

The API is a RESTful API and can be accessed via the Swagger documentation and the documentation on this site directly.

Postman Collection

Check out the Postman collection here to get started with the API or use the button below to open the collection directly Postman App.

Run In Postman


Keep In Mind

Here are some things you need to know before you start using the API:

  • All the data that you would be storing on the Gateway Protocol is stored as Data Assets.
  • The data is encrypted as soon as the data asset is issued. Encryption part of the creation process. At all times, the data is fully encrypted. Only the data owner can decrypt the data which is a process that happens entirely on the client-side.
  • It is strongly encouraged to have a (Data Model)[/core-concepts/data-models] in place before you start using the API. The Data Model is a schema that defines the structure of the data that you would be storing on the Gateway Protocol.
  • Once data assets are issued to your users, you can start interacting with the data assets using the API for requesting data, updating data, and more.

Data Model Structure

Data Models are structured in JSON format. JSON Schema is fully supported and there are additional contextual fields added to help make the data more readable and useable. Each Data Model is signed with the creator’s signing key to establish provenance and verifiability.

{
  "type": "object",
  "title": "Gateway ID",
  "default": {},
  "required": [],
  "properties": {
    "name": {
      "type": "string",
      "title": "Name"
    },
    "email": {
      "type": "string",
      "title": "E-mail"
    },
    "avatar": {
      "type": "string",
      "title": "Avatar",
      "contentMediaType": "image/png"
    },
    "username": {
      "type": "string",
      "title": "Username"
    },
    "evmWallet": {
      "type": "string",
      "title": "EVM Wallet"
    },
    "solanaWallet": {
      "type": "string",
      "title": "Solana Wallet"
    }
  },
  "additionalProperties": false
}

Read more about creating Data Models with the API here.