Hang Tokens API

The Tokens API from Hang — 7 operation(s) for tokens.

Operations 7

GET /wallets/{wallet_address}/tokens Retrieve the tokens, if any, owned by a given wallet address. #
POST /tokens/{token_id}/add-trait Endpoint to add a trait to a token #
POST /tokens/{token_id}/remove-trait Endpoint to remove a trait from a token #
POST /tokens/{token_id}/set-token-image Endpoint to set a tokens image #
GET /tokens/{token_id}/level Retrieve the current level or tier, as well as earned points (XP) for a token. #
GET /tokens/{token_id}/loot-boxes Endpoint to fetch all loot boxes for a token #
POST /tokens/{token_id}/loot-boxes/{loot_box_id}/open Endpoint to open a loot box #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hang-tokens-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hang-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hang Partner API (params in:formData) Activities Tokens API
  description: '

    <p>The Partner API allows you to request various resources that can power your loyalty program.</p>

    &copy Hang 2023'
  version: 2023.09.07
  x-copyright: '&copy Hang 2023'
servers:
- url: /partner-api
security:
- ApiKeyAuth: []
tags:
- name: Tokens
paths:
  /wallets/{wallet_address}/tokens:
    get:
      tags:
      - Tokens
      operationId: get_wallets_wallet_address_tokens
      summary: Retrieve the tokens, if any, owned by a given wallet address.
      parameters:
      - name: wallet_address
        in: path
        required: true
        description: the wallet address
        schema:
          type: string
      responses:
        '200':
          description: Returns the array of tokens successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  tokens:
                    type: array
                    items:
                      type: object
                      properties:
                        tokens:
                          type: object
                          properties:
                            token_id:
                              type: string
                              description: the token id
                            image:
                              type: string
                              description: image url
                            traits:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    description: trait name
                                  value:
                                    type: string
                                    description: trait value
                                additionalProperties: false
                                required:
                                - name
                                - value
                            tier_metric_value:
                              type: number
                              description: the value earned towards the current tier
                            current_tier:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: uuid of the current tier
                                order:
                                  type: number
                                  description: indicates the placement order of the current tier in the program
                                tier_metric_minimum_threshold:
                                  type: string
                                  description: the minimum value required to reach this tier
                                display_name:
                                  type: string
                                  description: the name of the tier
                                marketing_benefit_text:
                                  type: string
                                  description: the marketing benefit text for the tier
                                primary_color:
                                  type: string
                                  description: the primary color for the tier used for branding purposes
                              additionalProperties: false
                              required:
                              - id
                              - order
                              - tier_metric_minimum_threshold
                              - display_name
                              - marketing_benefit_text
                              - primary_color
                          additionalProperties: false
                          required:
                          - token_id
                          - image
                          - traits
                          - tier_metric_value
                          - current_tier
                      additionalProperties: false
                      required:
                      - tokens
                additionalProperties: false
                required:
                - tokens
      description: Certain resources within the Partner API require a token id to be suppiled. This endpoint returns an array of token ids for a given wallet address.
  /tokens/{token_id}/add-trait:
    post:
      tags:
      - Tokens
      operationId: post_tokens_token_id_add-trait
      summary: Endpoint to add a trait to a token
      parameters:
      - name: token_id
        in: path
        required: true
        description: the token id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  token_id:
                    type: string
                    description: the token id
                  image:
                    type: string
                    description: image url
                  traits:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: trait name
                        value:
                          type: string
                          description: trait value
                      additionalProperties: false
                      required:
                      - name
                      - value
                additionalProperties: false
                required:
                - token_id
                - image
                - traits
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
          multipart/form-data:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
  /tokens/{token_id}/remove-trait:
    post:
      tags:
      - Tokens
      operationId: post_tokens_token_id_remove-trait
      summary: Endpoint to remove a trait from a token
      parameters:
      - name: token_id
        in: path
        required: true
        description: the token id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  token_id:
                    type: string
                    description: the token id
                  image:
                    type: string
                    description: image url
                  traits:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: trait name
                        value:
                          type: string
                          description: trait value
                      additionalProperties: false
                      required:
                      - name
                      - value
                additionalProperties: false
                required:
                - token_id
                - image
                - traits
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
          multipart/form-data:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
  /tokens/{token_id}/set-token-image:
    post:
      tags:
      - Tokens
      operationId: post_tokens_token_id_set-token-image
      summary: Endpoint to set a tokens image
      parameters:
      - name: token_id
        in: path
        required: true
        description: the token id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  token_id:
                    type: string
                    description: the token id
                  image:
                    type: string
                    description: image url
                  traits:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: trait name
                        value:
                          type: string
                          description: trait value
                      additionalProperties: false
                      required:
                      - name
                      - value
                additionalProperties: false
                required:
                - token_id
                - image
                - traits
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                image_url:
                  type: string
                  description: image url for the token
              required:
              - image_url
          multipart/form-data:
            schema:
              type: object
              properties:
                image_url:
                  type: string
                  description: image url for the token
              required:
              - image_url
  /tokens/{token_id}/level:
    get:
      tags:
      - Tokens
      operationId: get_tokens_token_id_level
      summary: Retrieve the current level or tier, as well as earned points (XP) for a token.
      parameters:
      - name: token_id
        in: path
        required: true
        description: the token id
        schema:
          type: number
      responses:
        '200':
          description: Returns details successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  level:
                    type: object
                    properties:
                      tier:
                        type: string
                        description: Tier name
                      balance:
                        type: number
                        description: XP balance
                    additionalProperties: false
                    required:
                    - tier
                    - balance
                additionalProperties: false
                required:
                - level
        '404':
          description: Could not find the token provided.
      description: Invoke this endpoint to return the tier and earned points (XP) for a given token id.
  /tokens/{token_id}/loot-boxes:
    get:
      tags:
      - Tokens
      operationId: get_tokens_token_id_loot-boxes
      summary: Endpoint to fetch all loot boxes for a token
      parameters:
      - name: token_id
        in: path
        required: true
        description: the token id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  allocated_loot_boxes:
                    type: array
                    items:
                      type: object
                      properties:
                        loot_box_id:
                          type: string
                          description: Unique identifier for the Lootbox object.
                        name:
                          type: string
                          description: Name/title of the Lootbox object.
                        description:
                          type: string
                          description: description of the Lootbox object.
                        available_since:
                          type: number
                          description: When the lootbox became available, in epoch seconds.
                        redeemed_at:
                          type: number
                          description: When the lootbox was opened, in epoch seconds.
                        allocated_reward_choice:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Unique identifier for the LootBoxRewardChoice object.
                            reward_uuid:
                              type: string
                              description: Unique identifier for the reward tied to the reward choice.
                            title:
                              type: string
                              description: A title for the LootBoxRewardChoice object.
                            subtitle:
                              type: string
                              description: A subtitle for the LootBoxRewardChoice object.
                            category:
                              type: string
                              description: A category for the LootBoxRewardChoice object.
                            point_reward_value:
                              type: number
                              description: The amount of points, or any tier metric (e.g. xp, points, stars, etc), the user has won.
                            image:
                              type: string
                              description: An absolute URL of the LootBoxRewardChoice's image.
                          additionalProperties: false
                          required:
                          - id
                          - reward_uuid
                          - title
                          - subtitle
                          - category
                          - point_reward_value
                          - image
                        reward_choices:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                description: Unique identifier for the LootBoxRewardChoice object.
                              reward_uuid:
                                type: string
                                description: Unique identifier for the reward tied to the reward choice.
                              probability:
                                type: number
                                description: The probability of winning the LootBoxRewardChoice.
                              title:
                                type: string
                                description: A title for the LootBoxRewardChoice object.
                              subtitle:
                                type: string
                                description: A subtitle for the LootBoxRewardChoice object.
                              category:
                                type: string
                                description: A category for the LootBoxRewardChoice object.
                            additionalProperties: false
                            required:
                            - id
                            - reward_uuid
                            - probability
                            - title
                            - subtitle
                            - category
                        loot_box_container_images:
                          type: object
                          properties:
                            box_together:
                              type: string
                              description: An absolute URL of the LootBox's closed container image.
                            box_top:
                              type: string
                              description: An absolute URL of the LootBox's container top image.
                            box_bottom:
                              type: string
                              description: An absolute URL of the LootBox's container bottom image.
                          additionalProperties: false
                          required:
                          - box_together
                          - box_top
                          - box_bottom
                      additionalProperties: false
                      required:
                      - loot_box_id
                      - name
                      - description
                      - available_since
                      - redeemed_at
                      - allocated_reward_choice
                      - reward_choices
                      - loot_box_container_images
                additionalProperties: false
                required:
                - allocated_loot_boxes
      description: ''
  /tokens/{token_id}/loot-boxes/{loot_box_id}/open:
    post:
      tags:
      - Tokens
      operationId: posttokens_token_id_loot-boxes_loot_box_id_open
      summary: Endpoint to open a loot box
      parameters:
      - name: loot_box_id
        in: path
        required: true
        description: the loot box id
        schema:
          type: string
      - name: token_id
        in: path
        required: true
        description: the token id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  loot_box_reward_outcome:
                    type: object
                    properties:
                      loot_box_reward_choice_id:
                        type: string
                        description: Unique identifier for the LootBoxRewardChoice object.
                      loot_box_reward_choice_title:
                        type: string
                        description: A title for the LootBoxRewardChoice object.
                      loot_box_reward_choice_subtitle:
                        type: string
                        description: A subtitle for the LootBoxRewardChoice object.
                      loot_box_reward_choice_category:
                        type: string
                        description: A category for the LootBoxRewardChoice object.
                      loot_box_reward_choice_point_reward_value:
                        type: number
                        description: The amount of points, or any tier metric (e.g. xp, points, stars, etc), the user has won.
                      loot_box_reward_choice_image:
                        type: string
                        description: An absolute URL of the LootBoxRewardChoice's image.
                      loot_box_sponsor_name:
                        type: string
                        description: Lootbox sponsor name.
                      loot_box_sponsor_description:
                        type: string
                        description: Lootbox sponsor description.
                      reward_uuid:
                        type: string
                        description: Unique identifier for the Reward object.
                      reward_name:
                        type: string
                        description: Reward name.
                      reward_description:
                        type: string
                        description: An arbitrary description attached to the Reward object. Often useful for displaying to users.
                      reward_image_url:
                        type: string
                        description: An absolute URL of the rewards's image.
                      reward_redemption_instruction:
                        type: string
                        description: The redmeption instructions for a reward.
                      reward_terms_and_conditions:
                        type: string
                        description: The terms and conditions for the reward.
                      reward_end_date:
                        type: string
                        description: The end date for the reward.
                      reward_store_discount_url:
                        type: string
                        description: The button url for the reward.
                    additionalProperties: false
                    required:
                    - loot_box_reward_choice_id
                    - loot_box_reward_choice_title
                    - loot_box_reward_choice_subtitle
                    - loot_box_reward_choice_category
                    - loot_box_reward_choice_point_reward_value
                    - loot_box_reward_choice_image
                    - loot_box_sponsor_name
                    - loot_box_sponsor_description
                    - reward_uuid
                    - reward_name
                    - reward_description
                    - reward_image_url
                    - reward_redemption_instruction
                    - reward_terms_and_conditions
                    - reward_end_date
                    - reward_store_discount_url
                additionalProperties: false
                required:
                - loot_box_reward_outcome
      description: ''
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key