fedimovies/docs/openapi.yaml

124 lines
3.2 KiB
YAML
Raw Normal View History

2021-12-03 15:29:50 +00:00
openapi: 3.0.1
info:
title: Mitra API
description: Mitra API spec
version: 1.0.0
paths:
2021-12-04 00:42:36 +00:00
/api/v1/statuses/{status_id}:
delete:
summary: Delete post
parameters:
- $ref: '#/components/parameters/status_id'
responses:
204:
description: Successful operation
content: {}
403:
description: Post does not belong to user
404:
description: Post not found
2021-12-03 15:29:50 +00:00
/api/v1/{status_id}/make_permanent:
post:
summary: Save post to IPFS
parameters:
- $ref: '#/components/parameters/status_id'
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
403:
description: Post does not belong to user or is not public
2021-12-03 15:29:50 +00:00
404:
description: Post not found
418:
description: IPFS integration is not enabled
422:
description: Post already saved to IPFS
2021-12-03 15:29:50 +00:00
/api/v1/{status_id}/signature:
get:
summary: Sign post data with instance key
parameters:
- $ref: '#/components/parameters/status_id'
responses:
200:
description: Signature created
content:
application/json:
schema:
type: object
properties:
v:
type: integer
format: int64
example: 27
r:
type: string
example: '6f61670e67bf72...'
s:
type: string
example: '6a5cb313907cd3...'
403:
description: Post does not belong to user or is not public
2021-12-03 15:29:50 +00:00
404:
description: Post not found
418:
description: Ethereum integration is not enabled
422:
description: Post is not saved to IPFS
/api/v1/{status_id}/token_minted:
post:
summary: Register transaction that mints a token
parameters:
- $ref: '#/components/parameters/status_id'
requestBody:
content:
application/json:
schema:
properties:
transaction_id:
type: string
description: Transaction ID
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
403:
description: Post does not belong to user or is not public
404:
description: Post not found
422:
description: Transaction already registered
2021-12-03 15:29:50 +00:00
components:
parameters:
status_id:
name: status_id
in: path
description: Post ID
required: true
schema:
type: string
format: uuid
schemas:
Status:
type: object
properties:
id:
type: string
format: uuid
ipfs_cid:
type: string
nullable: true
example: 'bafkr...'
token_tx_id:
type: string
nullable: true
example: '0x5fe80cdea7f...'