Overview

Goodmorning Tex! This is the docs for the GM Tex API, for the general use GM services API, check GM docs.

API structure

Structured similar to a REST api, all paths can be found in /api/[service]/vX/[path...].

Some requires posts requests, some get requests, and sometimes multipart post if the client is trying to upload a file.

Bindings

Compile

/api/generic

GM Tex utilities.

v1

/api/generic/v1

POST /api/generic/v1/create


Enable GM Tex for the GM account.

Request

{
    "token": String,
}

Response

Status code: 201

{
    "type": "compiled",
    "id": Number,
    "newpath": String
}

Possible errors

  • invalid token
  • not verified
  • feature disabled
  • external

GET /api/generic/v1/pfp/id/[id] (recommended) or /api/generic/v1/pfp/name/[username]


Get profile picture file of the user.

Response

Status code: 200 + the file.

Possible errors

  • not created
  • no such user
  • external

GET /api/generic/v1/profile/id/[id] (recommended) or /api/generic/v1/profile/name/[username]


Get GM Tex profile of a user.

Response

Status code: 200

{
    "type": "profile-only", // this wasn't intentional, but now the names are stuck
    "description": String,
    "details": [
        ProfileDetail...
    ]
}

Check profile.rs for all variants of ProfileDetail.

Possible errors

  • not created
  • no such user
  • external

POST /api/generic/v1/reset-pfp


Resets GM Tex profile picture.

Request

{
    "token": String,
}

Response

Status code: 200

{
    "type": "pfp reset"
}

Possible errors

  • invalid token
  • not verified
  • not created
  • external

POST /api/generic/v1/reset-profile


Resets GM Tex profile.

Request

{
    "token": String,
}

Response

Status code: 200

{
    "type": "profile updated"
}

Possible errors

  • invalid token
  • not verified
  • not created
  • external

POST /api/generic/v1/set-pfp/[token]


Set GM Tex profile picture.

Request

[multipart file post]

Response

Status code: 200

{
    "type": "profile updated"
}

Possible errors

  • invalid token
  • file too large
  • not verified
  • file type mismatch
  • not created
  • external

POST /api/generic/v1/set-profile


Resets GM Tex profile.

Request

{
    "description": String,
    "details": [
        ProfileDetail...
    ]
}

Check profile.rs for all variants of ProfileDetail.

Response

Status code: 200

{
    "type": "profile updated"
}

Possible errors

  • invalid token
  • not verified
  • not created
  • external

Compile

/api/compile

Compile operations.

v1

/api/compile/v1

POST /api/compile/v1/simple


Compile a file from one format to another.

Request

{
    "token": String,
    "path": String, // path to source file,
    "from": String, // markdown, latex
    "to": String // html, pdf
}

Response

Status code: 201

{
    "type": "compiled",
    "id": Number,
    "newpath": String
}

Possible errors

  • invalid token
  • not verified
  • compile error
  • not created
  • permission denied
  • external

Compile

/api/publish

Publish operations.

v1

/api/publish/v1

API not completed.