feat: update group controller

This commit is contained in:
Anton Voylenko 2024-12-09 15:14:02 +02:00
commit 7f509fc029
4 changed files with 931 additions and 110 deletions

View file

@ -6157,6 +6157,7 @@
"tags": [
"Group Chat"
],
"summary": "Get the group",
"description": "",
"parameters": [
{
@ -6229,8 +6230,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6241,8 +6242,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6256,7 +6257,8 @@
"tags": [
"Group Chat"
],
"description": "",
"summary": "Add the participant(s)",
"description": "Add a list of participants by id to the group",
"parameters": [
{
"name": "sessionId",
@ -6328,8 +6330,24 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
},
"options": {
"type": "object",
"description": "Options for adding participants",
"example": {
"sleep": [
250,
500
],
"comment": ""
}
}
}
}
@ -6340,8 +6358,24 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
},
"options": {
"type": "object",
"description": "Options for adding participants",
"example": {
"sleep": [
250,
500
],
"comment": ""
}
}
}
}
@ -6355,7 +6389,8 @@
"tags": [
"Group Chat"
],
"description": "",
"summary": "Demote the participant(s)",
"description": "Demote participants by ids to regular users",
"parameters": [
{
"name": "sessionId",
@ -6427,8 +6462,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
}
}
}
@ -6439,8 +6479,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
}
}
}
@ -6454,7 +6499,8 @@
"tags": [
"Group Chat"
],
"description": "",
"summary": "Get the invite code",
"description": "Get the invite code for a specific group",
"parameters": [
{
"name": "sessionId",
@ -6526,8 +6572,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6538,8 +6584,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6553,6 +6599,7 @@
"tags": [
"Group Chat"
],
"summary": "Leave the group",
"description": "",
"parameters": [
{
@ -6625,8 +6672,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6637,8 +6684,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6652,7 +6699,8 @@
"tags": [
"Group Chat"
],
"description": "",
"summary": "Promote the participant(s)",
"description": "Promote participants by IDs to admins",
"parameters": [
{
"name": "sessionId",
@ -6724,8 +6772,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
}
}
}
@ -6736,8 +6789,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
}
}
}
@ -6751,7 +6809,8 @@
"tags": [
"Group Chat"
],
"description": "",
"summary": "Remove the participant(s)",
"description": "Remove a list of participants by ID to the group",
"parameters": [
{
"name": "sessionId",
@ -6823,8 +6882,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
}
}
}
@ -6835,8 +6899,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"contactIds": {
"type": "string",
"description": "Unique WhatsApp identifier for the contact",
"example": "6281288888887@c.us"
}
}
}
@ -6850,7 +6919,8 @@
"tags": [
"Group Chat"
],
"description": "",
"summary": "Invalidate the invite code",
"description": "Invalidate the current group invite code and generates a new one",
"parameters": [
{
"name": "sessionId",
@ -6922,8 +6992,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6934,8 +7004,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -6949,6 +7019,7 @@
"tags": [
"Group Chat"
],
"summary": "Update the group description",
"description": "",
"parameters": [
{
@ -7021,8 +7092,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"description": {
"type": "string",
"description": "Group description",
"example": ""
}
}
}
@ -7033,8 +7109,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"description": {
"type": "string",
"description": "Group description",
"example": ""
}
}
}
@ -7048,6 +7129,7 @@
"tags": [
"Group Chat"
],
"summary": "Update the info group settings",
"description": "",
"parameters": [
{
@ -7120,8 +7202,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"adminsOnly": {
"type": "boolean",
"description": "Enable or disable this option",
"example": true
}
}
}
@ -7132,8 +7219,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"adminsOnly": {
"type": "boolean",
"description": "Enable or disable this option",
"example": true
}
}
}
@ -7147,6 +7239,7 @@
"tags": [
"Group Chat"
],
"summary": "Update the message group settings",
"description": "",
"parameters": [
{
@ -7219,8 +7312,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"adminsOnly": {
"type": "boolean",
"description": "Enable or disable this option",
"example": true
}
}
}
@ -7231,8 +7329,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"adminsOnly": {
"type": "boolean",
"description": "Enable or disable this option",
"example": true
}
}
}
@ -7246,6 +7349,7 @@
"tags": [
"Group Chat"
],
"summary": "Update the group subject",
"description": "",
"parameters": [
{
@ -7318,8 +7422,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"subject": {
"type": "string",
"description": "Group subject",
"example": ""
}
}
}
@ -7330,8 +7439,13 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"subject": {
"type": "string",
"description": "Group subject",
"example": ""
}
}
}
@ -7345,6 +7459,7 @@
"tags": [
"Group Chat"
],
"summary": "Set the group picture",
"description": "",
"parameters": [
{
@ -7417,8 +7532,16 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"pictureMimeType": {
"type": "string",
"description": "MIME type of the attachment"
},
"pictureData": {
"type": "string",
"description": "Base64-encoded data of the file"
}
}
}
@ -7429,8 +7552,16 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"pictureMimeType": {
"type": "string",
"description": "MIME type of the attachment"
},
"pictureData": {
"type": "string",
"description": "Base64-encoded data of the file"
}
}
}
@ -7444,6 +7575,7 @@
"tags": [
"Group Chat"
],
"summary": "Delete the group picture",
"description": "",
"parameters": [
{
@ -7516,8 +7648,8 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
@ -7528,8 +7660,352 @@
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp ID for the given Chat (either group or personal)",
"example": "6281288888888@c.us"
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
}
}
}
}
},
"/groupChat/getGroupMembershipRequests/{sessionId}": {
"post": {
"tags": [
"Group Chat"
],
"summary": "Get the membership requests",
"description": "",
"parameters": [
{
"name": "sessionId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Unique identifier for the session (alphanumeric and - allowed)",
"example": "f8377d8d-a589-4242-9ba6-9486a04ef80c"
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
}
},
"404": {
"description": "Not Found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
}
},
"422": {
"description": "Unprocessable Entity.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"500": {
"description": "Server failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"security": [
{
"apiKeyAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
},
"application/xml": {
"schema": {
"type": "object",
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
}
}
}
}
}
}
}
},
"/groupChat/approveGroupMembershipRequests/{sessionId}": {
"post": {
"tags": [
"Group Chat"
],
"summary": "Approve membership request",
"description": "",
"parameters": [
{
"name": "sessionId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Unique identifier for the session (alphanumeric and - allowed)",
"example": "f8377d8d-a589-4242-9ba6-9486a04ef80c"
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
}
},
"404": {
"description": "Not Found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
}
},
"422": {
"description": "Unprocessable Entity.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"500": {
"description": "Server failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"security": [
{
"apiKeyAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"options": {
"type": "object",
"description": "Options for performing a membership request action",
"example": {
"requesterIds": [],
"sleep": [
250,
500
]
}
}
}
}
},
"application/xml": {
"schema": {
"type": "object",
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"options": {
"type": "object",
"description": "Options for performing a membership request action",
"example": {
"requesterIds": [],
"sleep": [
250,
500
]
}
}
}
}
}
}
}
}
},
"/groupChat/rejectGroupMembershipRequests/{sessionId}": {
"post": {
"tags": [
"Group Chat"
],
"summary": "Reject membership request",
"description": "",
"parameters": [
{
"name": "sessionId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Unique identifier for the session (alphanumeric and - allowed)",
"example": "f8377d8d-a589-4242-9ba6-9486a04ef80c"
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
}
},
"404": {
"description": "Not Found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
}
},
"422": {
"description": "Unprocessable Entity.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"500": {
"description": "Server failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"security": [
{
"apiKeyAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"options": {
"type": "object",
"description": "Options for performing a membership request action",
"example": {
"requesterIds": [],
"sleep": [
250,
500
]
}
}
}
}
},
"application/xml": {
"schema": {
"type": "object",
"properties": {
"chatId": {
"type": "string",
"description": "Unique WhatsApp id for the given chat group",
"example": "XXXXXXXXXX@g.us"
},
"options": {
"type": "object",
"description": "Options for performing a membership request action",
"example": {
"requesterIds": [],
"sleep": [
250,
500
]
}
}
}
}