Omniplex Docs

A P I Tokens

These API endpoints are related to API Tokens on IBL

Get Sessions

GET
/{target_type}/{target_id}/sessions

Gets all session tokens of an entity

Authorization

headerUser-Auth<token>

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

Path Parameters

target_type*string

The entity type to use

target_id*string

The target ID to use

Response Body

Success

application/json
  1. response
sessions?array<>

The list of sessions

Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/sessions'
Example Response
{  "sessions": [    {      "created_at": "2019-08-24T14:15:22Z",      "current": true,      "expiry": "2019-08-24T14:15:22Z",      "id": "string",      "name": "string",      "perm_limits": [        "string"      ],      "target_id": "string",      "target_type": "string",      "type": "string"    }  ]}

Create Session

POST
/{target_type}/{target_id}/sessions

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

Authorization

headerUser-Auth<token>

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

Path Parameters

target_type*string

The entity type to use

target_id*string

The target ID to use

Request Body

application/json
  1. body
expiry?integer

The time in seconds the session will last

Formatint64
name?string

The name of the session

perm_limits?array<>

The permissions the session will have

type?"api"

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

Value in"api"

Response Body

Success

application/json
  1. response
session_id?string

The ID of the session

target_id?string

The ID of the target

token?string

The token of the session

Example Request
curl -X POST 'https://spider.omniplex.gg/string/string/sessions' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "session_id": "string",  "target_id": "string",  "token": "string"}

Revoke Session

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

Revokes a session of an entity based on session ID

Authorization

headerUser-Auth<token>

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

Path Parameters

target_type*string

The entity type to use

target_id*string

The target ID to use

session_id*string

The session ID to revoke

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X DELETE 'https://spider.omniplex.gg/string/string/sessions/string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get Oauth2 URL

GET
/auth/login/discord-oauth2

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

Response Body

Success

application/json
  1. response
client_id?string

The client ID

url?string

The URL to redirect the user to for discord oauth2

Example Request
curl -X GET 'https://spider.omniplex.gg/auth/login/discord-oauth2'
Example Response
{  "client_id": "string",  "url": "string"}

Create OAuth2 Login

POST
/auth/login/discord-oauth2

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.

Request Body

application/json
  1. body
client_id?string
code?string
protocol?string

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

redirect_uri?string
scope?string
Value in"normal""ban_exempt""external_auth"

Response Body

Success

application/json
  1. response
session_id?string

The ID of the session

target_id?string

The ID of the target

token?string

The token of the session

Example Request
curl -X POST 'https://spider.omniplex.gg/auth/login/discord-oauth2' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "session_id": "string",  "target_id": "string",  "token": "string"}

Log Out

POST
/auth/logout

Ends the session used to make this request, if any, and clears the website's session cookie. Always succeeds.

Authorization

User
headerUser-Auth<token>

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

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/auth/logout'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Test Auth

POST
/auth/test

Test your authentication

Request Body

application/json
  1. body
auth_type?string
target_id?string
token?string

Response Body

Success

application/json
  1. response
authorized?boolean
banned?boolean
data?
id?string
target_type?string
Example Request
curl -X POST 'https://spider.omniplex.gg/auth/test' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "authorized": true,  "banned": true,  "data": {    "property1": null,    "property2": null  },  "id": "string",  "target_type": "string"}