tsk-59: Get MessageEventResponse endpoint (#61)
Closes #59 Reviewed-on: phoenix/textsender-api#61 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
+130
-20
@@ -2,13 +2,39 @@ basePath: /api/v1
|
||||
definitions:
|
||||
contact.Contact:
|
||||
properties:
|
||||
first_name:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
last_name:
|
||||
type: string
|
||||
nickname:
|
||||
type: string
|
||||
phone_number:
|
||||
type: string
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
event.MessageEventResponse:
|
||||
properties:
|
||||
contact_id:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
message_id:
|
||||
type: string
|
||||
response:
|
||||
additionalProperties: {}
|
||||
type: object
|
||||
scheduled_message_event_id:
|
||||
type: string
|
||||
sent:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
handler.AddContactResponse:
|
||||
properties:
|
||||
data:
|
||||
@@ -72,6 +98,15 @@ definitions:
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
handler.GetMessageEventResponseFetchedResponse:
|
||||
properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/event.MessageEventResponse'
|
||||
type: array
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
handler.GetMessageResponse:
|
||||
properties:
|
||||
data:
|
||||
@@ -99,6 +134,33 @@ definitions:
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
handler.RecordEventRequest:
|
||||
properties:
|
||||
contact_id:
|
||||
type: string
|
||||
message_id:
|
||||
type: string
|
||||
response:
|
||||
additionalProperties: {}
|
||||
type: object
|
||||
scheduled_message_event_id:
|
||||
type: string
|
||||
sent:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
handler.RecordEventResponse:
|
||||
properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/event.MessageEventResponse'
|
||||
type: array
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
handler.RequestAddContact:
|
||||
properties:
|
||||
phone_number:
|
||||
@@ -124,9 +186,9 @@ definitions:
|
||||
type: object
|
||||
handler.RequestAddScheduledMessageEvent:
|
||||
properties:
|
||||
message_id:
|
||||
contact_id:
|
||||
type: string
|
||||
recipient_id:
|
||||
message_id:
|
||||
type: string
|
||||
scheduled_message_id:
|
||||
type: string
|
||||
@@ -169,7 +231,7 @@ definitions:
|
||||
properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/message.MessageEventResponse'
|
||||
$ref: '#/definitions/event.MessageEventResponse'
|
||||
type: array
|
||||
message:
|
||||
type: string
|
||||
@@ -183,21 +245,6 @@ 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:
|
||||
@@ -213,14 +260,14 @@ definitions:
|
||||
type: object
|
||||
scheduling.ScheduledMessageEvent:
|
||||
properties:
|
||||
contact_id:
|
||||
type: string
|
||||
created:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
message_id:
|
||||
type: string
|
||||
recipient_id:
|
||||
type: string
|
||||
scheduled_message_id:
|
||||
type: string
|
||||
type: object
|
||||
@@ -569,6 +616,69 @@ paths:
|
||||
summary: Delete scheduled message event
|
||||
tags:
|
||||
- scheduled message events
|
||||
/schedule/message/event/response:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Fetches a MessageEventResponse given a user id (requires JWT)
|
||||
parameters:
|
||||
- description: User Id
|
||||
in: path
|
||||
name: user_id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/handler.GetMessageEventResponseFetchedResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/handler.GetMessageEventResponseFetchedResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/handler.GetMessageEventResponseFetchedResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Fetcht MessageEventResponse
|
||||
tags:
|
||||
- message
|
||||
/schedule/message/event/response/record:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Saves the result of sending a text message (requires JWT)
|
||||
parameters:
|
||||
- description: Data to add MessageEventResponse
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/handler.RecordEventRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
schema:
|
||||
$ref: '#/definitions/handler.RecordEventResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/handler.RecordEventResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/handler.RecordEventResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Record MessageEventResponse
|
||||
tags:
|
||||
- message
|
||||
/schedule/message/fetch:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user