Disadus Documentation
  • Disadus Documentation
  • 🔓Authentication
    • Basic Authentication (REST)
    • Socket Authentication (WS)
  • 🔆Disadus Core
    • About Disadus Core
    • Page 2
    • 🫂Community Data
      • 📅Community Schedules
      • ⚙️Community LMS Settings
      • Community-Related Types
      • Get Community Info (REST)
      • Search For Communities (REST)
      • Get Communities Join Info (REST)
      • Join A Community (REST)
      • Leave A Community (REST)
    • 🧑User Data
      • User-Related Types
      • Get Self User Info (REST)
      • Get Self User Info (WS)
      • Get User Info by ID (REST)
      • Get User Info By ID (WS)
      • Get User Info By Username (WS)
  • 📖Disadus Courses
    • About Disadus Courses
    • 📣Course Announcements
    • 📝Course Assignments
    • ⚙️Course Preferences
    • 💯Course Grades
Powered by GitBook
On this page
  • Acquiring the Authentication Token
  • Login to account
  • Get Self User Data

Was this helpful?

  1. Authentication

Basic Authentication (REST)

Acquiring the Authentication Token

Authentication is fairly simple. We use an Authentication-token based model. To get this token, please get an account email & password and post to the /login endpoint

Login to account

POST https://api.disadus.app/login

Request Body

Name
Type
Description

email*

String

User Email

password*

String

User Password

{
    "success": true,
    "token": "AuthToken"
}
Email or password incorrect

Once you receive the token, store it somewhere safe! At the moment, these tokens do NOT Automatically expire!!! Making a request with the token is fairly simple, just prepend Bearer to the token and send it via the Authorization header. Try out the following below!

Get Self User Data

GET https://api.disadus.app/user/@me

Headers

Name
Type
Description

Authorization*

Your authorization header ( Bearer AuthToken)

{
    "id": "TET00",
    "username": "teto",
    "email": "[email protected]",
    "firstName": "John",
    "lastName": "Li",
    "bio": "The *good*? kind of weird and dumb. :think:",
    "pfp": "https://profiles.disadus.app/TET00/0JP9R5L1BD1R2XSU3WO3.png",
    "communities": [
        "tet",
    ],
    "createdAt": 1,
    "primaryCommunity": "gunnSandbox",
    "isAdmin": true,
    "theme": 1,
    "staffLevel": 5,
    "tester": true,
    "premiumUntil": 1634625867038000,
    "openLinkStyle": 0,
    "devMode": true,
    "pluginMode": true,
    "tags": [
        "artist"
    ]
}

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Cannot GET /user/@me</pre>
</body>

</html>
PreviousDisadus DocumentationNextSocket Authentication (WS)

Last updated 2 years ago

Was this helpful?

🔓