tsk-51: Send message endpoint (#52)
Closes #51 Reviewed-on: phoenix/textsender-api#52 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
@@ -154,6 +154,26 @@ definitions:
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
handler.SendInstantMessageRequest:
|
||||
properties:
|
||||
contact_ids:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
message_id:
|
||||
type: string
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
handler.SendInstantMessageResponse:
|
||||
properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/message.MessageEventResponse'
|
||||
type: array
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
message.Message:
|
||||
properties:
|
||||
content:
|
||||
@@ -163,6 +183,21 @@ definitions:
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
message.MessageEventResponse:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
response:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
scheduled_message_event_id:
|
||||
type: string
|
||||
sent:
|
||||
type: string
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
scheduling.ScheduledMessage:
|
||||
properties:
|
||||
created:
|
||||
@@ -266,6 +301,39 @@ paths:
|
||||
summary: Add contact
|
||||
tags:
|
||||
- contacts
|
||||
/instant/message:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Send a message without the constraints of scheduled messages (requires
|
||||
JWT)
|
||||
parameters:
|
||||
- description: Send an instnt message
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/handler.SendInstantMessageRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
schema:
|
||||
$ref: '#/definitions/handler.SendInstantMessageResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/handler.SendInstantMessageResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/handler.SendInstantMessageResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Send instant message
|
||||
tags:
|
||||
- messages
|
||||
/message:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user