kopia lustrzana https://github.com/reiver/greatape
460 wiersze
13 KiB
JSON
460 wiersze
13 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "GreatApe is a free audio and video social-media platform that can be used via an app.\nIt is a Fediverse technology that supports federation via ActivityPub.",
|
|
"title": "GreatApe API",
|
|
"contact": {},
|
|
"version": "1.0"
|
|
},
|
|
"basePath": "/",
|
|
"paths": {
|
|
"/.well-known/webfinger": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"WebFinger"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"default": "acct:user@domain.com",
|
|
"description": "Resource",
|
|
"name": "resource",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/feed/types": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Feed"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/login": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authentication"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"description": "Payload",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/LoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/LoginResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"User"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/signup": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authentication"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"description": "Payload",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/SignupRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/SignupResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/users/{username}/feed": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Feed"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Username",
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/verify": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authentication"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"description": "Payload",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/VerifyRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/VerifyResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/u/{username}": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"ActivityPub"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Username",
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/u/{username}/followers": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"ActivityPub"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Username",
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/u/{username}/following": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"ActivityPub"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Username",
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Auth": {
|
|
"type": "object",
|
|
"properties": {
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"LoginRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"email",
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"LoginResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"auth": {
|
|
"$ref": "#/definitions/Auth"
|
|
},
|
|
"user": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
},
|
|
"SignupRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"email",
|
|
"password",
|
|
"username"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SignupResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"actor": {
|
|
"type": "string"
|
|
},
|
|
"api_key": {
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"type": "string"
|
|
},
|
|
"banner": {
|
|
"type": "string"
|
|
},
|
|
"bio": {
|
|
"type": "string"
|
|
},
|
|
"display_name": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"github": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"private_profile": {
|
|
"type": "boolean"
|
|
},
|
|
"public_key": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"webfinger": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"VerifyRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"code",
|
|
"email"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"VerifyResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"auth": {
|
|
"$ref": "#/definitions/Auth"
|
|
},
|
|
"user": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"JWT": {
|
|
"description": "Example: Bearer {Your JWT Token}",
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
} |