Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

API Version 2

7coil edited this page Apr 10, 2019 · 5 revisions

Token

Tokens are provided on a per-bot basis. View your bot's bot list token by finding your bot and clicking the Token button.

  • All requests use JSON.
  • Please send POST requests with Content-Type: application/json with valid JSON in the body.
  • When a token is required (When token needed is shown), please add your token to your HTTP Authorization header.
    • Authorization: dd8c7533eabfa62174a549f7b11678962ec00f8727537

V2 Methods

https://ls.terminal.ink/api/v2/

GET /apps

Obtain a JSON array of all applications

GET /bots

Obtain a JSON array of all bots

GET /rpc

Obtain a JSON array of all RPC applications

GET /bots/:id

Obtain JSON encoded information about a specific app

Bot Example

{
    "ok": true,
    "data": {
        "authors": [
            "190519304972664832",
            "366454817373290508",
            "180093157554388993",
            "261912303132344320",
            "178586069351137280",
            "86477779717066752"
        ], // ID of authors
        "cachedImages": {
            "avatar": "/appdata/f45e089e66155fac0899fcdad32886c828ec8d454ff6bb7860f33f6a3d29134e.png",
            "cover": "/appdata/3162280d9f8b45fab9953fc3ffed6cfbf4eb5fb25671a9972d3ce265ad231fef.png",
            "preview": [ // Links to the images, as downloaded by the server.
                "/appdata/de0c91656afb9edef0bc56407163a1f45735242fa04b4def7841deaa5fdb9e73.png",
                "/appdata/029ace8547487f644c291b495249d930f318ad08def43a6911097c52f07bdf44.png",
                "/appdata/b08e3d35685b2466bac2fff5e49b082542b1b64be47a54a99063031f853bc054.png",
                "/appdata/5fe64ae0d3af5371bb2a19fc124476365fa037d995055de2d835e901b09143e8.png"
            ]
        },
        "category": "other",
        "contents": [
            {
                "description": "The open source Discord App Store",
                "locale": "en-GB",
                "name": "Discord Apps Marketplace",
                "page": "[View this page at GitHub](https://github.com/Terminal/ls.terminal.ink/tree/master/website)\r\n\r\n# ls.terminal.ink\r\n\r\n## Development Team\r\nCategory            | People\r\n------------------- | --------------------------\r\nLead Developer      | 7coil#3175 ([@lepon01](https://github.com/lepon01))\r\nSecondary Developer | Devoxin#0387 ([@Devoxin](https://github.com/Devoxin))\r\nde                  | Andre_601#0601 ([@Andre601](https://github.com/Andre601))\r\nfr                  | iDroid27#4441 ([@iDroid27](https://github.com/iDroid27))\r\nfr                  | Bowser65#4680 ([@Bowser65](https://github.com/Bowser65))\r\nda                  | Saederup92#2901 ([@Saederup92](https://github.com/Saederup92))\r\nzh-cn               | Tansc#8171 ([@Tansc161](https://github.com/Tansc161))\r\n\r\n## Licence\r\nAll files (except the exceptions below) are licenced under the GNU Affero General Public Licence.\r\n\r\nFor licencing without the GNU AGPL, contact `7coil#3175` or email at `admin@moustacheminer.com`\r\n\r\n### Exceptions\r\n- `/website/www-root/js/modalPerms.js` is licenced under the MIT licence.\r\n- `/website/class/ImageCache.js` is licenced under the MIT licence.\r\n\r\n## Deployment\r\n- `npm i`\r\n- `npm start`\r\n\r\n"
            }
        ],
        "count": null,
        "created": 1542761901388,
        "edited": 1552957349144,
        "flags": {
            "adverts": false,
            "inAppPurchases": false,
            "linux": null,
            "mac": null,
            "win": null
        },
        "github": {
            "owner": "terminal",
            "repo": "ls.terminal.ink"
        },
        "hide": true,
        "id": "473861594749861909",
        "images": {
            "avatar": "https://cdn.discordapp.com/avatars/473861594749861909/1247b144d00752a63ab3a0e94d262a6d.webp",
            "cover": "https://pbs.twimg.com/profile_banners/770959712791597056/1550571087",
            "preview": [ // Links to the images.
                "https://its-not-advertising-if-the-website-doesnt-exist-anymore.moustacheminer.com/chrome_2018-11-24_19-07-43.png",
                "https://its-not-advertising-if-the-website-doesnt-exist-anymore.moustacheminer.com/chrome_2018-11-24_18-51-39.png",
                "https://its-not-advertising-if-the-website-doesnt-exist-anymore.moustacheminer.com/chrome_2018-11-24_18-52-18.png",
                "https://its-not-advertising-if-the-website-doesnt-exist-anymore.moustacheminer.com/chrome_2019-01-10_15-35-07.png"
            ]
        },
        "invite": "https://discordapp.com/api/oauth2/authorize?client_id=473861594749861909&permissions=0&scope=bot",
        "legacy": true, // Bots made before ls.terminal.ink Version 10 was released
        "nsfw": false,
        "oauth": null,
        "random": 11.612670873071673, // The score. If fetched at "https://ls.terminal.ink/en-GB/api/v2", 
        "reviews": [],
        "state": "approved",
        "support": "https://discord.gg/8uC6aKZ",
        "trigger": {
            "customisable": false,
            "mentionable": false,
            "prefix": [ // List of acceptable prefixes
                "go won"
            ]
        },
        "videos": {
            "youku": null,
            "youtube": "m5qwcYL8a0o" // ID of YouTube video
        },
        "website": "https://discordapps.dev/en-GB/bots/473861594749861909" // Link to the bot's website
    }
}

RPC example

{
    "ok": true,
    "data": {
        "authors": [
            "190519304972664832"
        ],
        "cachedImages": {
            "avatar": "/img/logo/logo.svg",
            "cover": null,
            "preview": [
                "/appdata/66c1318048ca0d9be6d6b5bc6826b71caa008f58374b30afd00ca6adeb05bcf7.png",
                "/appdata/d41978d0db1224cd5c08fc74ea4f0abfea05d359de88c20db9f99948068ccd51.png",
                "/appdata/35d34000c970b4bffa27beb74d1557d613d46b2a377b41583e3a83a3bd68c0f1.png",
                "/appdata/ffe566d7574d0388f40a6dc5c5ba977a9f6fad50fd294637936b90147e9b7efe.png",
                "/appdata/ea63bceea9cdc198b0e854e4ee7c1ce8903c0bcd88ba7961940fd37c92c63f6d.png"
            ]
        },
        "category": null,
        "contents": [
            {
                "description": "This application is not affiliated with Microsoft Corporation.",
                "locale": "en-GB",
                "name": "RPC for Microsoft Office",
                "page": "This application is not affiliated with Microsoft Corporation.\r\n\r\nDisplays Discord rich presence information for Microsoft Word, Microsoft PowerPoint and Microsoft Excel, versions 2013, 2016 and 2019 (15, 16, 17) https://office.terminal.ink/"
            }
        ],
        "count": null,
        "created": 1554774311742,
        "edited": 1554907020658,
        "flags": {
            "adverts": null,
            "inAppPurchases": null,
            "linux": false,
            "mac": false,
            "win": true
        },
        "github": {
            "owner": "Terminal",
            "repo": "DiscordForOffice"
        },
        "hide": false,
        "id": "470239659591598091",
        "images": {
            "avatar": null,
            "cover": null,
            "preview": [
                "https://cdn.discordapp.com/attachments/353911657665396736/565541818167590913/left.png",
                "https://cdn.discordapp.com/attachments/353911657665396736/565541818163265556/right.png",
                "https://cdn.discordapp.com/attachments/353911657665396736/565542349103431691/unknown.png",
                "https://cdn.discordapp.com/attachments/353911657665396736/565542823374356480/unknown.png",
                "https://cdn.discordapp.com/attachments/353911657665396736/565542952164786176/unknown.png"
            ]
        },
        "invite": "https://github.com/Terminal/DiscordForOffice/releases",
        "nsfw": false,
        "oauth": null,
        "random": 10.454630550180681,
        "reviews": [],
        "state": "approved",
        "support": "https://discord.gg/8uC6aKZ",
        "type": "rpc",
        "videos": {
            "youku": null,
            "youtube": null
        },
        "website": "https://office.terminal.ink/"
    }
}

POST /bots/:id token needed

Update your bot! Just send a JSON representation of your bot, in the same schema as above.

This API does not support changing nested keys. Keys such as trigger, images, or contents can therefore cannot be edited via the API.

All keys within the bot object are optional. Some may not be written.

Server count example

{
  "bot": {
    "count": 156
  }
}

Change category

{
  "bot": {
    "category": "fun"
  }
}

Change many things

{
  "bot": {
    "nsfw": true,
    "oauth": "123456",
    "website": "https://discordbots.co.uk/",
    "count": 87932,
    "category": "fun"
  }
}