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:
+105
@@ -122,6 +122,57 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/instant/message": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Send a message without the constraints of scheduled messages (requires JWT)",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"messages"
|
||||
],
|
||||
"summary": "Send instant message",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Send an instnt message",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handler.SendInstantMessageRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/message": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -828,6 +879,37 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"handler.SendInstantMessageRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"contact_ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"message_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handler.SendInstantMessageResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/message.MessageEventResponse"
|
||||
}
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"message.Message": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -842,6 +924,29 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"message.MessageEventResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"response": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"scheduled_message_event_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"sent": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scheduling.ScheduledMessage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user