mirror of
https://github.com/stakwork/sphinx-relay.git
synced 2026-08-13 12:33:24 +02:00
* added request-transport-token endpoint * added request-transport-token endpoint * putting in correct category * adding contacts/tokens base * adding in request body and authtoken stuff * adding in request body and authtoken stuff * added error values and fixed the categories a bit * removing duplicate 400 error reponses * small change to tag * small change to tag * updated operation id * updated operation id * remove x tag groups * swapping summary and desc * updated a desc and summary * removed some of the warnings it was giving me
254 lines
7.5 KiB
YAML
254 lines
7.5 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
description: |
|
|
This is a sample server for sphinx-relay below you'll find api docs and such
|
|
version: 1.0.0
|
|
title: Swagger Sphinx-Relay
|
|
termsOfService: 'http://swagger.io/terms/'
|
|
contact:
|
|
name: Sphinx Support
|
|
email: support@stakwork.com
|
|
x-logo:
|
|
url: 'https://miro.medium.com/max/512/1*sAlVjz09nS6f7iYJ6apMhg.png'
|
|
altText: Sphinx-Chat logo
|
|
license:
|
|
name: MIT License
|
|
url: 'https://raw.githubusercontent.com/stakwork/sphinx-relay/master/LICENSE'
|
|
tags:
|
|
- name: Tribes
|
|
description: Everything about your Tribes
|
|
- name: Authentication
|
|
description: Endpoints to enable and to use relay's authenticated endpoints
|
|
paths:
|
|
/tribe_channel:
|
|
post:
|
|
tags:
|
|
- Tribes
|
|
summary: Add a new channel for tribe in tribe server
|
|
description: Create new tribe text channel.
|
|
operationId: createChannel
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
response:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
tribe_uuid:
|
|
type: string
|
|
name:
|
|
type: string
|
|
created:
|
|
type: string
|
|
format: date-time
|
|
deleted:
|
|
type: boolean
|
|
type: object
|
|
description: Success
|
|
'405':
|
|
description: Invalid input
|
|
parameters:
|
|
- description: "Authentication token."
|
|
in: header
|
|
name: x-user-token
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
tribe_uuid:
|
|
description: The id of the tribe to add channel to.
|
|
type: string
|
|
host:
|
|
description: the domain of the host tribe server.
|
|
type: string
|
|
name:
|
|
type: string
|
|
type: object
|
|
delete:
|
|
tags:
|
|
- Tribes
|
|
summary: Delete tribe text channel
|
|
description: delete tribe text channel in the tribes server.
|
|
operationId: deleteChannel
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
response:
|
|
type: boolean
|
|
type: object
|
|
description: Success
|
|
'405':
|
|
description: Invalid input
|
|
parameters:
|
|
- description: "Authentication token."
|
|
in: header
|
|
name: x-user-token
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
id:
|
|
description: The id of the channel to delete.
|
|
type: number
|
|
host:
|
|
description: the domain of the host tribe server.
|
|
type: string
|
|
type: object
|
|
/tribes/{tribe_uuid}:
|
|
get:
|
|
tags:
|
|
- Tribes
|
|
summary: Get a tribe info by uuid
|
|
description: Get a tribe info from tribes server by providing a uuid.
|
|
parameters:
|
|
- description: The tribe ID.
|
|
in: path
|
|
name: tribe_uuid
|
|
required: true
|
|
schema:
|
|
properties:
|
|
tribe_uuid:
|
|
type: string
|
|
operationId: updateChannel
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
app_url:
|
|
type: string
|
|
bots:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
channels:
|
|
type: array
|
|
items:
|
|
type: number
|
|
created:
|
|
type: string
|
|
format: date-time
|
|
deleted:
|
|
type: boolean
|
|
description:
|
|
type: string
|
|
escrow_amount:
|
|
type: number
|
|
escrow_millis:
|
|
type: number
|
|
feed_type:
|
|
type: number
|
|
feed_url:
|
|
type: string
|
|
group_key:
|
|
type: string
|
|
img:
|
|
type: string
|
|
last_active:
|
|
type: number
|
|
member_count:
|
|
type: number
|
|
name:
|
|
type: string
|
|
owner_alias:
|
|
type: string
|
|
owner_pubkey:
|
|
type: string
|
|
owner_route_hint:
|
|
type: string
|
|
pin:
|
|
type: string
|
|
price_per_message:
|
|
type: number
|
|
private:
|
|
type: boolean
|
|
price_to_join:
|
|
type: number
|
|
tags:
|
|
type: array
|
|
items:
|
|
type: string
|
|
unique_name:
|
|
type: string
|
|
unlisted:
|
|
type: boolean
|
|
updated:
|
|
type: string
|
|
format: date-time
|
|
uuid:
|
|
type: string
|
|
type: object
|
|
description: Success
|
|
'405':
|
|
description: Invalid input
|
|
/request_transport_key:
|
|
get:
|
|
tags:
|
|
- Authentication
|
|
summary: Get transport token key
|
|
description: This is used for retriving the key used to encrypt the x-transport-token
|
|
operationId: requestTransportKeys
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
request_transport_key:
|
|
type: string
|
|
description: Success
|
|
/contacts/tokens:
|
|
post:
|
|
tags:
|
|
- Authentication
|
|
summary: Set auth token for owner.
|
|
description: This is used for setting the auth token
|
|
operationId: saveAuthToken
|
|
responses:
|
|
'200':
|
|
description: Success
|
|
'400':
|
|
description: Failure one of these issue (no pubkey,no owner, Wrong Password, no token in body, invalid token)
|
|
parameters:
|
|
- description: "X Transport Authentication token."
|
|
in: header
|
|
name: x-transport-token
|
|
required: false
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
token:
|
|
description: (Legacy) Auth token to save with
|
|
type: string
|
|
pubkey:
|
|
description: Owners pubkey.
|
|
type: string
|
|
type: object
|
|
|