{ "swagger": "2.0", "info": { "description": "API to handle multiple WhatsApp instances", "title": "ZapMeow API", "contact": {}, "version": "1.0" }, "host": "localhost:8900", "basePath": "/api", "paths": { "/{instanceId}/chat/messages": { "post": { "description": "Returns chat messages from the specified WhatsApp instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Chat" ], "summary": "Get WhatsApp Chat Messages", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "List of chat messages", "schema": { "$ref": "#/definitions/controllers.getMessagesResponse" } } } } }, "/{instanceId}/chat/send/audio": { "post": { "description": "Sends an audio message on WhatsApp using the specified instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Chat" ], "summary": "Send Audio Message on WhatsApp", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true }, { "description": "Audio message body", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.audioMessageBody" } } ], "responses": { "200": { "description": "Message Send Response", "schema": { "$ref": "#/definitions/controllers.sendAudioMessageResponse" } } } } }, "/{instanceId}/chat/send/image": { "post": { "description": "Sends an image message on WhatsApp using the specified instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Chat" ], "summary": "Send Image Message on WhatsApp", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true }, { "description": "Image message body", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.imageMessageBody" } } ], "responses": { "200": { "description": "Message Send Response", "schema": { "$ref": "#/definitions/controllers.sendImageMessageResponse" } } } } }, "/{instanceId}/chat/send/text": { "post": { "description": "Sends a text message on WhatsApp using the specified instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Chat" ], "summary": "Send Text Message on WhatsApp", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true }, { "description": "Text message body", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.textMessageBody" } } ], "responses": { "200": { "description": "Message Send Response", "schema": { "$ref": "#/definitions/controllers.sendTextMessageResponse" } } } } }, "/{instanceId}/check/phones": { "post": { "description": "Verifies if the phone numbers in the provided list are registered WhatsApp users.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Phone Verification" ], "summary": "Check Phones on WhatsApp", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true }, { "description": "Phone list", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controllers.phoneCheckBody" } } ], "responses": { "200": { "description": "List of verified numbers", "schema": { "$ref": "#/definitions/controllers.checkPhonesResponse" } } } } }, "/{instanceId}/contact/info": { "get": { "description": "Retrieves contact information.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Contact" ], "summary": "Get Contact Information", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true }, { "type": "string", "description": "Phone", "name": "phone", "in": "query", "required": true } ], "responses": { "200": { "description": "Contact Information", "schema": { "$ref": "#/definitions/controllers.contactInfoResponse" } } } } }, "/{instanceId}/logout": { "post": { "description": "Logs out from the specified WhatsApp instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Logout" ], "summary": "Logout from WhatsApp", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "Logout successful", "schema": { "type": "object", "additionalProperties": true } } } } }, "/{instanceId}/profile": { "get": { "description": "Retrieves profile information.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Profile" ], "summary": "Get Profile Information", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "Profile Information", "schema": { "$ref": "#/definitions/controllers.getProfileInfoResponse" } } } } }, "/{instanceId}/qrcode": { "get": { "description": "Returns a QR code to initiate WhatsApp login.", "produces": [ "application/json" ], "tags": [ "WhatsApp Login" ], "summary": "Get WhatsApp QR Code", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "QR code", "schema": { "$ref": "#/definitions/controllers.getQrCodeResponse" } } } } }, "/{instanceId}/status": { "get": { "description": "Returns the status of the specified WhatsApp instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "WhatsApp Status" ], "summary": "Get WhatsApp Instance Status", "parameters": [ { "type": "string", "description": "Instance ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "Status Response", "schema": { "$ref": "#/definitions/controllers.getStatusResponse" } } } } } }, "definitions": { "controllers.audioMessageBody": { "type": "object", "properties": { "base64": { "type": "string" }, "phone": { "type": "string" } } }, "controllers.checkPhonesResponse": { "type": "object", "properties": { "phones": { "type": "array", "items": { "$ref": "#/definitions/controllers.phone" } } } }, "controllers.contactInfoResponse": { "type": "object", "properties": { "info": { "$ref": "#/definitions/services.ContactInfo" } } }, "controllers.getMessagesResponse": { "type": "object", "properties": { "messages": { "type": "array", "items": { "$ref": "#/definitions/services.Message" } } } }, "controllers.getProfileInfoResponse": { "type": "object", "properties": { "info": { "$ref": "#/definitions/services.ContactInfo" } } }, "controllers.getQrCodeResponse": { "type": "object", "properties": { "qrCode": { "type": "string" } } }, "controllers.getStatusResponse": { "type": "object", "properties": { "status": { "type": "string" } } }, "controllers.imageMessageBody": { "type": "object", "properties": { "base64": { "type": "string" }, "phone": { "type": "string" } } }, "controllers.phone": { "type": "object", "properties": { "isRegistered": { "type": "boolean" }, "jid": { "type": "object", "properties": { "ad": { "type": "boolean" }, "agent": { "type": "integer" }, "device": { "type": "integer" }, "server": { "type": "string" }, "user": { "type": "string" } } }, "query": { "type": "string" } } }, "controllers.phoneCheckBody": { "type": "object", "properties": { "phones": { "type": "array", "items": { "type": "string" } } } }, "controllers.sendAudioMessageResponse": { "type": "object", "properties": { "message": { "$ref": "#/definitions/services.Message" } } }, "controllers.sendImageMessageResponse": { "type": "object", "properties": { "message": { "$ref": "#/definitions/services.Message" } } }, "controllers.sendTextMessageResponse": { "type": "object", "properties": { "message": { "$ref": "#/definitions/services.Message" } } }, "controllers.textMessageBody": { "type": "object", "properties": { "phone": { "type": "string" }, "text": { "type": "string" } } }, "services.ContactInfo": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": "string" }, "picture": { "type": "string" }, "status": { "type": "string" } } }, "services.Message": { "type": "object", "properties": { "body": { "type": "string" }, "chat": { "type": "string" }, "fromMe": { "type": "boolean" }, "id": { "type": "integer" }, "mediaData": { "type": "object", "properties": { "base64": { "type": "string" }, "mimetype": { "type": "string" } } }, "mediaType": { "type": "string" }, "messageID": { "type": "string" }, "sender": { "type": "string" }, "timestamp": { "type": "string" } } } } }