Skip to content

Commit 469b0ba

Browse files
committed
Add info about retrieving API endpoints
1 parent 3435b09 commit 469b0ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/assets/imageapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.1.0",
33
"info": {
44
"title": "Purrbot API",
5-
"description": "The Purrbot API (Formerly Purrbot Image API) is an open-source API that currently provides the following features:\n\n- Receive a randomly selected image link based on the selected image path.\n- Receive a list of image links based on the selected image path.\n- \"OWOify\" provided text, replacing specific characters with other values.\n\n## Testing connection\n\nThis page does not support directly testing API endpoints. Instead are you required to use a tool such as [cURL](https://curl.se) or [Postman](https://www.postman.com) to access and test API paths.\n\nTo test it, connect to `https://api.purrbot.site` and look for a response similar to the following: \n```json\n{\n \"name\": \"Purrbot API\",\n \"version\": \"2.2.0\",\n \"description\": \"A public API made for the Discord Bot *Purr* that contains random image and text features.\",\n \"links\": {\n \"documentation\": \"https://docs.purrbot.site/api\",\n \"source\": \"https://github.com/purrbot-site/ImageAPI\",\n \"api\": \"https://api.purrbot.site/v2\",\n \"legal\": \"https://docs.purrbot.site/legal/api\"\n },\n \"license\": {\n \"type\": \"MIT\",\n \"link\": \"https://github.com/purrbot-site/ImageAPI/blob/master/LICENSE\"\n }\n}\n```\nShould you receive this or a similar response can you obtain the current API domain from the `links` object.\n\n## Versioning\n\nThe versioning of the API is simple. \nWhenever the API receives a breaking change will the version in the URL path get bumped.\n\nWhere possible will we try to still support the old API path for a while to allow an easier migration to the new version.\n\n### Current API deprecations\n\nThe following API URL paths are currently considered deprecated and will be removed in the future:\n\n- `https://purrbot.site/api` (switch to `https://api.purrbot.site/v2`)",
5+
"description": "The Purrbot API (Formerly Purrbot Image API) is an open-source API that currently provides the following features:\n\n- Receive a randomly selected image link based on the selected image path.\n- Receive a list of image links based on the selected image path.\n- \"OWOify\" provided text, replacing specific characters with other values.\n\n## Testing connection\n\nThis page does not support directly testing API endpoints. Instead are you required to use a tool such as [cURL](https://curl.se) or [Postman](https://www.postman.com) to access and test API paths.\n\nTo test it, connect to `https://api.purrbot.site` and look for a response similar to the following: \n```json\n{\n \"name\": \"Purrbot API\",\n \"version\": \"2.3.0\",\n \"description\": \"A public API made for the Discord Bot *Purr* that contains random image and text features.\",\n \"links\": {\n \"documentation\": \"https://docs.purrbot.site/api\",\n \"source\": \"https://github.com/purrbot-site/ImageAPI\",\n \"api\": \"https://api.purrbot.site/v2\",\n \"legal\": \"https://docs.purrbot.site/legal/api\"\n },\n \"license\": {\n \"type\": \"MIT\",\n \"link\": \"https://github.com/purrbot-site/ImageAPI/blob/master/LICENSE\"\n }\n}\n```\nShould you receive this or a similar response can you obtain the current API domain from the `links` object.\n\n## Obtaining API paths\nThe API provides a way to obtain all currently provided API paths. Simply connect to the API URL provided in the https://api.purrbot.site response (See [Testing connection](#testing-connection) and it should return a JSON containing a `paths` entry, unless an error occured.\n\nEach entry in `paths` contains the following componentns:\n\n- A `path` attribute containing the API Endpoint as a URL.\n- A `method` attribute having either `GET` or `POST` as value.\n- A `description` attribute containing a description of the endpoint.\n- A `deprecated` attribute marking the endpoint as deprecated.\n\n`GET` requests entried also may have a `parameters` attribute containing a List of these options:\n\n- A `name` attribute providing the name of the parameter. Note that parameters in URLs are surrounded by `{}`.\n- A `location` attribute displaying the location of where the parameter is used.\n- A `description` attribute containing a Description of the Parameter.\n- A `required` attribute containing a boolean to mark this parameter as (not) required.\n\n`POST` request entries will additionally have a `request-bodies` Map which consists of the Media type and a link to the corresponding Schema description on the API Docs page (i.e. `\"application/json\": \"https://docs.purrbot.site/api/#owoifyrequest\"`).\n\n## Versioning\n\nThe versioning of the API is simple. \nWhenever the API receives a breaking change will the version in the URL path get bumped.\n\nWhere possible will we try to still support the old API path for a while to allow an easier migration to the new version.\n\n### Current API deprecations\n\nThe following API URL paths are currently considered deprecated and will be removed in the future:\n\n- `https://purrbot.site/api` (switch to `https://api.purrbot.site/v2`)",
66
"termsOfService": "https://docs.purrbot.site/legal/api",
77
"contact": {
88
"email": "support@purrbot.site"
@@ -11,7 +11,7 @@
1111
"name": "MIT",
1212
"url": "https://github.com/purrbot-site/ImageAPI/blob/master/LICENSE"
1313
},
14-
"version": "2.2.0"
14+
"version": "2.3.0"
1515
},
1616
"servers": [
1717
{

0 commit comments

Comments
 (0)