Omniplex Docs
PopplioStaging

A P I Tokens

These API endpoints are related to API Tokens on IBL

GET
/{target_type}/{target_id}/sessions

Get Sessions

Gets all session tokens of an entity

/{target_type}/{target_id}/sessions

The Authorization access token

Authorization

User-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

In: header

Bot-Auth<token>

Requires a bot token. Should be prefixed with Bot in Authorization header.

In: header

Server-Auth<token>

Requires a server API session token. Should be prefixed with Server in Authorization header.

In: header

Team-Auth<token>

Requires a team API session token. Should be prefixed with Team in Authorization header.

In: header

Path Parameters

target_type
Required
string

The entity type to use

target_id
Required
string

The target ID to use

curl -X GET "https://spider-staging.omniplex.gg/string/string/sessions" \
  -H "User-Auth: <token>"

Success

{
  "sessions": [
    {
      "created_at": "2019-08-24T14:15:22Z",
      "expiry": "2019-08-24T14:15:22Z",
      "id": "string",
      "name": "string",
      "perm_limits": [
        "string"
      ],
      "target_id": "string",
      "target_type": "string",
      "type": "string"
    }
  ]
}

POST
/{target_type}/{target_id}/sessions

Create Session

Creates a new session returning the session token. The session token cannot be read after creation.

/{target_type}/{target_id}/sessions

The Authorization access token

Authorization

User-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

In: header

Bot-Auth<token>

Requires a bot token. Should be prefixed with Bot in Authorization header.

In: header

Server-Auth<token>

Requires a server API session token. Should be prefixed with Server in Authorization header.

In: header

Team-Auth<token>

Requires a team API session token. Should be prefixed with Team in Authorization header.

In: header

Request Body

application/jsonRequired

expiryinteger

The time in seconds the session will last

Format: "int64"

namestring

The name of the session

perm_limitsarray<string>

The permissions the session will have

typestring

The type of session token. Must be 'api'. Login sessions cannot be created using the Create Session API for obvious reasons

Value in: "api"

Path Parameters

target_type
Required
string

The entity type to use

target_id
Required
string

The target ID to use

curl -X POST "https://spider-staging.omniplex.gg/string/string/sessions" \
  -H "User-Auth: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "expiry": 0,
    "name": "string",
    "perm_limits": [
      "string"
    ],
    "type": "api"
  }'

Success

{
  "session_id": "string",
  "target_id": "string",
  "token": "string"
}

DELETE
/{target_type}/{target_id}/sessions/{session_id}

Revoke Session

Revokes a session of an entity based on session ID

/{target_type}/{target_id}/sessions/{session_id}

The Authorization access token

Authorization

User-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

In: header

Bot-Auth<token>

Requires a bot token. Should be prefixed with Bot in Authorization header.

In: header

Server-Auth<token>

Requires a server API session token. Should be prefixed with Server in Authorization header.

In: header

Team-Auth<token>

Requires a team API session token. Should be prefixed with Team in Authorization header.

In: header

Path Parameters

target_type
Required
string

The entity type to use

target_id
Required
string

The target ID to use

session_id
Required
string

The session ID to revoke

curl -X DELETE "https://spider-staging.omniplex.gg/string/string/sessions/string" \
  -H "User-Auth: <token>"

Success

{
  "context": {
    "property1": "string",
    "property2": "string"
  },
  "message": "string"
}

GET
/auth/login/discord-oauth2

Get Oauth2 URL

Gets the oauth2 url to redirect to. Primarily for externally managed clients (like iblcli)

/auth/login/discord-oauth2
curl -X GET "https://spider-staging.omniplex.gg/auth/login/discord-oauth2"

Success

{
  "client_id": "string",
  "url": "string"
}

POST
/auth/login/discord-oauth2

Create OAuth2 Login

Takes in a code query parameter and returns a user token. Cannot be used outside of the site for security reasons but documented in case we wish to allow its use in the future.

/auth/login/discord-oauth2

Request Body

application/jsonRequired

client_idstring

codestring

protocolstring

Should be 'persepolis'. This is to identify and block older clients that don't support newer protocols

redirect_uristring

scopestring

Value in: "normal" | "ban_exempt" | "external_auth"
curl -X POST "https://spider-staging.omniplex.gg/auth/login/discord-oauth2" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "string",
    "code": "string",
    "protocol": "string",
    "redirect_uri": "string",
    "scope": "normal"
  }'

Success

{
  "session_id": "string",
  "target_id": "string",
  "token": "string"
}

POST
/auth/test

Test Auth

Test your authentication

/auth/test

Request Body

application/jsonRequired

auth_typestring

target_idstring

tokenstring

curl -X POST "https://spider-staging.omniplex.gg/auth/test" \
  -H "Content-Type: application/json" \
  -d '{
    "auth_type": "string",
    "target_id": "string",
    "token": "string"
  }'

Success

{
  "authorized": true,
  "banned": true,
  "data": {
    "property1": null,
    "property2": null
  },
  "id": "string",
  "target_type": "string"
}