SimpleCloudNotifier/server/swagger/swagger.yaml

1593 lines
39 KiB
YAML
Raw Normal View History

2022-11-18 21:25:40 +01:00
basePath: /
2022-11-13 19:17:07 +01:00
definitions:
2022-11-18 21:25:40 +01:00
ginresp.apiError:
2022-11-13 19:17:07 +01:00
properties:
errhighlight:
type: integer
error:
type: integer
2022-11-20 03:06:08 +01:00
errorObj:
type: string
2022-11-13 19:17:07 +01:00
message:
type: string
success:
type: boolean
2022-11-20 03:06:08 +01:00
traceObj:
type: string
2022-11-13 19:17:07 +01:00
type: object
2022-11-20 01:28:32 +01:00
ginresp.compatAPIError:
properties:
errid:
type: integer
message:
type: string
success:
type: boolean
type: object
2022-11-13 19:17:07 +01:00
handler.Ack.response:
properties:
message:
type: string
new_ack:
type: integer
prev_ack:
type: integer
success:
2022-11-20 01:28:32 +01:00
type: boolean
2022-11-13 19:17:07 +01:00
type: object
2022-11-19 12:59:25 +01:00
handler.AddClient.body:
properties:
agent_model:
type: string
agent_version:
type: string
client_type:
type: string
fcm_token:
type: string
2022-11-20 03:06:08 +01:00
required:
- agent_model
- agent_version
- client_type
- fcm_token
2022-11-19 12:59:25 +01:00
type: object
2022-11-20 00:19:41 +01:00
handler.CreateSubscription.body:
properties:
channel:
type: string
channelOwnerUserID:
type: integer
2022-11-20 03:06:08 +01:00
required:
- channel
- channelOwnerUserID
2022-11-20 00:19:41 +01:00
type: object
2022-11-18 21:25:40 +01:00
handler.CreateUser.body:
properties:
2022-11-18 23:28:37 +01:00
agent_model:
2022-11-18 21:25:40 +01:00
type: string
2022-11-18 23:28:37 +01:00
agent_version:
2022-11-18 21:25:40 +01:00
type: string
2022-11-18 23:28:37 +01:00
client_type:
2022-11-18 21:25:40 +01:00
type: string
2022-11-18 23:28:37 +01:00
fcm_token:
2022-11-18 21:25:40 +01:00
type: string
2022-11-18 23:28:37 +01:00
pro_token:
2022-11-18 21:25:40 +01:00
type: string
username:
type: string
2022-11-20 03:06:08 +01:00
required:
- agent_model
- agent_version
- client_type
- fcm_token
2022-11-18 21:25:40 +01:00
type: object
2022-11-13 19:17:07 +01:00
handler.DatabaseTest.response:
properties:
libVersion:
type: string
libVersionNumber:
type: integer
sourceID:
type: string
success:
type: boolean
type: object
handler.Expand.response:
properties:
data:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/models.CompatMessage'
2022-11-13 19:17:07 +01:00
message:
type: string
success:
2022-11-20 01:28:32 +01:00
type: boolean
2022-11-13 19:17:07 +01:00
type: object
handler.Health.response:
properties:
status:
type: string
type: object
handler.Info.response:
properties:
fcm_token_set:
type: boolean
is_pro:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
message:
type: string
quota:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
quota_max:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
success:
2022-11-20 01:28:32 +01:00
type: boolean
2022-11-13 19:17:07 +01:00
unack_count:
type: integer
user_id:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
user_key:
type: string
type: object
2022-11-20 00:30:30 +01:00
handler.ListChannelMessages.response:
properties:
messages:
items:
$ref: '#/definitions/models.MessageJSON'
type: array
next_page_token:
type: string
page_size:
type: integer
type: object
2022-11-20 00:19:41 +01:00
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:
2022-11-19 12:47:23 +01:00
properties:
clients:
items:
$ref: '#/definitions/models.ClientJSON'
type: array
type: object
2022-11-20 00:19:41 +01:00
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
2022-11-13 19:17:07 +01:00
handler.Register.response:
properties:
is_pro:
type: integer
2022-11-13 19:17:07 +01:00
message:
type: string
quota:
type: integer
2022-11-13 19:17:07 +01:00
quota_max:
type: integer
2022-11-13 19:17:07 +01:00
success:
type: boolean
2022-11-13 19:17:07 +01:00
user_id:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
user_key:
type: string
type: object
handler.Requery.response:
properties:
count:
type: integer
data:
items:
$ref: '#/definitions/models.CompatMessage'
type: array
message:
type: string
success:
2022-11-20 01:28:32 +01:00
type: boolean
2022-11-13 19:17:07 +01:00
type: object
2022-11-19 15:13:47 +01:00
handler.SendMessage.body:
properties:
2022-11-20 00:19:41 +01:00
chanKey:
type: string
channel:
type: string
2022-11-20 03:06:08 +01:00
content:
2022-11-19 15:13:47 +01:00
type: string
2022-11-20 00:19:41 +01:00
msg_id:
type: string
2022-11-19 15:13:47 +01:00
priority:
type: integer
2022-11-20 00:19:41 +01:00
timestamp:
type: number
2022-11-20 03:06:08 +01:00
title:
type: string
2022-11-19 15:13:47 +01:00
user_id:
2022-11-20 00:19:41 +01:00
type: integer
2022-11-19 15:13:47 +01:00
user_key:
type: string
2022-11-20 00:19:41 +01:00
type: object
2022-11-13 19:17:07 +01:00
handler.Update.response:
properties:
is_pro:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
message:
type: string
quota:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
quota_max:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
success:
2022-11-20 01:28:32 +01:00
type: boolean
2022-11-13 19:17:07 +01:00
user_id:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
user_key:
type: string
type: object
2022-11-18 23:28:37 +01:00
handler.UpdateUser.body:
properties:
pro_token:
type: string
username:
type: string
type: object
2022-11-13 19:17:07 +01:00
handler.Upgrade.response:
properties:
2022-11-20 01:28:32 +01:00
is_pro:
type: boolean
2022-11-13 19:17:07 +01:00
message:
type: string
2022-11-20 01:28:32 +01:00
quota:
type: integer
quota_max:
type: integer
2022-11-13 19:17:07 +01:00
success:
2022-11-20 01:28:32 +01:00
type: boolean
user_id:
type: integer
2022-11-13 19:17:07 +01:00
type: object
handler.pingResponse:
properties:
info:
$ref: '#/definitions/handler.pingResponseInfo'
message:
type: string
type: object
handler.pingResponseInfo:
properties:
addr:
type: string
headers:
additionalProperties:
items:
type: string
type: array
type: object
method:
type: string
request:
type: string
uri:
type: string
type: object
2022-11-20 03:06:08 +01:00
handler.sendMessageInternal.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
2022-11-20 00:19:41 +01:00
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
2022-11-19 12:47:23 +01:00
models.ClientJSON:
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
type: object
2022-11-13 19:17:07 +01:00
models.CompatMessage:
properties:
body:
type: string
priority:
type: integer
scn_msg_id:
2022-11-20 01:28:32 +01:00
type: integer
2022-11-13 19:17:07 +01:00
timestamp:
type: integer
title:
type: string
2022-11-20 01:28:32 +01:00
trimmed:
type: boolean
2022-11-13 19:17:07 +01:00
usr_msg_id:
type: string
type: object
2022-11-20 00:19:41 +01:00
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.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
2022-11-18 21:25:40 +01:00
models.UserJSON:
properties:
admin_key:
type: string
is_pro:
type: boolean
messages_sent:
type: integer
2022-11-20 00:19:41 +01:00
quota_used:
2022-11-18 21:25:40 +01:00
type: integer
2022-11-20 00:19:41 +01:00
quota_used_day:
type: string
2022-11-18 21:25:40 +01:00
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
type: object
2022-11-13 19:17:07 +01:00
host: scn.blackforestbytes.com
info:
contact: {}
description: API for SCN
title: SimpleCloudNotifier API
version: "2.0"
paths:
2022-11-19 15:13:47 +01:00
/:
post:
2022-11-20 00:19:41 +01:00
description: All parameter can be set via query-parameter or the json body.
Only UserID, UserKey and Title are required
2022-11-19 15:13:47 +01:00
parameters:
- in: query
2022-11-20 00:19:41 +01:00
name: chanKey
type: string
- in: query
name: channel
2022-11-19 15:13:47 +01:00
type: string
- in: query
2022-11-20 00:19:41 +01:00
name: content
2022-11-19 15:13:47 +01:00
type: string
- in: query
name: priority
type: integer
- in: query
name: sendTimestamp
2022-11-20 00:19:41 +01:00
type: number
2022-11-19 15:13:47 +01:00
- in: query
2022-11-20 00:19:41 +01:00
name: title
2022-11-19 15:13:47 +01:00
type: string
- in: query
2022-11-20 00:19:41 +01:00
name: userID
type: integer
- in: query
name: userKey
2022-11-19 15:13:47 +01:00
type: string
- in: query
2022-11-20 00:19:41 +01:00
name: userMessageID
2022-11-19 15:13:47 +01:00
type: string
- description: ' '
in: body
name: post_body
schema:
$ref: '#/definitions/handler.SendMessage.body'
responses:
"200":
description: OK
schema:
2022-11-20 03:06:08 +01:00
$ref: '#/definitions/handler.sendMessageInternal.response'
2022-11-19 15:13:47 +01:00
"400":
description: Bad Request
schema:
$ref: '#/definitions/ginresp.apiError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/ginresp.apiError'
2022-11-20 00:19:41 +01:00
"403":
description: Forbidden
schema:
$ref: '#/definitions/ginresp.apiError'
2022-11-19 15:13:47 +01:00
"404":
description: Not Found
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Send a new message
2022-11-20 00:19:41 +01:00
/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:
$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 (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/:
2022-11-18 21:25:40 +01:00
post:
operationId: api-user-create
parameters:
- description: ' '
in: body
name: post_body
schema:
$ref: '#/definitions/handler.CreateUser.body'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.UserJSON'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Create a new user
/api-v2/users/{uid}:
2022-11-18 23:28:37 +01:00
get:
operationId: api-user-get
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
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'
2022-11-19 12:47:23 +01:00
summary: Get a user
2022-11-18 23:28:37 +01:00
patch:
description: The body-values are optional, only send the ones you want to update
operationId: api-user-update
parameters:
- description: ' '
in: body
name: post_body
schema:
$ref: '#/definitions/handler.UpdateUser.body'
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'
2022-11-19 12:47:23 +01:00
summary: (Partially) update a user
2022-11-20 00:19:41 +01:00
/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
2022-11-20 00:30:30 +01:00
/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
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-channel-messages
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.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'
summary: List messages of a channel
2022-11-20 00:19:41 +01:00
/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:
2022-11-19 12:47:23 +01:00
get:
operationId: api-clients-list
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
responses:
"200":
description: OK
schema:
2022-11-20 00:19:41 +01:00
$ref: '#/definitions/handler.ListClients.response'
2022-11-19 12:47:23 +01:00
"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 clients
2022-11-19 12:59:25 +01:00
post:
operationId: api-clients-delete
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: ClientID
in: path
name: cid
required: true
type: integer
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'
summary: Delete a client
/api-v2/users/{uid}/clients/{cid}:
2022-11-19 12:50:41 +01:00
get:
operationId: api-clients-get
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
- description: ClientID
in: path
name: cid
required: true
type: integer
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'
2022-11-19 12:59:25 +01:00
summary: Get a single clients
2022-11-20 00:19:41 +01:00
/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)
2022-11-18 21:25:40 +01:00
/api/ack.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-ack
2022-11-13 19:17:07 +01:00
parameters:
- description: the user_id
in: query
name: user_id
required: true
type: string
- description: the user_key
in: query
name: user_key
required: true
type: string
- description: the message id
in: query
name: scn_msg_id
required: true
type: string
2022-11-20 13:18:09 +01:00
- description: the user_id
in: formData
name: user_id
required: true
type: string
- description: the user_key
in: formData
name: user_key
required: true
type: string
- description: the message id
in: formData
name: scn_msg_id
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Acknowledge that a message was received
2022-11-18 21:25:40 +01:00
/api/expand.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-expand
2022-11-20 13:18:09 +01:00
parameters:
- description: The user_id
in: query
name: user_id
required: true
type: string
- description: The user_key
in: query
name: user_key
required: true
type: string
- description: The message-id
in: query
name: scn_msg_id
required: true
type: string
- description: The user_id
in: formData
name: user_id
required: true
type: string
- description: The user_key
in: formData
name: user_key
required: true
type: string
- description: The message-id
in: formData
name: scn_msg_id
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Get a whole (potentially truncated) message
2022-11-18 21:25:40 +01:00
/api/info.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-info
2022-11-13 19:17:07 +01:00
parameters:
- description: the user_id
in: query
name: user_id
required: true
type: string
- description: the user_key
in: query
name: user_key
required: true
type: string
2022-11-20 13:18:09 +01:00
- description: the user_id
in: formData
name: user_id
required: true
type: string
- description: the user_key
in: formData
name: user_key
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Get information about the current user
2022-11-18 21:25:40 +01:00
/api/register.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-register
2022-11-13 19:17:07 +01:00
parameters:
- description: the (android) fcm token
in: query
name: fcm_token
required: true
type: string
- description: if the user is a paid account
enum:
- "true"
- "false"
in: query
name: pro
required: true
type: string
- description: the (android) IAP token
in: query
name: pro_token
required: true
type: string
2022-11-20 13:18:09 +01:00
- description: the (android) fcm token
in: formData
name: fcm_token
required: true
type: string
- description: if the user is a paid account
enum:
- "true"
- "false"
in: formData
name: pro
required: true
type: string
- description: the (android) IAP token
in: formData
name: pro_token
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Register a new account
2022-11-18 21:25:40 +01:00
/api/requery.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-requery
2022-11-13 19:17:07 +01:00
parameters:
- description: the user_id
in: query
name: user_id
required: true
type: string
- description: the user_key
in: query
name: user_key
required: true
type: string
2022-11-20 13:18:09 +01:00
- description: the user_id
in: formData
name: user_id
required: true
type: string
- description: the user_key
in: formData
name: user_key
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Return all not-acknowledged messages
2022-11-18 21:25:40 +01:00
/api/update.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-update
2022-11-13 19:17:07 +01:00
parameters:
- description: the user_id
in: query
name: user_id
required: true
type: string
- description: the user_key
in: query
name: user_key
required: true
type: string
- description: the (android) fcm token
in: query
name: fcm_token
required: true
type: string
2022-11-20 13:18:09 +01:00
- description: the user_id
in: formData
name: user_id
required: true
type: string
- description: the user_key
in: formData
name: user_key
required: true
type: string
- description: the (android) fcm token
in: formData
name: fcm_token
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Set the fcm-token (android)
2022-11-18 21:25:40 +01:00
/api/upgrade.php:
2022-11-13 19:17:07 +01:00
get:
2022-11-20 01:28:32 +01:00
deprecated: true
operationId: compat-upgrade
2022-11-13 19:17:07 +01:00
parameters:
- description: the user_id
in: query
name: user_id
required: true
type: string
- description: the user_key
in: query
name: user_key
required: true
type: string
- description: if the user is a paid account
enum:
- "true"
- "false"
in: query
name: pro
required: true
type: string
- description: the (android) IAP token
in: query
name: pro_token
required: true
type: string
2022-11-20 13:18:09 +01:00
- description: the user_id
in: formData
name: user_id
required: true
type: string
- description: the user_key
in: formData
name: user_key
required: true
type: string
- description: if the user is a paid account
enum:
- "true"
- "false"
in: formData
name: pro
required: true
type: string
- description: the (android) IAP token
in: formData
name: pro_token
required: true
type: string
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
2022-11-20 01:28:32 +01:00
$ref: '#/definitions/ginresp.compatAPIError'
2022-11-13 19:17:07 +01:00
summary: Upgrade a free account to a paid account
2022-11-18 21:25:40 +01:00
/db-test:
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.DatabaseTest.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
/health:
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Health.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
/ping:
delete:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
patch:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
post:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
put:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
2022-11-19 15:13:47 +01:00
/send:
post:
2022-11-20 00:19:41 +01:00
description: All parameter can be set via query-parameter or the json body.
Only UserID, UserKey and Title are required
2022-11-19 15:13:47 +01:00
parameters:
- in: query
2022-11-20 00:19:41 +01:00
name: chanKey
2022-11-19 15:13:47 +01:00
type: string
- in: query
2022-11-20 00:19:41 +01:00
name: channel
type: string
- in: query
name: content
2022-11-19 15:13:47 +01:00
type: string
- in: query
name: priority
type: integer
- in: query
name: sendTimestamp
2022-11-20 00:19:41 +01:00
type: number
2022-11-19 15:13:47 +01:00
- in: query
2022-11-20 00:19:41 +01:00
name: title
2022-11-19 15:13:47 +01:00
type: string
- in: query
2022-11-20 00:19:41 +01:00
name: userID
type: integer
- in: query
name: userKey
2022-11-19 15:13:47 +01:00
type: string
- in: query
2022-11-20 00:19:41 +01:00
name: userMessageID
2022-11-19 15:13:47 +01:00
type: string
- description: ' '
in: body
name: post_body
schema:
$ref: '#/definitions/handler.SendMessage.body'
responses:
"200":
description: OK
schema:
2022-11-20 03:06:08 +01:00
$ref: '#/definitions/handler.sendMessageInternal.response'
2022-11-19 15:13:47 +01:00
"400":
description: Bad Request
schema:
$ref: '#/definitions/ginresp.apiError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/ginresp.apiError'
2022-11-20 00:19:41 +01:00
"403":
description: Forbidden
schema:
$ref: '#/definitions/ginresp.apiError'
2022-11-19 15:13:47 +01:00
"404":
description: Not Found
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Send a new message
2022-11-20 03:06:08 +01:00
/send.php:
post:
deprecated: true
description: All parameter can be set via query-parameter or form-data body.
Only UserID, UserKey and Title are required
parameters:
- 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: formData
name: content
type: string
- in: formData
name: priority
type: integer
- in: formData
name: sendTimestamp
type: number
- in: formData
name: title
type: string
- in: formData
name: userID
type: integer
- in: formData
name: userKey
type: string
- in: formData
name: userMessageID
type: string
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'
"404":
description: Not Found
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Send a new message (compatibility)
2022-11-13 19:17:07 +01:00
swagger: "2.0"