SimpleCloudNotifier/server/swagger/swagger.yaml

538 lines
12 KiB
YAML
Raw Normal View History

2022-11-13 19:17:07 +01:00
basePath: /api/
definitions:
ginresp.errBody:
properties:
message:
type: string
success:
type: boolean
type: object
ginresp.internAPIError:
properties:
errid:
type: integer
message:
type: string
success:
type: boolean
type: object
ginresp.sendAPIError:
properties:
errhighlight:
type: integer
error:
type: integer
message:
type: string
success:
type: boolean
type: object
handler.Ack.response:
properties:
message:
type: string
new_ack:
type: integer
prev_ack:
type: integer
success:
type: string
type: object
handler.DatabaseTest.response:
properties:
libVersion:
type: string
libVersionNumber:
type: integer
sourceID:
type: string
success:
type: boolean
type: object
handler.Expand.response:
properties:
data:
$ref: '#/definitions/models.ShortCompatMessage'
message:
type: string
success:
type: string
type: object
handler.Health.response:
properties:
status:
type: string
type: object
handler.Info.response:
properties:
fcm_token_set:
type: boolean
is_pro:
type: string
message:
type: string
quota:
type: string
quota_max:
type: string
success:
type: string
unack_count:
type: integer
user_id:
type: string
user_key:
type: string
type: object
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:
type: string
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:
type: string
type: object
handler.Send.body:
properties:
content:
type: string
msg_id:
type: string
priority:
type: string
timestamp:
type: string
title:
type: string
user_id:
type: string
user_key:
type: string
type: object
2022-11-13 19:17:07 +01:00
handler.Send.response:
properties:
message:
type: string
success:
type: string
type: object
handler.Update.response:
properties:
is_pro:
type: string
message:
type: string
quota:
type: string
quota_max:
type: string
success:
type: string
user_id:
type: string
user_key:
type: string
type: object
handler.Upgrade.response:
properties:
data:
$ref: '#/definitions/models.ShortCompatMessage'
message:
type: string
success:
type: string
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
models.CompatMessage:
properties:
body:
type: string
priority:
type: integer
scn_msg_id:
type: string
timestamp:
type: integer
title:
type: string
usr_msg_id:
type: string
type: object
models.ShortCompatMessage:
properties:
body:
type: string
priority:
type: integer
scn_msg_id:
type: string
timestamp:
type: integer
title:
type: string
trimmed:
type: boolean
usr_msg_id:
type: string
type: object
host: scn.blackforestbytes.com
info:
contact: {}
description: API for SCN
title: SimpleCloudNotifier API
version: "2.0"
paths:
/ack.php:
get:
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
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Ack.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Acknowledge that a message was received
/db-test:
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.DatabaseTest.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
/expand.php:
get:
operationId: compat-expand
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Expand.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Get a whole (potentially truncated) message
/health:
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Health.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
/info.php:
get:
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
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Info.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Get information about the current user
/ping:
delete:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
patch:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
post:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
put:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.pingResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.errBody'
/register.php:
get:
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
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Register.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Register a new account
/requery.php:
get:
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
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Requery.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Return all not-acknowledged messages
/send.php:
post:
consumes:
- application/json
description: (all arguments can either be supplied in the query or in the json
body)
operationId: compat-send
2022-11-13 19:17:07 +01:00
parameters:
- in: query
2022-11-13 19:17:07 +01:00
name: content
type: string
- in: query
name: messageID
2022-11-13 19:17:07 +01:00
type: string
- in: query
name: priority
2022-11-13 19:17:07 +01:00
type: string
- in: query
2022-11-13 19:17:07 +01:00
name: timestamp
type: string
- in: query
2022-11-13 19:17:07 +01:00
name: title
type: string
- in: query
name: userID
type: string
- in: query
name: userKey
type: string
- description: ' '
2022-11-13 19:17:07 +01:00
in: body
name: post_body
2022-11-13 19:17:07 +01:00
schema:
$ref: '#/definitions/handler.Send.body'
produces:
- application/json
2022-11-13 19:17:07 +01:00
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Send.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.sendAPIError'
summary: Send a message
/update.php:
get:
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
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Update.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Set the fcm-token (android)
/upgrade.php:
get:
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
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Upgrade.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.internAPIError'
summary: Upgrade a free account to a paid account
swagger: "2.0"