2798 lines
96 KiB
JSON
2798 lines
96 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "API for SCN",
|
|
"title": "SimpleCloudNotifier API",
|
|
"contact": {},
|
|
"version": "2.0"
|
|
},
|
|
"host": "scn.blackforestbytes.com",
|
|
"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",
|
|
"name": "chanKey",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "sendTimestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "userID",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userKey",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userMessageID",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.body"
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "chan_key",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "content",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "msg_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "timestamp",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "user_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "user_key",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.sendMessageInternal.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/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/db-test": {
|
|
"get": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Check for a wroking 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/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/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/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",
|
|
"name": "filter",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "nextPageToken",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "pageSize",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "trimmed",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListMessages.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "This is similar to the main route `POST -\u003e https://scn.blackfrestbytes.com/`\nBut this route can change in the future, for long-living scripts etc. it's better to use the normal POST route",
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Create a new message",
|
|
"operationId": "api-messages-create",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"name": "chan_key",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "msg_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "timestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.MessageJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/messages/{mid}": {
|
|
"patch": {
|
|
"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": "integer",
|
|
"description": "SCNMessageID",
|
|
"name": "mid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.MessageJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/ping": {
|
|
"get": {
|
|
"tags": [
|
|
"Common"
|
|
],
|
|
"summary": "Simple endpoint to test connection (any http method)",
|
|
"operationId": "api-common-ping",
|
|
"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)",
|
|
"operationId": "api-common-ping",
|
|
"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)",
|
|
"operationId": "api-common-ping",
|
|
"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)",
|
|
"operationId": "api-common-ping",
|
|
"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)",
|
|
"operationId": "api-common-ping",
|
|
"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/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/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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/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/ginresp.compatAPIError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/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/handler.sendMessageInternal.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a user",
|
|
"operationId": "api-user-get",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.UserJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "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": "integer",
|
|
"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 permium purchase",
|
|
"name": "pro_token",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Send `true` to create a new read_key",
|
|
"name": "read_key",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Send `true` to create a new send_key",
|
|
"name": "send_key",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Send `true` to create a new admin_key",
|
|
"name": "admin_key",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.UserJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/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)",
|
|
"operationId": "api-channels-list",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"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",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListChannels.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}/channels/{cid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all channels of a user",
|
|
"operationId": "api-channels-get",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ChannelJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "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": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"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"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ChannelJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/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": "nextPageToken",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "pageSize",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "trimmed",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListChannelMessages.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}/channels/{cid}/subscriptions": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all subscriptions of a channel",
|
|
"operationId": "api-chan-subscriptions-list",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "ChannelID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListChannelSubscriptions.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}/clients": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all clients",
|
|
"operationId": "api-clients-list",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListClients.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Delete a client",
|
|
"operationId": "api-clients-delete",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "ClientID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ClientJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}/clients/{cid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single clients",
|
|
"operationId": "api-clients-get",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "ClientID",
|
|
"name": "cid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ClientJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}/subscriptions": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "List all channels of a user",
|
|
"operationId": "api-user-subscriptions-list",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.ListUserSubscriptions.response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Creare/Request a subscription",
|
|
"operationId": "api-subscriptions-create",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "chanSubscribeKey",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_data",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.CreateSubscription.body"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.SubscriptionJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{uid}/subscriptions/{sid}": {
|
|
"get": {
|
|
"tags": [
|
|
"API-v2"
|
|
],
|
|
"summary": "Get a single subscription",
|
|
"operationId": "api-subscriptions-get",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "SubscriptionID",
|
|
"name": "sid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.SubscriptionJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "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": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "SubscriptionID",
|
|
"name": "sid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.SubscriptionJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "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": "integer",
|
|
"description": "UserID",
|
|
"name": "uid",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "SubscriptionID",
|
|
"name": "sid",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.SubscriptionJSON"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/ginresp.apiError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"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",
|
|
"name": "chanKey",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "sendTimestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "userID",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userKey",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userMessageID",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"description": " ",
|
|
"name": "post_body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.SendMessage.body"
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "chan_key",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "channel",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "content",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "msg_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "timestamp",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "user_id",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "user_key",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.sendMessageInternal.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",
|
|
"name": "content",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "sendTimestamp",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "userID",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userKey",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userMessageID",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "content",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "priority",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "sendTimestamp",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"name": "userID",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userKey",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "userMessageID",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.sendMessageInternal.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": {
|
|
"ginresp.apiError": {
|
|
"type": "object",
|
|
"properties": {
|
|
"errhighlight": {
|
|
"type": "integer"
|
|
},
|
|
"error": {
|
|
"type": "integer"
|
|
},
|
|
"errorObj": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"traceObj": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"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": {
|
|
"type": "string"
|
|
},
|
|
"fcm_token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.CreateSubscription.body": {
|
|
"type": "object",
|
|
"required": [
|
|
"channel",
|
|
"channelOwnerUserID"
|
|
],
|
|
"properties": {
|
|
"channel": {
|
|
"type": "string"
|
|
},
|
|
"channelOwnerUserID": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.CreateUser.body": {
|
|
"type": "object",
|
|
"required": [
|
|
"agent_model",
|
|
"agent_version",
|
|
"client_type",
|
|
"fcm_token"
|
|
],
|
|
"properties": {
|
|
"agent_model": {
|
|
"type": "string"
|
|
},
|
|
"agent_version": {
|
|
"type": "string"
|
|
},
|
|
"client_type": {
|
|
"type": "string"
|
|
},
|
|
"fcm_token": {
|
|
"type": "string"
|
|
},
|
|
"pro_token": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handler.DatabaseTest.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"libVersion": {
|
|
"type": "string"
|
|
},
|
|
"libVersionNumber": {
|
|
"type": "integer"
|
|
},
|
|
"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.MessageJSON"
|
|
}
|
|
},
|
|
"next_page_token": {
|
|
"type": "string"
|
|
},
|
|
"page_size": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.ListChannelSubscriptions.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subscriptions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.SubscriptionJSON"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListChannels.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.ChannelJSON"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListClients.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"clients": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.ClientJSON"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.ListMessages.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"messages": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.MessageJSON"
|
|
}
|
|
},
|
|
"next_page_token": {
|
|
"type": "string"
|
|
},
|
|
"page_size": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.ListUserSubscriptions.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subscriptions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.SubscriptionJSON"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"handler.Register.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.Requery.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.CompatMessage"
|
|
}
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handler.SendMessage.body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"chan_key": {
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
},
|
|
"msg_id": {
|
|
"type": "string"
|
|
},
|
|
"priority": {
|
|
"type": "integer"
|
|
},
|
|
"timestamp": {
|
|
"type": "number"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
},
|
|
"user_key": {
|
|
"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.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.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"
|
|
}
|
|
}
|
|
},
|
|
"handler.sendMessageInternal.response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"errhighlight": {
|
|
"type": "integer"
|
|
},
|
|
"error": {
|
|
"type": "integer"
|
|
},
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"messagecount": {
|
|
"type": "integer"
|
|
},
|
|
"quota": {
|
|
"type": "integer"
|
|
},
|
|
"quota_max": {
|
|
"type": "integer"
|
|
},
|
|
"scn_msg_id": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"suppress_send": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"models.ChannelJSON": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "integer"
|
|
},
|
|
"messages_sent": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"owner_user_id": {
|
|
"type": "integer"
|
|
},
|
|
"send_key": {
|
|
"description": "can be nil, depending on endpoint",
|
|
"type": "string"
|
|
},
|
|
"subscribe_key": {
|
|
"description": "can be nil, depending on endpoint",
|
|
"type": "string"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_last_sent": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.ClientJSON": {
|
|
"type": "object",
|
|
"properties": {
|
|
"agent_model": {
|
|
"type": "string"
|
|
},
|
|
"agent_version": {
|
|
"type": "string"
|
|
},
|
|
"client_id": {
|
|
"type": "integer"
|
|
},
|
|
"fcm_token": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"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.MessageJSON": {
|
|
"type": "object",
|
|
"properties": {
|
|
"body": {
|
|
"type": "string"
|
|
},
|
|
"channel_id": {
|
|
"type": "integer"
|
|
},
|
|
"channel_name": {
|
|
"type": "string"
|
|
},
|
|
"owner_user_id": {
|
|
"type": "integer"
|
|
},
|
|
"priority": {
|
|
"type": "integer"
|
|
},
|
|
"scn_message_id": {
|
|
"type": "integer"
|
|
},
|
|
"sender_user_id": {
|
|
"type": "integer"
|
|
},
|
|
"timestamp": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"trimmed": {
|
|
"type": "boolean"
|
|
},
|
|
"usr_message_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.SubscriptionJSON": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "integer"
|
|
},
|
|
"channel_name": {
|
|
"type": "string"
|
|
},
|
|
"channel_owner_user_id": {
|
|
"type": "integer"
|
|
},
|
|
"confirmed": {
|
|
"type": "boolean"
|
|
},
|
|
"subscriber_user_id": {
|
|
"type": "integer"
|
|
},
|
|
"subscription_id": {
|
|
"type": "integer"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.UserJSON": {
|
|
"type": "object",
|
|
"properties": {
|
|
"admin_key": {
|
|
"type": "string"
|
|
},
|
|
"default_channel": {
|
|
"type": "string"
|
|
},
|
|
"is_pro": {
|
|
"type": "boolean"
|
|
},
|
|
"messages_sent": {
|
|
"type": "integer"
|
|
},
|
|
"quota_used": {
|
|
"type": "integer"
|
|
},
|
|
"quota_used_day": {
|
|
"type": "string"
|
|
},
|
|
"read_key": {
|
|
"type": "string"
|
|
},
|
|
"send_key": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_created": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_last_read": {
|
|
"type": "string"
|
|
},
|
|
"timestamp_last_sent": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Common"
|
|
},
|
|
{
|
|
"name": "External"
|
|
},
|
|
{
|
|
"name": "API-v1"
|
|
},
|
|
{
|
|
"name": "API-v2"
|
|
}
|
|
]
|
|
} |