4331 lines
153 KiB
JSON
4331 lines
153 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "API for SCN",
|
|
"title": "SimpleCloudNotifier API",
|
|
"contact": {},
|
|
"version": "2.0"
|
|
},
|
|
"host": "simplecloudnotifier.de",
|
|
"basePath": "/",
|
|
"paths": {
|
|
"/": {
|
|
"post": {
|
|
"description": "All parameter can be set via query-parameter or the json body. Only UserID, UserKey and Title are required",
|
|
"tags": [
|
|
"External"
|
|
],
|
|
"summary": "Send a new message",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"example": "test",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "This is a message",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646",
|
|
"name": "msg_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"type": "integer",
|
|
"example": 1,
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "example-server",
|
|
"name": "sender_name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"example": 1669824037,
|
|
"name": "timestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "Hello World",
|
|
"name": "title",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.combined"
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "test",
|
|
"name": "channel",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "This is a message",
|
|
"name": "content",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646",
|
|
"name": "msg_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"type": "integer",
|
|
"example": 1,
|
|
"name": "priority",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "example-server",
|
|
"name": "sender_name",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"example": 1669824037,
|
|
"name": "timestamp",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "Hello World",
|
|
"name": "title",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "The user_id was not found or the user_key is wrong",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "The user has exceeded its daily quota - wait 24 hours or upgrade your account",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "An internal server error occurred - try again later",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/ack.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Acknowledge that a message was received",
|
|
"operationId": "compat-ack",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the message id",
|
|
"name": "scn_msg_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the message id",
|
|
"name": "scn_msg_id",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Ack.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/db-test": {
|
|
"post": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Check for a working database connection",
|
|
"operationId": "api-common-dbtest",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.DatabaseTest.response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/expand.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Get a whole (potentially truncated) message",
|
|
"operationId": "compat-expand",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "The user_id",
|
|
"name": "user_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "The user_key",
|
|
"name": "user_key",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "The message-id",
|
|
"name": "scn_msg_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "The user_id",
|
|
"name": "user_id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "The user_key",
|
|
"name": "user_key",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "The message-id",
|
|
"name": "scn_msg_id",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Expand.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/health": {
|
|
"get": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Server Health-checks",
|
|
"operationId": "api-common-health",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Health.response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/info.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Get information about the current user",
|
|
"operationId": "compat-info",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Info.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/ping": {
|
|
"get": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Simple endpoint to test connection (any http method)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.pingResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Simple endpoint to test connection (any http method)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.pingResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Simple endpoint to test connection (any http method)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.pingResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Simple endpoint to test connection (any http method)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.pingResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Simple endpoint to test connection (any http method)",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.pingResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/register.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Register a new account",
|
|
"operationId": "compat-register",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) fcm token",
|
|
"name": "fcm_token",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"true",
|
|
"false"
|
|
],
|
|
"type": "string",
|
|
"description": "if the user is a paid account",
|
|
"name": "pro",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) IAP token",
|
|
"name": "pro_token",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) fcm token",
|
|
"name": "fcm_token",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"true",
|
|
"false"
|
|
],
|
|
"type": "string",
|
|
"description": "if the user is a paid account",
|
|
"name": "pro",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) IAP token",
|
|
"name": "pro_token",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Register.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/requery.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Return all not-acknowledged messages",
|
|
"operationId": "compat-requery",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Requery.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/sleep/{secs}": {
|
|
"post": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Return 200 after x seconds",
|
|
"operationId": "api-common-sleep",
|
|
"parameters": [
|
|
{
|
|
"type": "number",
|
|
"description": "sleep delay (in seconds)",
|
|
"name": "secs",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Sleep.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/update.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Set the fcm-token (android)",
|
|
"operationId": "compat-update",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) fcm token",
|
|
"name": "fcm_token",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) fcm token",
|
|
"name": "fcm_token",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Update.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/upgrade.php": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v1"
|
|
],
|
|
"summary": "Upgrade a free account to a paid account",
|
|
"operationId": "compat-upgrade",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"true",
|
|
"false"
|
|
],
|
|
"type": "string",
|
|
"description": "if the user is a paid account",
|
|
"name": "pro",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) IAP token",
|
|
"name": "pro_token",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_id",
|
|
"name": "user_id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the user_key",
|
|
"name": "user_key",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"true",
|
|
"false"
|
|
],
|
|
"type": "string",
|
|
"description": "if the user is a paid account",
|
|
"name": "pro",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "the (android) IAP token",
|
|
"name": "pro_token",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.Upgrade.response"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/messages": {
|
|
"get": {
|
|
"description": "The next_page_token is an opaque token, the special value \"@start\" (or empty-string) is the beginning and \"@end\" is the end\nSimply start the pagination without a next_page_token and get the next page by calling this endpoint with the returned next_page_token of the last query\nIf there are no more entries the token \"@end\" will be returned\nBy default we return long messages with a trimmed body, if trimmed=false is supplied we return full messages (this reduces the max page_size)",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all (subscribed) messages",
|
|
"operationId": "api-messages-list",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "RFC3339",
|
|
"name": "after",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "RFC3339",
|
|
"name": "before",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"collectionFormat": "csv",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"collectionFormat": "csv",
|
|
"name": "channel_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "filter",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "has_sender",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "next_page_token",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
},
|
|
"collectionFormat": "csv",
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"collectionFormat": "csv",
|
|
"name": "sender",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "trimmed",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"collectionFormat": "csv",
|
|
"name": "used_key",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListMessages.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/messages/{mid}": {
|
|
"get": {
|
|
"description": "The user must either own the message and request the resource with the READ or ADMIN Key\nOr the user must subscribe to the corresponding channel (and be confirmed) and request the resource with the READ or ADMIN Key\nThe returned message is never trimmed",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single message (untrimmed)",
|
|
"operationId": "api-messages-get",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "MessageID",
|
|
"name": "mid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Message"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "The user must own the message and request the resource with the ADMIN Key",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Delete a single message",
|
|
"operationId": "api-messages-delete",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "MessageID",
|
|
"name": "mid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Message"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/preview/channels/{cid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single channel (similar to api-channels-get, but can be called from anyone and only returns a subset of fields)",
|
|
"operationId": "api-channels-get-preview",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ChannelPreview"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "channel not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/preview/keys/{kid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single key (similar to api-tokenkeys-get, but can be called from anyone and only returns a subset of fields)",
|
|
"operationId": "api-tokenkeys-get-preview",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "TokenKeyID",
|
|
"name": "kid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.KeyTokenPreview"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/preview/users/{uid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a user (similar to api-user-get, but can be called from anyone and only returns a subset of fields)",
|
|
"operationId": "api-user-get-preview",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.UserPreview"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "user not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/sender-names": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List sender-names (of all messages this user can view, eitehr own or foreign-subscribed)",
|
|
"operationId": "api-sendernames-list",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListSenderNames.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users": {
|
|
"post": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Create a new user",
|
|
"operationId": "api-user-create",
|
|
"parameters": [
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.CreateUser.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.UserWithClientsAndKeys"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a user",
|
|
"operationId": "api-user-get",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.User"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "user not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"description": "The body-values are optional, only send the ones you want to update",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "(Partially) update a user",
|
|
"operationId": "api-user-update",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Change the username (send an empty string to clear it)",
|
|
"name": "username",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Send a verification of premium purchase",
|
|
"name": "pro_token",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.User"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "user not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/channels": {
|
|
"get": {
|
|
"description": "The possible values for 'selector' are:\n- \"owned\" Return all channels of the user\n- \"subscribed\" Return all channels that the user is subscribing to\n- \"all\" Return channels that the user owns or is subscribing\n- \"subscribed_any\" Return all channels that the user is subscribing to (even unconfirmed)\n- \"all_any\" Return channels that the user owns or is subscribing (even unconfirmed)",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List channels of a user (subscribed/owned/all)",
|
|
"operationId": "api-channels-list",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"owned",
|
|
"subscribed",
|
|
"all",
|
|
"subscribed_any",
|
|
"all_any"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter channels (default: owned)",
|
|
"name": "selector",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListChannels.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Create a new (empty) channel",
|
|
"operationId": "api-channels-create",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.CreateChannel.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ChannelWithSubscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "channel already exists",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/channels/{cid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single channel",
|
|
"operationId": "api-channels-get",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ChannelWithSubscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "channel not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "(Partially) update a channel",
|
|
"operationId": "api-channels-update",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Send `true` to create a new subscribe_key",
|
|
"name": "subscribe_key",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Send `true` to create a new send_key",
|
|
"name": "send_key",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Change the cahnnel display-name (only chnages to lowercase/uppercase are allowed - internal_name must stay the same)",
|
|
"name": "display_name",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ChannelWithSubscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "channel not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/channels/{cid}/messages": {
|
|
"get": {
|
|
"description": "The next_page_token is an opaque token, the special value \"@start\" (or empty-string) is the beginning and \"@end\" is the end\nSimply start the pagination without a next_page_token and get the next page by calling this endpoint with the returned next_page_token of the last query\nIf there are no more entries the token \"@end\" will be returned\nBy default we return long messages with a trimmed body, if trimmed=false is supplied we return full messages (this reduces the max page_size)",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List messages of a channel",
|
|
"operationId": "api-channel-messages",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"name": "filter",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "next_page_token",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "trimmed",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListChannelMessages.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "channel not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/channels/{cid}/subscriptions": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all subscriptions of a channel",
|
|
"operationId": "api-chan-subscriptions-list",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListChannelSubscriptions.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "channel not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/clients": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all clients",
|
|
"operationId": "api-clients-list",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListClients.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Add a new clients",
|
|
"operationId": "api-clients-create",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.AddClient.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Client"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/clients/{cid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single client",
|
|
"operationId": "api-clients-get",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ClientID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Client"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "client not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Delete a client",
|
|
"operationId": "api-clients-delete",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ClientID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Client"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "client not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"description": "The body-values are optional, only send the ones you want to update",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "(Partially) update a client",
|
|
"operationId": "api-client-update",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "ClientID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Change the clientname (send an empty string to clear it)",
|
|
"name": "clientname",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Send a verification of premium purchase",
|
|
"name": "pro_token",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Client"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "client is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "client not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/keys": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List sender-names (of allthe messages of this user)",
|
|
"operationId": "api-usersendernames-list",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListUserKeys.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Create a new key",
|
|
"operationId": "api-tokenkeys-create",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.CreateUserKey.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.KeyToken"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/keys/current": {
|
|
"get": {
|
|
"description": "Can be done with keys of any permission - the returned key does not include its token.",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get the key currently used by this request",
|
|
"operationId": "api-tokenkeys-get-current",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "TokenKeyID",
|
|
"name": "kid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.KeyToken"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/keys/{kid}": {
|
|
"get": {
|
|
"description": "The request must be done with an ADMIN key, the returned key does not include its token.",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single key",
|
|
"operationId": "api-tokenkeys-get",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "TokenKeyID",
|
|
"name": "kid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.KeyToken"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Cannot be used to delete the key used in the request itself",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Delete a key",
|
|
"operationId": "api-tokenkeys-delete",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "TokenKeyID",
|
|
"name": "kid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.KeyToken"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Update a key",
|
|
"operationId": "api-tokenkeys-update",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "TokenKeyID",
|
|
"name": "kid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.UpdateUserKey.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.KeyToken"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "message not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/subscriptions": {
|
|
"get": {
|
|
"description": "The possible values for 'direction' are:\n- \"outgoing\" Subscriptions with the user as subscriber (= subscriptions he can use to read channels)\n- \"incoming\" Subscriptions to channels of this user (= incoming subscriptions and subscription requests)\n- \"both\" Combines \"outgoing\" and \"incoming\" (default)\n\nThe possible values for 'confirmation' are:\n- \"confirmed\" Confirmed (active) subscriptions\n- \"unconfirmed\" Unconfirmed (pending) subscriptions\n- \"all\" Combines \"confirmed\" and \"unconfirmed\" (default)\n\nThe possible values for 'external' are:\n- \"true\" Subscriptions with subscriber_user_id != channel_owner_user_id (subscriptions from other users)\n- \"false\" Subscriptions with subscriber_user_id == channel_owner_user_id (subscriptions from this user to his own channels)\n- \"all\" Combines \"external\" and \"internal\" (default)\n\nThe `subscriber_user_id` parameter can be used to additionally filter the subscriber_user_id (return subscribtions from a specific user)\n\nThe `channel_owner_user_id` parameter can be used to additionally filter the channel_owner_user_id (return subscribtions to a specific user)",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all subscriptions of a user (incoming/owned)",
|
|
"operationId": "api-user-subscriptions-list",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"outgoing_all",
|
|
"outgoing_confirmed",
|
|
"outgoing_unconfirmed",
|
|
"incoming_all",
|
|
"incoming_confirmed",
|
|
"incoming_unconfirmed"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter subscriptions (default: outgoing_all)",
|
|
"name": "selector",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListUserSubscriptions.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Either [channel_owner_user_id, channel_internal_name] or [channel_id] must be supplied in the request body",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Create/Request a subscription",
|
|
"operationId": "api-subscriptions-create",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "chan_subscribe_key",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_data",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.CreateSubscription.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/users/{uid}/subscriptions/{sid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single subscription",
|
|
"operationId": "api-subscriptions-get",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "SubscriptionID",
|
|
"name": "sid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "subscription not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Cancel (delete) subscription",
|
|
"operationId": "api-subscriptions-delete",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "SubscriptionID",
|
|
"name": "sid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "subscription not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Update a subscription (e.g. confirm)",
|
|
"operationId": "api-subscriptions-update",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "SubscriptionID",
|
|
"name": "sid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_data",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.UpdateSubscription.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "supplied values/parameters cannot be parsed / are invalid",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "user is not authorized / has missing permissions",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "subscription not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/external/v1/uptime-kuma": {
|
|
"post": {
|
|
"description": "All parameter can be set via query-parameter or the json body. Only UserID, UserKey and Title are required",
|
|
"tags": [
|
|
"External"
|
|
],
|
|
"summary": "Send a new message",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel_down",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel_up",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority_down",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority_up",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "senderName",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.UptimeKuma.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.UptimeKuma.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "The user_id was not found or the user_key is wrong",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "The user has exceeded its daily quota - wait 24 hours or upgrade your account",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "An internal server error occurred - try again later",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/send": {
|
|
"post": {
|
|
"description": "All parameter can be set via query-parameter or the json body. Only UserID, UserKey and Title are required",
|
|
"tags": [
|
|
"External"
|
|
],
|
|
"summary": "Send a new message",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"example": "test",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "This is a message",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646",
|
|
"name": "msg_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"type": "integer",
|
|
"example": 1,
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "example-server",
|
|
"name": "sender_name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"example": 1669824037,
|
|
"name": "timestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "Hello World",
|
|
"name": "title",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.combined"
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "test",
|
|
"name": "channel",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "This is a message",
|
|
"name": "content",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646",
|
|
"name": "msg_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"type": "integer",
|
|
"example": 1,
|
|
"name": "priority",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "example-server",
|
|
"name": "sender_name",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"example": 1669824037,
|
|
"name": "timestamp",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "Hello World",
|
|
"name": "title",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "The user_id was not found or the user_key is wrong",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "The user has exceeded its daily quota - wait 24 hours or upgrade your account",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "An internal server error occurred - try again later",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/send.php": {
|
|
"post": {
|
|
"description": "All parameter can be set via query-parameter or form-data body. Only UserID, UserKey and Title are required",
|
|
"tags": [
|
|
"External"
|
|
],
|
|
"summary": "Send a new message (compatibility)",
|
|
"deprecated": true,
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"example": "test",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "This is a message",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646",
|
|
"name": "msg_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"type": "integer",
|
|
"example": 1,
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "example-server",
|
|
"name": "sender_name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"example": 1669824037,
|
|
"name": "timestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "Hello World",
|
|
"name": "title",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "test",
|
|
"name": "channel",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "This is a message",
|
|
"name": "content",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm",
|
|
"name": "key",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646",
|
|
"name": "msg_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"type": "integer",
|
|
"example": 1,
|
|
"name": "priority",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "example-server",
|
|
"name": "sender_name",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"example": 1669824037,
|
|
"name": "timestamp",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "Hello World",
|
|
"name": "title",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"example": "7725",
|
|
"name": "user_id",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"apierr.APIError": {
|
|
"type": "integer",
|
|
"enum": [
|
|
-1,
|
|
0,
|
|
1101,
|
|
1102,
|
|
1103,
|
|
1104,
|
|
1105,
|
|
1106,
|
|
1121,
|
|
1151,
|
|
1152,
|
|
1153,
|
|
1152,
|
|
1161,
|
|
1171,
|
|
1201,
|
|
1202,
|
|
1203,
|
|
1204,
|
|
1205,
|
|
1206,
|
|
1207,
|
|
1208,
|
|
1209,
|
|
1301,
|
|
1302,
|
|
1303,
|
|
1304,
|
|
1305,
|
|
1306,
|
|
1307,
|
|
1311,
|
|
1401,
|
|
1501,
|
|
1511,
|
|
1512,
|
|
2101,
|
|
3001,
|
|
3002,
|
|
9901,
|
|
9902,
|
|
9903,
|
|
9904,
|
|
9905
|
|
],
|
|
"x-enum-varnames": [
|
|
"UNDEFINED",
|
|
"NO_ERROR",
|
|
"MISSING_UID",
|
|
"MISSING_TOK",
|
|
"MISSING_TITLE",
|
|
"INVALID_PRIO",
|
|
"REQ_METHOD",
|
|
"INVALID_CLIENTTYPE",
|
|
"PAGETOKEN_ERROR",
|
|
"BINDFAIL_QUERY_PARAM",
|
|
"BINDFAIL_BODY_PARAM",
|
|
"BINDFAIL_URI_PARAM",
|
|
"BINDFAIL_HEADER_PARAM",
|
|
"INVALID_BODY_PARAM",
|
|
"INVALID_ENUM_VALUE",
|
|
"NO_TITLE",
|
|
"TITLE_TOO_LONG",
|
|
"CONTENT_TOO_LONG",
|
|
"USR_MSG_ID_TOO_LONG",
|
|
"TIMESTAMP_OUT_OF_RANGE",
|
|
"SENDERNAME_TOO_LONG",
|
|
"CHANNEL_TOO_LONG",
|
|
"CHANNEL_DESCRIPTION_TOO_LONG",
|
|
"CHANNEL_NAME_EMPTY",
|
|
"USER_NOT_FOUND",
|
|
"CLIENT_NOT_FOUND",
|
|
"CHANNEL_NOT_FOUND",
|
|
"SUBSCRIPTION_NOT_FOUND",
|
|
"MESSAGE_NOT_FOUND",
|
|
"SUBSCRIPTION_USER_MISMATCH",
|
|
"KEY_NOT_FOUND",
|
|
"USER_AUTH_FAILED",
|
|
"NO_DEVICE_LINKED",
|
|
"CHANNEL_ALREADY_EXISTS",
|
|
"CANNOT_SELFDELETE_KEY",
|
|
"CANNOT_SELFUPDATE_KEY",
|
|
"QUOTA_REACHED",
|
|
"FAILED_VERIFY_PRO_TOKEN",
|
|
"INVALID_PRO_TOKEN",
|
|
"FIREBASE_COM_FAILED",
|
|
"FIREBASE_COM_ERRORED",
|
|
"INTERNAL_EXCEPTION",
|
|
"PANIC",
|
|
"NOT_IMPLEMENTED"
|
|
]
|
|
},
|
|
"ginresp.apiError": {
|
|
"type": "object",
|
|
"properties": {
|
|
"errhighlight": {
|
|
"type": "integer"
|
|
},
|
|
"error": {
|
|
"type": "integer"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"ginresp.compatAPIError": {
|
|
"type": "object",
|
|
"properties": {
|
|
"errid": {
|
|
"type": "integer"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.Ack.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"new_ack": {
|
|
"type": "integer"
|
|
},
|
|
"prev_ack": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.AddClient.body": {
|
|
"type": "object",
|
|
"required": [
|
|
"agent_model",
|
|
"agent_version",
|
|
"client_type",
|
|
"fcm_token"
|
|
],
|
|
"properties": {
|
|
"agent_model": {
|
|
"type": "string"
|
|
},
|
|
"agent_version": {
|
|
"type": "string"
|
|
},
|
|
"client_type": {
|
|
"$ref": "#/definitions/models.ClientType"
|
|
},
|
|
"fcm_token": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.CreateChannel.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"subscribe": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.CreateSubscription.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "string"
|
|
},
|
|
"channel_internal_name": {
|
|
"type": "string"
|
|
},
|
|
"channel_owner_user_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.CreateUser.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"agent_model": {
|
|
"type": "string"
|
|
},
|
|
"agent_version": {
|
|
"type": "string"
|
|
},
|
|
"client_name": {
|
|
"type": "string"
|
|
},
|
|
"client_type": {
|
|
"$ref": "#/definitions/models.ClientType"
|
|
},
|
|
"fcm_token": {
|
|
"type": "string"
|
|
},
|
|
"no_client": {
|
|
"type": "boolean"
|
|
},
|
|
"pro_token": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.CreateUserKey.body": {
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"permissions"
|
|
],
|
|
"properties": {
|
|
"all_channels": {
|
|
"type": "boolean"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.DatabaseTest.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"libVersion": {
|
|
"type": "string"
|
|
},
|
|
"sourceID": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.Expand.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/models.CompatMessage"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.Health.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.Info.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"fcm_token_set": {
|
|
"type": "boolean"
|
|
},
|
|
"is_pro": {
|
|
"type": "integer"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"quota": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"unack_count": {
|
|
"type": "integer"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
},
|
|
"user_key": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.ListChannelMessages.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"messages": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Message"
|
|
}
|
|
},
|
|
"next_page_token": {
|
|
"type": "string"
|
|
},
|
|
"page_size": {
|
|
"type": "integer"
|
|
},
|
|
"total_count": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.ListChannelSubscriptions.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subscriptions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListChannels.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.ChannelWithSubscription"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListClients.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"clients": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Client"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListMessages.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"messages": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Message"
|
|
}
|
|
},
|
|
"next_page_token": {
|
|
"type": "string"
|
|
},
|
|
"page_size": {
|
|
"type": "integer"
|
|
},
|
|
"total_count": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.ListSenderNames.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sender_names": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.SenderNameStatistics"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListUserKeys.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"keys": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.KeyToken"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListUserSubscriptions.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subscriptions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.Register.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"quota": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
},
|
|
"user_key": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.Requery.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.CompatMessage"
|
|
}
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.SendMessage.combined": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel": {
|
|
"type": "string",
|
|
"example": "test"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"example": "This is a message"
|
|
},
|
|
"key": {
|
|
"type": "string",
|
|
"example": "P3TNH8mvv14fm"
|
|
},
|
|
"msg_id": {
|
|
"type": "string",
|
|
"example": "db8b0e6a-a08c-4646"
|
|
},
|
|
"priority": {
|
|
"type": "integer",
|
|
"enum": [
|
|
0,
|
|
1,
|
|
2
|
|
],
|
|
"example": 1
|
|
},
|
|
"sender_name": {
|
|
"type": "string",
|
|
"example": "example-server"
|
|
},
|
|
"timestamp": {
|
|
"type": "number",
|
|
"example": 1669824037
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"example": "Hello World"
|
|
},
|
|
"user_id": {
|
|
"type": "string",
|
|
"example": "7725"
|
|
}
|
|
}
|
|
},
|
|
"handler.SendMessage.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"errhighlight": {
|
|
"type": "integer"
|
|
},
|
|
"error": {
|
|
"$ref": "#/definitions/apierr.APIError"
|
|
},
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"messagecount": {
|
|
"type": "integer"
|
|
},
|
|
"quota": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"scn_msg_id": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"suppress_send": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.Sleep.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"duration": {
|
|
"type": "number"
|
|
},
|
|
"end": {
|
|
"type": "string"
|
|
},
|
|
"start": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.Update.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"is_pro": {
|
|
"type": "integer"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"quota": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
},
|
|
"user_key": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.UpdateSubscription.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"confirmed": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.UpdateUserKey.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"all_channels": {
|
|
"type": "boolean"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.Upgrade.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"quota": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.UptimeKuma.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"heartbeat": {
|
|
"type": "object",
|
|
"properties": {
|
|
"localDateTime": {
|
|
"type": "string"
|
|
},
|
|
"msg": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "integer"
|
|
},
|
|
"time": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"timezoneOffset": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"monitor": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"msg": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.UptimeKuma.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.pingResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"info": {
|
|
"$ref": "#/definitions/handler.pingResponseInfo"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.pingResponseInfo": {
|
|
"type": "object",
|
|
"properties": {
|
|
"addr": {
|
|
"type": "string"
|
|
},
|
|
"headers": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"method": {
|
|
"type": "string"
|
|
},
|
|
"request": {
|
|
"type": "string"
|
|
},
|
|
"uri": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.ChannelPreview": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "string"
|
|
},
|
|
"description_name": {
|
|
"type": "string"
|
|
},
|
|
"display_name": {
|
|
"type": "string"
|
|
},
|
|
"internal_name": {
|
|
"type": "string"
|
|
},
|
|
"owner_user_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.ChannelWithSubscription": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "string"
|
|
},
|
|
"description_name": {
|
|
"description": "= DescriptionName, (optional), longer description text, initally nil",
|
|
"type": "string"
|
|
},
|
|
"display_name": {
|
|
"description": "= DisplayName, used for display purposes, can be changed, initially equals InternalName",
|
|
"type": "string"
|
|
},
|
|
"internal_name": {
|
|
"description": "= InternalName, used for sending, normalized, cannot be changed",
|
|
"type": "string"
|
|
},
|
|
"messages_sent": {
|
|
"type": "integer"
|
|
},
|
|
"owner_user_id": {
|
|
"type": "string"
|
|
},
|
|
"subscribe_key": {
|
|
"description": "can be nil, depending on endpoint",
|
|
"type": "string"
|
|
},
|
|
"subscription": {
|
|
"$ref": "#/definitions/models.Subscription"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_lastsent": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.Client": {
|
|
"type": "object",
|
|
"properties": {
|
|
"agent_model": {
|
|
"type": "string"
|
|
},
|
|
"agent_version": {
|
|
"type": "string"
|
|
},
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"fcm_token": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"$ref": "#/definitions/models.ClientType"
|
|
},
|
|
"user_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.ClientType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"ANDROID",
|
|
"IOS",
|
|
"LINUX",
|
|
"MACOS",
|
|
"WINDOWS"
|
|
],
|
|
"x-enum-varnames": [
|
|
"ClientTypeAndroid",
|
|
"ClientTypeIOS",
|
|
"ClientTypeLinux",
|
|
"ClientTypeMacOS",
|
|
"ClientTypeWindows"
|
|
]
|
|
},
|
|
"models.CompatMessage": {
|
|
"type": "object",
|
|
"properties": {
|
|
"body": {
|
|
"type": "string"
|
|
},
|
|
"priority": {
|
|
"type": "integer"
|
|
},
|
|
"scn_msg_id": {
|
|
"type": "integer"
|
|
},
|
|
"timestamp": {
|
|
"type": "integer"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"trimmed": {
|
|
"type": "boolean"
|
|
},
|
|
"usr_msg_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.KeyToken": {
|
|
"type": "object",
|
|
"properties": {
|
|
"all_channels": {
|
|
"type": "boolean"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"keytoken_id": {
|
|
"type": "string"
|
|
},
|
|
"messages_sent": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"owner_user_id": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.TokenPerm"
|
|
}
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_lastused": {
|
|
"type": "string"
|
|
},
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.KeyTokenPreview": {
|
|
"type": "object",
|
|
"properties": {
|
|
"all_channels": {
|
|
"type": "boolean"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"keytoken_id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"owner_user_id": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.Message": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "string"
|
|
},
|
|
"channel_internal_name": {
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
},
|
|
"message_id": {
|
|
"type": "string"
|
|
},
|
|
"priority": {
|
|
"type": "integer"
|
|
},
|
|
"sender_ip": {
|
|
"type": "string"
|
|
},
|
|
"sender_name": {
|
|
"type": "string"
|
|
},
|
|
"sender_user_id": {
|
|
"description": "user that sent the message (this is also the owner of the channel that contains it)",
|
|
"type": "string"
|
|
},
|
|
"timestamp": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"trimmed": {
|
|
"type": "boolean"
|
|
},
|
|
"used_key_id": {
|
|
"type": "string"
|
|
},
|
|
"usr_message_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.SenderNameStatistics": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer"
|
|
},
|
|
"first_timestamp": {
|
|
"type": "string"
|
|
},
|
|
"last_timestamp": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.Subscription": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "string"
|
|
},
|
|
"channel_internal_name": {
|
|
"type": "string"
|
|
},
|
|
"channel_owner_user_id": {
|
|
"type": "string"
|
|
},
|
|
"confirmed": {
|
|
"type": "boolean"
|
|
},
|
|
"subscriber_user_id": {
|
|
"type": "string"
|
|
},
|
|
"subscription_id": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.TokenPerm": {
|
|
"type": "string",
|
|
"enum": [
|
|
"A",
|
|
"CR",
|
|
"CS",
|
|
"UR"
|
|
],
|
|
"x-enum-comments": {
|
|
"PermAdmin": "Edit userdata (+ includes all other permissions)",
|
|
"PermChannelRead": "Read messages",
|
|
"PermChannelSend": "Send messages",
|
|
"PermUserRead": "Read userdata"
|
|
},
|
|
"x-enum-varnames": [
|
|
"PermAdmin",
|
|
"PermChannelRead",
|
|
"PermChannelSend",
|
|
"PermUserRead"
|
|
]
|
|
},
|
|
"models.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"default_channel": {
|
|
"type": "string"
|
|
},
|
|
"default_priority": {
|
|
"type": "integer"
|
|
},
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"max_body_size": {
|
|
"type": "integer"
|
|
},
|
|
"max_channel_description_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_channel_name_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_sender_name_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_title_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_user_message_id_length": {
|
|
"type": "integer"
|
|
},
|
|
"messages_sent": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"quota_remaining": {
|
|
"type": "integer"
|
|
},
|
|
"quota_used": {
|
|
"type": "integer"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_lastread": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_lastsent": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.UserPreview": {
|
|
"type": "object",
|
|
"properties": {
|
|
"user_id": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.UserWithClientsAndKeys": {
|
|
"type": "object",
|
|
"properties": {
|
|
"admin_key": {
|
|
"type": "string"
|
|
},
|
|
"clients": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Client"
|
|
}
|
|
},
|
|
"default_channel": {
|
|
"type": "string"
|
|
},
|
|
"default_priority": {
|
|
"type": "integer"
|
|
},
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"max_body_size": {
|
|
"type": "integer"
|
|
},
|
|
"max_channel_description_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_channel_name_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_sender_name_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_title_length": {
|
|
"type": "integer"
|
|
},
|
|
"max_user_message_id_length": {
|
|
"type": "integer"
|
|
},
|
|
"messages_sent": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"quota_remaining": {
|
|
"type": "integer"
|
|
},
|
|
"quota_used": {
|
|
"type": "integer"
|
|
},
|
|
"read_key": {
|
|
"type": "string"
|
|
},
|
|
"send_key": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_lastread": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_lastsent": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "External"
|
|
},
|
|
{
|
|
"name": "API-v1"
|
|
},
|
|
{
|
|
"name": "API-v2"
|
|
},
|
|
{
|
|
"name": "Common"
|
|
}
|
|
]
|
|
} |