License-API

Basic license based authentication API with discord account integration. Built with Golang’s Gofiber framework and MySQL. API will auto initialize a database with the necessary tables.

Table of Contents

Endpoints

User Endpoints

Endpoints to be used in bot/discord bot for basic authentication

Key Activation

POST /key/activate

Used for binding a key to a discord ID. Key must be unbinded and not authenticated on any IP addresses.

Payload:

Parameter Type Description
key string User Key
discordID string User Discord ID

Expected Response:

{
    "status": "success", 
    "message": "Key Activated", 
    "data": ""
}

Key Authentication

POST /key/auth

Used for binding a key to an IP. Key must not be authenticated on any IP addresses.

Payload:

Parameter Type Description
key string User Key
ip string User Discord ID

Expected Response:

{
    "status": "success", 
    "message": "Key/IP Authenticated", 
    "data": ""
}

Key Unauthentication

POST /key/unauth

Used for unbinding a key to an IP. Key must be authenticated on an IP address.

Payload:

Parameter Type Description
key string User Key
discordID string User Discord ID

Expected Response:

{
    "status": "success", 
    "message": "Key/IP Unauthenticated", 
    "data": ""
}

Admin Endpoints

Private endpoints to be used by admin to interact with keys.

Secret Admin Key: TEMPKEY123

Key Creation

POST /key/admin/create

Used for binding a key to a discord ID. Key must be unbinded and not authenticated on any IP addresses.

Payload:

Parameter Type Description
count int Number of Keys to Create
auth string Secret Admin Key

Expected Response:

{
    "status": "success", 
    "message": "Generated Keys", 
    "keys": ["key1", "key2"], 
    "data": ""
}

Key Deletion

POST /key/admin/delete

Deletes the specified key along with all the data bound to it.

Payload:

Parameter Type Description
key string User Key
auth string Secret Admin Key

Expected Response:

{
    "status": "success", 
    "message": "Deleted Key", 
    "data": ""
}

Key Unauthentication

POST /key/admin/view

Gets all related data to the specified key

Payload:

Parameter Type Description
key string User Key
auth string Secret Admin Key

Expected Response:

{
    "status": "success", 
    "message": "Key Found", 
    "keyInfo": {
        "Id": 0,
        "License": "String",
        "Ip": "String",
        "DiscordID": "String"
    }, 
    "data": ""
}

GitHub

View Github