questable-api-docs/docs.yml

233 lines
7.9 KiB
YAML
Raw Normal View History

openapi: 3.0.0
info:
title: Questable REST API
description: REST API for Questable Bot
version: 1.0.0
servers:
- url: "https://api.questable.webionite.com/"
paths:
/auth:
get:
summary: auth
description: Check whether the token is valid or not
parameters:
- $ref: '#/components/schemas/token'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/auth'
/get_quests:
get:
summary: get_quests
description: Get an array of incomplete quests
parameters:
- $ref: '#/components/schemas/token'
responses:
200:
2019-03-12 06:27:36 +01:00
description: Returns an array of incomplete quests
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/quests'
2019-03-12 06:27:36 +01:00
401:
$ref: "#/components/responses/bad_auth"
/get_side_quests:
get:
summary: get_side_quests
description: Get an array of incomplete side quests
parameters:
- $ref: '#/components/schemas/token'
responses:
200:
2019-03-12 06:27:36 +01:00
description: Returns an array of incomplete side quests
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/quests'
2019-03-12 06:27:36 +01:00
401:
$ref: "#/components/responses/bad_auth"
/get_quest:
get:
summary: get_quest
description: Get a Quest
parameters:
- $ref: '#/components/schemas/token'
- $ref: '#/components/schemas/id'
responses:
200:
2019-03-12 06:27:36 +01:00
description: Returns the quest.
content:
application/json:
schema:
$ref: '#/components/schemas/quests'
2019-03-12 06:27:36 +01:00
401:
$ref: "#/components/responses/bad_auth"
/get_side_quest:
get:
summary: get_side_quest
description: Get a Side Quest
parameters:
- $ref: '#/components/schemas/token'
- $ref: '#/components/schemas/id'
responses:
200:
2019-03-12 06:27:36 +01:00
description: Returns the side quest.
content:
application/json:
schema:
$ref: '#/components/schemas/quests'
2019-03-12 06:27:36 +01:00
401:
$ref: "#/components/responses/bad_auth"
/update_quest:
post:
summary: update_quest
description: To change any of the parameters of a quest. (Pass atleast one of optional parameters)
parameters:
- $ref: '#/components/schemas/token'
- $ref: '#/components/schemas/id'
- $ref: '#/components/schemas/name'
- $ref: '#/components/schemas/difficulty'
- $ref: '#/components/schemas/priority'
- $ref: '#/components/schemas/state'
responses:
200:
description: Returns the updated quest.
content:
application/json:
schema:
$ref: '#/components/schemas/quests'
401:
$ref: "#/components/responses/bad_auth"
400:
$ref: "#/components/responses/bad_request"
/update_side_quest:
post:
summary: update_side_quest
description: To change any of the parameters of a side quest. (Pass atleast one of optional parameters)
parameters:
- $ref: '#/components/schemas/token'
- $ref: '#/components/schemas/id'
- $ref: '#/components/schemas/name'
- $ref: '#/components/schemas/difficulty'
- $ref: '#/components/schemas/priority'
- $ref: '#/components/schemas/state'
responses:
200:
description: Returns the updated side quest.
content:
application/json:
schema:
$ref: '#/components/schemas/quests'
401:
$ref: "#/components/responses/bad_auth"
400:
$ref: "#/components/responses/bad_request"
components:
schemas:
auth:
required:
- success
properties:
success:
type: boolean
token:
name: token
in: query
description: Token recieved from Questable Bot
required: true
schema:
type: String
id:
name: id
in: query
description: ID of the Quest/Side Quest
required: true
schema:
type: integer
quests:
required:
- name
- difficulty
- priority
- state
properties:
name:
type: string
description: Name of the quest/side quest
difficulty:
type: integer
description: A value from 1 to 3 representing Low, Medium, High
priority:
type: integer
description: A value from 1 to 3 representing Low, Medium, High
state:
type: boolean
description: True if the quest/side quest has been completed
2019-03-12 06:27:36 +01:00
name:
name: name
in: query
description: Updated Name of the quest/side quest
required: false
schema:
type: string
priority:
name: priority
in: query
description: New Priority to set. (Low = 1, Medium = 2, High = 3)
required: false
schema:
type: integer
difficulty:
name: difficulty
in: query
description: New Difficulty to set. (Low = 1, Medium = 2, High = 3)
required: false
schema:
type: integer
state:
name: state
in: query
description: New state. (can only be true, completed quests can't be un-completed)
required: false
schema:
type: true
responses:
bad_request:
description: The request has missing parameters.
content:
application/json:
schema:
required:
- error
properties:
error:
type: string
description: Explains the error. Possible values are "insufficient parameters"
bad_auth:
description: The token is invalid.
content:
application/json:
schema:
required:
- error
properties:
error:
type: string
description: The token is invalid