James Tombleson
c161658487
* added a route to delete subscriptions based on the ID given * added a new route to find a record based on the name and source * added a route to query Discord Web Hooks by Server and Channel names * tested the endpoints and they seem good to test more
462 lines
9.8 KiB
YAML
462 lines
9.8 KiB
YAML
basePath: /api
|
|
info:
|
|
contact: {}
|
|
title: NewsBot collector
|
|
version: "0.1"
|
|
paths:
|
|
/articles:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Lists the top 50 records
|
|
tags:
|
|
- Articles
|
|
/articles/{id}:
|
|
get:
|
|
parameters:
|
|
- description: uuid
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns an article based on defined ID.
|
|
tags:
|
|
- Articles
|
|
/articles/by/sourceid:
|
|
get:
|
|
parameters:
|
|
- description: Source ID UUID
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Finds the articles based on the SourceID provided. Returns the top
|
|
50.
|
|
tags:
|
|
- Articles
|
|
/articles/by/tag:
|
|
get:
|
|
parameters:
|
|
- description: Tag name
|
|
in: query
|
|
name: tag
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Finds the articles based on the SourceID provided. Returns the top
|
|
50.
|
|
tags:
|
|
- Articles
|
|
/config/sources:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Lists the top 50 records
|
|
tags:
|
|
- Config
|
|
- Source
|
|
/config/sources/{id}:
|
|
delete:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Deletes a record by ID.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
get:
|
|
parameters:
|
|
- description: uuid
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns a single entity by ID
|
|
tags:
|
|
- Config
|
|
- Source
|
|
/config/sources/{id}/disable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Disables a source from processing.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
/config/sources/{id}/enable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Enables a source to continue processing.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
/config/sources/by/source:
|
|
get:
|
|
parameters:
|
|
- description: Source Name
|
|
in: query
|
|
name: source
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: 'Lists the top 50 records based on the name given. Example: reddit'
|
|
tags:
|
|
- Config
|
|
- Source
|
|
/config/sources/by/sourceAndName:
|
|
get:
|
|
parameters:
|
|
- description: dadjokes
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
- description: reddit
|
|
in: query
|
|
name: source
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns a single entity by ID
|
|
tags:
|
|
- Config
|
|
- Source
|
|
/config/sources/new/reddit:
|
|
post:
|
|
parameters:
|
|
- description: name
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
- description: url
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new reddit source to monitor.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
- Reddit
|
|
/config/sources/new/twitch:
|
|
post:
|
|
parameters:
|
|
- description: name
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new twitch source to monitor.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
- Twitch
|
|
/config/sources/new/youtube:
|
|
post:
|
|
parameters:
|
|
- description: name
|
|
in: query
|
|
name: name
|
|
required: true
|
|
type: string
|
|
- description: url
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new youtube source to monitor.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
- YouTube
|
|
/discord/queue:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Debug
|
|
- Discord
|
|
- Queue
|
|
/discord/webhooks:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{id}:
|
|
delete:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Deletes a record by ID.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
get:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
patch:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Updates a valid discord webhook ID based on the body given.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{id}/disable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Disables a Webhook from being used.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/{id}/enable:
|
|
post:
|
|
parameters:
|
|
- description: id
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Enables a source to continue processing.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/by/serverAndChannel:
|
|
get:
|
|
parameters:
|
|
- description: Fancy Server
|
|
in: query
|
|
name: server
|
|
required: true
|
|
type: string
|
|
- description: memes
|
|
in: query
|
|
name: channel
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns all the known web hooks based on the Server and Channel given.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
/discord/webhooks/new:
|
|
post:
|
|
parameters:
|
|
- description: url
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
- description: Server name
|
|
in: query
|
|
name: server
|
|
required: true
|
|
type: string
|
|
- description: Channel name
|
|
in: query
|
|
name: channel
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new record for a discord web hook to post data to.
|
|
tags:
|
|
- Config
|
|
- Discord
|
|
- Webhook
|
|
/hello/{who}:
|
|
get:
|
|
parameters:
|
|
- description: Who
|
|
in: path
|
|
name: who
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- text/plain
|
|
responses: {}
|
|
summary: Responds back with "Hello x" depending on param passed in.
|
|
tags:
|
|
- Debug
|
|
/helloworld:
|
|
get:
|
|
produces:
|
|
- text/plain
|
|
responses: {}
|
|
summary: Responds back with "Hello world!"
|
|
tags:
|
|
- Debug
|
|
/ping:
|
|
get:
|
|
produces:
|
|
- text/plain
|
|
responses: {}
|
|
summary: Sends back "pong". Good to test with.
|
|
tags:
|
|
- Debug
|
|
/settings/{key}:
|
|
get:
|
|
parameters:
|
|
- description: Settings Key value
|
|
in: path
|
|
name: key
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns a object based on the Key that was given.
|
|
tags:
|
|
- Settings
|
|
/subscriptions:
|
|
get:
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Config
|
|
- Subscription
|
|
/subscriptions/byDiscordId:
|
|
get:
|
|
parameters:
|
|
- description: id
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Config
|
|
- Subscription
|
|
/subscriptions/bySourceId:
|
|
get:
|
|
parameters:
|
|
- description: id
|
|
in: query
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses: {}
|
|
summary: Returns the top 100 entries from the queue to be processed.
|
|
tags:
|
|
- Config
|
|
- Subscription
|
|
/subscriptions/discord/webhook/delete:
|
|
delete:
|
|
parameters:
|
|
- description: Id
|
|
in: query
|
|
name: Id
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Removes a Discord WebHook Subscription based on the Subscription ID.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
- Discord
|
|
- Subscription
|
|
/subscriptions/new/discordwebhook:
|
|
post:
|
|
parameters:
|
|
- description: discordWebHookId
|
|
in: query
|
|
name: discordWebHookId
|
|
required: true
|
|
type: string
|
|
- description: sourceId
|
|
in: query
|
|
name: sourceId
|
|
required: true
|
|
type: string
|
|
responses: {}
|
|
summary: Creates a new subscription to link a post from a Source to a DiscordWebHook.
|
|
tags:
|
|
- Config
|
|
- Source
|
|
- Discord
|
|
- Subscription
|
|
swagger: "2.0"
|