Protokol
  • Introduction To Digital Assets
  • Tutorials
    • How To Create Digital Assets
    • How To Trade Digital Assets
  • ARK CORE MODULES
    • NFT
      • Development
      • Complementary Examples
        • Base
        • Exchange
      • API Endpoints
        • Assets
        • Burns
        • Collections
        • Transfers
        • Base Configurations
        • Auctions
        • Bids
        • Trades
        • Exchange Configurations
    • Guardian
      • Development
      • Complementary Examples
      • API Endpoints
        • Configurations
        • Groups
        • Users
    • Nameservice
      • Development
      • Complementary Examples
      • API Endpoints
        • Configurations
        • Nameservice
    • Voting
      • Development
      • Complementary Examples
      • API Endpoints
        • Configurations
        • Create Proposal
        • Cast Vote
        • Statistics
  • Protokol Templates
    • Core Starter Kit
    • Solidity Typescript Hardhat
    • Nestjs
Powered by GitBook
On this page
  • Users
  • /users
  • Examples
  • User By Publickey
  • /users/:id
  • Examples
  • User Groups
  • /users/:id/groups
  • Examples

Was this helpful?

  1. ARK CORE MODULES
  2. Guardian
  3. API Endpoints

Users

Guardian Users Endpoints

Users

/users

GET https://explorer.protokol.sh/api/guardian/users

Returns all Groups

Query Parameters

Name
Type
Description

page

integer

The number of a page that will be returned

limit

integer

The number of resources per page

publickey

string

Value by which it searches for resources (allows wildcard %)

{
  "meta": {
    "totalCountIsEstimate": false,
    "count": 2,
    "pageCount": 1,
    "totalCount": 2,
    "next": null,
    "previous": null,
    "self": "/guardian/groups?page=1&limit=100",
    "first": "/guardian/groups?page=1&limit=100",
    "last": "/guardian/groups?page=1&limit=100"
  },
  "data": [
    {
      "name": "Test Guardian Permission Group",
      "priority": 1,
      "active": true,
      "default": false,
      "allow": [
        {
          "transactionType": 1,
          "transactionTypeGroup": 1
        }
      ],
      "deny": [
        {
          "transactionType": 2,
          "transactionTypeGroup": 1
        }
      ]
    },
    {
      "name": "Test Guardian Permission Group2",
      "priority": 1,
      "active": true,
      "default": false,
      "allow": [
        {
          "transactionType": 1,
          "transactionTypeGroup": 1
        }
      ],
      "deny": [
        {
          "transactionType": 2,
          "transactionTypeGroup": 1
        }
      ]
    }
  ]
}

Examples

curl https://explorer.protokol.sh/api/guardian/users
const response = await connection.guardianApi("users").index();

>>> Promise<ApiResponseWithPagination<User>>

User By Publickey

/users/:id

GET https://explorer.protokol.sh/api/guardian/users/:id

Returns User by publickey

Path Parameters

Name
Type
Description

name

string

The name of the group

{
  "data": {
    "publicKey": "03c11f2a1fc02c88cd9b8db5272cba390bdb9ce3e1d58355de1b7a24c673e06ebc",
    "groups": [
      "Test Guardian Permission Group"
    ],
    "allow": [
      {
        "transactionType": 2,
        "transactionTypeGroup": 1
      }
    ],
    "deny": []
  }
}
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "User not found"
}
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 66 characters long"
}

Examples

curl https://explorer.protokol.sh/api/guardian/users/03c11f2a1fc02c88cd9b8db5272cba390bdb9ce3e1d58355de1b7a24c673e06ebc
const response = await connection.guardianApi("users").get("PUBLIC_KEY");

>>> Promise<ApiResponse<User>>

User Groups

/users/:id/groups

GET https://explorer.protokol.sh/api/guardian/users/:id/groups

Returns groups of specific user by publickey

Path Parameters

Name
Type
Description

name

string

The name of the group

{
  "data": [
    {
      "name": "Test Guardian Permission Group",
      "priority": 1,
      "active": true,
      "default": false,
      "allow": [
        {
          "transactionType": 1,
          "transactionTypeGroup": 1
        }
      ],
      "deny": [
        {
          "transactionType": 2,
          "transactionTypeGroup": 1
        }
      ]
    }
  ]
}
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "User not found"
}
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 66 characters long"
}

Examples

curl https://explorer.protokol.sh/api/guardian/users/03c11f2a1fc02c88cd9b8db5272cba390bdb9ce3e1d58355de1b7a24c673e06ebc/groups
const response = await connection.guardianApi("users").userGroups("PUBLIC_KEY");

>>> Promise<ApiResponse<UserGroups>>
PreviousGroupsNextNameservice

Last updated 3 years ago

Was this helpful?