๐Ÿ‘จโ€๐Ÿ’ป
Stef's API
  • ๐Ÿ’ปGeneral information
  • Reference
    • ๐ŸฑGattinhosBot
      • ๐ŸŒŸGuild Features
      • ๐Ÿ‘ฅGuild Users
    • ๐ŸงพReceiptData
      • ๐ŸŽตLast.FM
      • ๐ŸŽถSpotify
Powered by GitBook
On this page
  • Get guild's user leveling data
  • Examples

Was this helpful?

  1. Reference
  2. GattinhosBot

Guild Users

This endpoint requires an API key. If you don't have one, you can get one by using the bot's slash command /apikey generate

The API key owner must have the Administrator permission in the selected guild to be able to get its data

Get guild's user leveling data

GET https://api.stefdp.com/gattinhosBot/guilds/{guild_id}/users/{user_id}

Path Parameters

Name
Type
Description

guild_id*

String

The ID of the guild

user_id

String

The ID of the user

Headers

Name
Type
Description

Authorization*

String

Bearer <API_KEY>

Returns an array with the objects of each user who sent atleast one message after the leveling system was enabled

[
  {
    "rankCard": {
      "backgroundImageURL": "/home/container/data/default_background.jpg",
      "progressBarColor": "#ffaabb"
    },
    "userId": "694986201739952229",
    "guildId": "940249530962706492",
    "username": "stef_dp",
    "level": 1,
    "xp": 0,
    "lastXpIncrease": "2023-09-24T11:00:58.370Z"
  }
]
Content-Type: application/json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "rankCard": {
        "type": "object",
        "properties": {
          "backgroundImageURL": {
            "type": "string",
            "description": "The URL of the background image of th rank card (a path if it's default image)"
          },
          "progressBarColor": {
            "type": "string",
            "description": "The HEX color of the progress bar"
          }
        },
        "description": "Data about the user's rankcard"
      },
      "userId": {
        "type": "string",
        "description": "The ID of the user"
      },
      "guildId": {
        "type": "string",
        "description": "The ID of the guild"
      },
      "username": {
        "type": "string",
        "description": "The username of the user"
      },
      "level": {
        "type": "number",
        "description": "The level of thr user"
      },
      "xp": {
        "type": "number",
        "description": "The XP of the user"
      },
      "lastXpIncrease": {
        "type": "string",
        "description": "The date when the xp was last added"
      }
    }
  }
}

Returns the object of the selected user if he has sent atleast one message after the leveling system was enabled

{
  "rankCard": {
    "backgroundImageURL": "/home/container/data/default_background.jpg",
    "progressBarColor": "#ffaabb"
  },
  "userId": "694986201739952229",
  "guildId": "940249530962706492",
  "username": "stef_dp",
  "level": 1,
  "xp": 0,
  "lastXpIncrease": "2023-09-24T11:00:58.370Z"
}
Content-Type: application/json
{
  "type": "object",
  "properties": {
    "rankCard": {
      "type": "object",
      "properties": {
        "backgroundImageURL": {
          "type": "string",
          "description": "The URL of the background image of th rank card (a path if it's default image)"
        },
        "progressBarColor": {
          "type": "string",
          "description": "The HEX color of the progress bar"
        }
      },
      "description": "Data about the user's rankcard"
    },
    "userId": {
      "type": "string",
      "description": "The ID of the user"
    },
    "guildId": {
      "type": "string",
      "description": "The ID of the guild"
    },
    "username": {
      "type": "string",
      "description": "The username of the user"
    },
    "level": {
      "type": "number",
      "description": "The level of thr user"
    },
    "xp": {
      "type": "number",
      "description": "The XP of the user"
    },
    "lastXpIncrease": {
      "type": "string",
      "description": "The date when the xp was last added"
    }
  }
}
{
    "code": 401,
    "message": "Unauthorized"
}
Content-Type: application/json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
{
    "code": 1000,
    "message": "The owner of this key is banned from the bot"
}
Content-Type: application/json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
{
    "code": 1001,
    "message": "The guild is banned from the bot"
}
Content-Type: application/jso
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}
{
    "code": 404,
    "message": "Not Found"
}
Content-Type: application/json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "description": "The code of the error"
    },
    "message": {
      "type": "string",
      "description": "A description of the error"
    }
  }
}

Examples

curl 'https://api.stefdp.com/gattinhosBot/guilds/940249530962706492/users'
    -H 'Authorization: Bearer <API_KEY>'
fetch('https://api.stefdp.com/gattinhosBot/guilds/940249530962706492/users', {
    headers: {
        'Authorization': 'Bearer <API_KEY>'
    }
})

Try it out!

PreviousGuild FeaturesNextReceiptData

Last updated 4 months ago

Was this helpful?

๐Ÿฑ
๐Ÿ‘ฅ