Subtopia GPT

Subtopia GPT · GPT Actions

Subtopia API

Official Subtopia API

  • GET /Root

    Root endpoint

  • GET /api/v1/subscription/recordGet Subscription Record

    Endpoint to get the subscription record for a subscriber address and product_id. Please note expires_at is optional and will be set to null if this subscription is of time Unlimited.

  • GET /api/v1/subscription/is-activeGet Is Active Subscriber

    Endpoint to check if the given address and product_id correspond to an active subscriber. Returns True if the subscriber is active, False otherwise.

原始 API 定义
{
  "openapi": "3.1.0",
  "info": {
    "title": "Subtopia API",
    "description": "Official Subtopia API",
    "version": "0.1.0",
    "x-logo": {
      "url": "https://bafybeiejhb5sjwic7cczncfv2xur5ig7m7ktqziojovbopsaxrdmxe7pwq.ipfs.nftstorage.link/"
    }
  },
  "servers": [
    {
      "url": "https://api.subtopia.io"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "Root",
        "description": "Root endpoint",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/subscription/record": {
      "get": {
        "summary": "Get Subscription Record",
        "description": "Endpoint to get the subscription record for a subscriber address and product_id.\nPlease note expires_at is optional and will be set to null if this\nsubscription is of time Unlimited.",
        "operationId": "get_subscription_record_api_v1_subscription_record_get",
        "parameters": [
          {
            "name": "subscriber_address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Subscriber Address"
            }
          },
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Product Id"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ChainType"
                }
              ],
              "default": "testnet",
              "title": "Chain"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionRecord"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscription/is-active": {
      "get": {
        "summary": "Get Is Active Subscriber",
        "description": "Endpoint to check if the given address and product_id correspond to an\nactive subscriber.\nReturns True if the subscriber is active, False otherwise.",
        "operationId": "get_is_active_subscriber_api_v1_subscription_is_active_get",
        "parameters": [
          {
            "name": "subscriber_address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Subscriber Address"
            }
          },
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Product Id"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ChainType"
                }
              ],
              "default": "testnet",
              "title": "Chain"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "title": "Response Get Is Active Subscriber Api V1 Subscription Is Active Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChainType": {
        "type": "string",
        "enum": [
          "mainnet",
          "testnet"
        ],
        "title": "ChainType",
        "description": "Enum representing the type of blockchain network."
      },
      "Duration": {
        "type": "integer",
        "enum": [
          0,
          2592000,
          7776000,
          15552000,
          31536000
        ],
        "title": "Duration",
        "description": "Enum representing the duration of the subscription in seconds."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "SubscriptionRecord": {
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "duration": {
            "$ref": "#/components/schemas/Duration"
          },
          "sub_id": {
            "type": "integer",
            "title": "Sub Id"
          },
          "sub_type": {
            "$ref": "#/components/schemas/SubscriptionType"
          }
        },
        "type": "object",
        "required": [
          "created_at",
          "expires_at",
          "duration",
          "sub_id",
          "sub_type"
        ],
        "title": "SubscriptionRecord",
        "description": "Model representing the subscription record."
      },
      "SubscriptionType": {
        "type": "integer",
        "enum": [
          0,
          1,
          2
        ],
        "title": "SubscriptionType",
        "description": "Enum representing the type of subscription."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}