Setting up and Managing a Gate

Setting up the Identity API to gate access

Creating Gates

Setting up a gate is easy with the *postGate endpoint. The values passed into the endpoint are the name, type and signInMode.

The response from the endpoint has a vital key-value pair called secretKey. Please keep this value safe.

Example Request

KeyDescription
NameName of the gate
TypeType of authentication. Set to web3 by default
signInModeAmount of tokens needed to be held to authenticate

Example Response

KeyDescription
idid of the transaction
namename of the gate
clientIdunique GUID of the client as sent in from publishing API
secretKeygenerated as a response to gate creation and used for JWT token authenticity verification
typesame as Type in request
signInModeAmount of tokens needed to be held to authenticate

👍

Create a new secretKey for a given Gate

We assume that you have kept your gate id secretKey for authentication: this is pretty important as it is what is going to convert the JWT token passed from the backend to data your application can read. If this secretKey wasn't saved, please use the *gates/{id}/secret endpoint to generate a new one.

Managing a Gate

Managing a gate can be done with the following endpoints:

  1. Get a Specific Gate by Id
  2. Delete a given gate by gate Id
  3. Get all the gates from the client

Get a Specific Gate by Id

This endpoint takes in the gateId as its request body and returns a JSON object of the gate characteristics as its response body. The response is shaped like this

KeyDescription
idid of the transaction
nameName of the gate
clientIdUnique GUID of the client as sent in from publishing API
secretKeyGenerated as a response to gate creation and used for JWT token authenticity verification
typeType of authentication. Set to web3 by default
signInModeAmount of tokens needed to be held to authenticate

Delete a given gate by gateId

This endpoint allows the developer to delete an already created gate. It accepts the id of the transaction and returns a statusCode of 0 when the operation is successful.

❗️

Similarities in success and failure

Success and failure JSON responses from this endpoint are similar in structure. Please be sure the endpoint returns a value that you want to use.

Get all the gates from the client

The endpoint returns all the gates set up in an environment in an array of JSON objects. It is a GET request with no values passed in as a request body. The returned value should look like this