ListMessages()

This commit is contained in:
2022-11-20 00:19:41 +01:00
parent 0d641b727f
commit 80f3b982d2
15 changed files with 1635 additions and 115 deletions

View File

@@ -11,16 +11,22 @@
"paths": {
"/": {
"post": {
"description": "All parameter can be set via query-parameter or the json body. Only UserID, UserKey and Title are required",
"summary": "Send a new message",
"parameters": [
{
"type": "string",
"name": "message_content",
"name": "chanKey",
"in": "query"
},
{
"type": "string",
"name": "message_title",
"name": "channel",
"in": "query"
},
{
"type": "string",
"name": "content",
"in": "query"
},
{
@@ -29,25 +35,30 @@
"in": "query"
},
{
"type": "integer",
"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": "user_id",
"in": "query"
},
{
"type": "string",
"name": "user_key",
"in": "query"
},
{
"description": " ",
"name": "post_body",
@@ -61,7 +72,122 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ClientJSON"
"$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"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
}
}
}
},
"/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)",
"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"
}
}
}
}
},
"/api-v2/messages/{mid}": {
"patch": {
"description": "The user must own the message and request the resource with the ADMIN Key",
"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": {
@@ -221,6 +347,161 @@
}
}
},
"/api-v2/users/{uid}/channels": {
"get": {
"summary": "List all channels of a user",
"operationId": "api-channels-list",
"parameters": [
{
"type": "integer",
"description": "UserID",
"name": "uid",
"in": "path",
"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-v2/users/{uid}/channels/{cid}": {
"get": {
"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"
}
}
}
}
},
"/api-v2/users/{uid}/channels/{cid}/subscriptions": {
"get": {
"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-v2/users/{uid}/clients": {
"get": {
"summary": "List all clients",
@@ -238,7 +519,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.ListClients.result"
"$ref": "#/definitions/handler.ListClients.response"
}
},
"400": {
@@ -374,6 +655,269 @@
}
}
},
"/api-v2/users/{uid}/subscriptions": {
"get": {
"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": {
"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-v2/users/{uid}/subscriptions/{sid}": {
"get": {
"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": {
"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": {
"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"
}
}
}
}
},
"/api/ack.php": {
"get": {
"summary": "Acknowledge that a message was received",
@@ -773,16 +1317,22 @@
},
"/send": {
"post": {
"description": "All parameter can be set via query-parameter or the json body. Only UserID, UserKey and Title are required",
"summary": "Send a new message",
"parameters": [
{
"type": "string",
"name": "message_content",
"name": "chanKey",
"in": "query"
},
{
"type": "string",
"name": "message_title",
"name": "channel",
"in": "query"
},
{
"type": "string",
"name": "content",
"in": "query"
},
{
@@ -791,25 +1341,30 @@
"in": "query"
},
{
"type": "integer",
"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": "user_id",
"in": "query"
},
{
"type": "string",
"name": "user_key",
"in": "query"
},
{
"description": " ",
"name": "post_body",
@@ -823,7 +1378,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ClientJSON"
"$ref": "#/definitions/handler.SendMessage.response"
}
},
"400": {
@@ -838,6 +1393,12 @@
"$ref": "#/definitions/ginresp.apiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"404": {
"description": "Not Found",
"schema": {
@@ -907,6 +1468,17 @@
}
}
},
"handler.CreateSubscription.body": {
"type": "object",
"properties": {
"channel": {
"type": "string"
},
"channelOwnerUserID": {
"type": "integer"
}
}
},
"handler.CreateUser.body": {
"type": "object",
"properties": {
@@ -1001,7 +1573,29 @@
}
}
},
"handler.ListClients.result": {
"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": {
@@ -1012,6 +1606,34 @@
}
}
},
"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": {
@@ -1061,29 +1683,70 @@
"handler.SendMessage.body": {
"type": "object",
"properties": {
"chanKey": {
"type": "string"
},
"channel": {
"type": "string"
},
"message_content": {
"type": "string"
},
"message_title": {
"type": "string"
},
"msg_id": {
"type": "string"
},
"priority": {
"type": "integer"
},
"sendTimestamp": {
"type": "integer"
},
"userMessageID": {
"type": "string"
"timestamp": {
"type": "number"
},
"user_id": {
"type": "string"
"type": "integer"
},
"user_key": {
"type": "string"
}
}
},
"handler.SendMessage.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"
}
}
},
"handler.Update.response": {
"type": "object",
"properties": {
@@ -1172,6 +1835,35 @@
}
}
},
"models.ChannelJSON": {
"type": "object",
"properties": {
"channel_id": {
"type": "integer"
},
"messages_sent": {
"type": "integer"
},
"name": {
"type": "string"
},
"owner_user_id": {
"type": "integer"
},
"send_key": {
"type": "string"
},
"subscribe_key": {
"type": "string"
},
"timestamp_created": {
"type": "string"
},
"timestamp_last_sent": {
"type": "string"
}
}
},
"models.ClientJSON": {
"type": "object",
"properties": {
@@ -1221,6 +1913,44 @@
}
}
},
"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.ShortCompatMessage": {
"type": "object",
"properties": {
@@ -1247,6 +1977,32 @@
}
}
},
"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": {
@@ -1259,12 +2015,12 @@
"messages_sent": {
"type": "integer"
},
"quota_day": {
"type": "string"
},
"quota_today": {
"quota_used": {
"type": "integer"
},
"quota_used_day": {
"type": "string"
},
"read_key": {
"type": "string"
},

View File

@@ -34,6 +34,13 @@ definitions:
fcm_token:
type: string
type: object
handler.CreateSubscription.body:
properties:
channel:
type: string
channelOwnerUserID:
type: integer
type: object
handler.CreateUser.body:
properties:
agent_model:
@@ -95,13 +102,45 @@ definitions:
user_key:
type: string
type: object
handler.ListClients.result:
handler.ListChannelSubscriptions.response:
properties:
subscriptions:
items:
$ref: '#/definitions/models.SubscriptionJSON'
type: array
type: object
handler.ListChannels.response:
properties:
channels:
items:
$ref: '#/definitions/models.ChannelJSON'
type: array
type: object
handler.ListClients.response:
properties:
clients:
items:
$ref: '#/definitions/models.ClientJSON'
type: array
type: object
handler.ListMessages.response:
properties:
messages:
items:
$ref: '#/definitions/models.MessageJSON'
type: array
next_page_token:
type: string
page_size:
type: integer
type: object
handler.ListUserSubscriptions.response:
properties:
subscriptions:
items:
$ref: '#/definitions/models.SubscriptionJSON'
type: array
type: object
handler.Register.response:
properties:
is_pro:
@@ -134,20 +173,47 @@ definitions:
type: object
handler.SendMessage.body:
properties:
chanKey:
type: string
channel:
type: string
message_content:
type: string
message_title:
type: string
msg_id:
type: string
priority:
type: integer
sendTimestamp:
type: integer
timestamp:
type: number
user_id:
type: string
type: integer
user_key:
type: string
userMessageID:
type: object
handler.SendMessage.response:
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
type: object
handler.Update.response:
properties:
@@ -206,6 +272,25 @@ definitions:
uri:
type: string
type: object
models.ChannelJSON:
properties:
channel_id:
type: integer
messages_sent:
type: integer
name:
type: string
owner_user_id:
type: integer
send_key:
type: string
subscribe_key:
type: string
timestamp_created:
type: string
timestamp_last_sent:
type: string
type: object
models.ClientJSON:
properties:
agent_model:
@@ -238,6 +323,31 @@ definitions:
usr_msg_id:
type: string
type: object
models.MessageJSON:
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
type: object
models.ShortCompatMessage:
properties:
body:
@@ -255,6 +365,23 @@ definitions:
usr_msg_id:
type: string
type: object
models.SubscriptionJSON:
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
type: object
models.UserJSON:
properties:
admin_key:
@@ -263,10 +390,10 @@ definitions:
type: boolean
messages_sent:
type: integer
quota_day:
type: string
quota_today:
quota_used:
type: integer
quota_used_day:
type: string
read_key:
type: string
send_key:
@@ -291,28 +418,36 @@ info:
paths:
/:
post:
description: All parameter can be set via query-parameter or the json body.
Only UserID, UserKey and Title are required
parameters:
- in: query
name: message_content
name: chanKey
type: string
- in: query
name: message_title
name: channel
type: string
- in: query
name: content
type: string
- in: query
name: priority
type: integer
- in: query
name: sendTimestamp
type: number
- in: query
name: title
type: string
- in: query
name: userID
type: integer
- in: query
name: userKey
type: string
- in: query
name: userMessageID
type: string
- in: query
name: user_id
type: string
- in: query
name: user_key
type: string
- description: ' '
in: body
name: post_body
@@ -322,7 +457,54 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/models.ClientJSON'
$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'
"404":
description: Not Found
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Send a new message
/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
Simply 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
If there are no more entries the token "@end" will be returned
By default we return long messages with a trimmed body, if trimmed=false is supplied we return full messages (this reduces the max page_size)
operationId: api-messages-list
parameters:
- in: query
name: filter
type: string
- in: query
name: nextPageToken
type: string
- in: query
name: pageSize
type: integer
- in: query
name: trimmed
type: boolean
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.ListMessages.response'
"400":
description: Bad Request
schema:
@@ -339,7 +521,40 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Send a new message
summary: List all (subscribed) messages
/api-v2/messages/{mid}:
patch:
description: The user must own the message and request the resource with the
ADMIN Key
operationId: api-messages-delete
parameters:
- description: SCNMessageID
in: path
name: mid
required: true
type: integer
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'
summary: Delete a single message
/api-v2/users/:
post:
operationId: api-user-create
@@ -425,6 +640,109 @@ paths:
schema:
$ref: '#/definitions/ginresp.apiError'
summary: (Partially) update a user
/api-v2/users/{uid}/channels:
get:
operationId: api-channels-list
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
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'
summary: List all channels of a user
/api-v2/users/{uid}/channels/{cid}:
get:
operationId: api-channels-get
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: ChannelID
in: path
name: cid
required: true
type: integer
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'
summary: List all channels of a user
/api-v2/users/{uid}/channels/{cid}/subscriptions:
get:
operationId: api-chan-subscriptions-list
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: ChannelID
in: path
name: cid
required: true
type: integer
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'
summary: List all subscriptions of a channel
/api-v2/users/{uid}/clients:
get:
operationId: api-clients-list
@@ -438,7 +756,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.ListClients.result'
$ref: '#/definitions/handler.ListClients.response'
"400":
description: Bad Request
schema:
@@ -527,6 +845,181 @@ paths:
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Get a single clients
/api-v2/users/{uid}/subscriptions:
get:
operationId: api-user-subscriptions-list
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
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'
summary: List all channels of a user
post:
operationId: api-subscriptions-create
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- in: query
name: chanSubscribeKey
type: string
- description: ' '
in: body
name: post_data
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'
summary: Creare/Request a subscription
/api-v2/users/{uid}/subscriptions/{sid}:
delete:
operationId: api-subscriptions-delete
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: SubscriptionID
in: path
name: sid
required: true
type: integer
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'
summary: Cancel (delete) subscription
get:
operationId: api-subscriptions-get
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: SubscriptionID
in: path
name: sid
required: true
type: integer
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'
summary: Get a single subscription
patch:
operationId: api-subscriptions-update
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: SubscriptionID
in: path
name: sid
required: true
type: integer
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'
summary: Update a subscription (e.g. confirm)
/api/ack.php:
get:
operationId: compat-ack
@@ -790,28 +1283,36 @@ paths:
$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
parameters:
- in: query
name: message_content
name: chanKey
type: string
- in: query
name: message_title
name: channel
type: string
- in: query
name: content
type: string
- in: query
name: priority
type: integer
- in: query
name: sendTimestamp
type: number
- in: query
name: title
type: string
- in: query
name: userID
type: integer
- in: query
name: userKey
type: string
- in: query
name: userMessageID
type: string
- in: query
name: user_id
type: string
- in: query
name: user_key
type: string
- description: ' '
in: body
name: post_body
@@ -821,7 +1322,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/models.ClientJSON'
$ref: '#/definitions/handler.SendMessage.response'
"400":
description: Bad Request
schema:
@@ -830,6 +1331,10 @@ paths:
description: Unauthorized
schema:
$ref: '#/definitions/ginresp.apiError'
"403":
description: Forbidden
schema:
$ref: '#/definitions/ginresp.apiError'
"404":
description: Not Found
schema: