### Wasapi API Quick Start Guide Source: https://api-docs.wasapi.io/reference This section outlines the three essential steps to begin using the Wasapi API: selecting a programming language, obtaining your API key, and making a test request. ```APIDOC ## Wasapi API Quick Start ### Description Follow these three simple steps to start integrating with the Wasapi API quickly. ### Steps 1. **Choose Your Language** Select your preferred programming language from the options provided (Shell, Node, Ruby, PHP, Python, Java, C#). Code examples are ready to be copied and tested. 2. **Get Your API Key** Click the "Get API Key" button. Enter your email address to receive a secure link. Accessing this link will automatically generate your API key and insert it into the code examples, eliminating the need to visit the Wasapi website separately. 3. **Make a Test Request** Execute your first API request using the provided examples. A successful request will return your account data, confirming your integration is working correctly. ``` -------------------------------- ### Contact Example Object Source: https://api-docs.wasapi.io/reference/getcontactbyuuid An example of a Contact object, demonstrating how custom fields are represented. This includes an 'id', 'contact_id', 'contacts_custom_field_id', 'field_value', and 'field_name'. ```json { "id": 9167957, "contact_id": 16444365, "contacts_custom_field_id": 3292, "field_value": "02/03/1990", "field_name": "Fecha" } ``` -------------------------------- ### cURL GET Request Example Source: https://api-docs.wasapi.io/reference A basic example of how to make a GET request to the Wasapi API using cURL. ```APIDOC ## GET / ### Description This is a sample GET request endpoint. ### Method GET ### Endpoint https://example.com/ ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url https://example.com/ ``` ### Response #### Success Response (200) This endpoint returns a welcome message upon successful request. #### Response Example ```json { "message": "Welcome to the Wasapi API!" } ``` ``` -------------------------------- ### GET /campaigns Source: https://api-docs.wasapi.io/reference/get_campaigns Retrieves a comprehensive list of all campaigns configured within the system. ```APIDOC ## GET /campaigns ### Description Obtiene la lista completa de campañas configuradas en el sistema ### Method GET ### Endpoint /campaigns ### Parameters #### Query Parameters - **status** (string) - Optional - Filter campaigns by status (e.g., 'active', 'inactive'). ### Request Example ``` GET /campaigns?status=active ``` ### Response #### Success Response (200) - **campaigns** (array) - A list of campaign objects. - **id** (integer) - The unique identifier for the campaign. - **name** (string) - The name of the campaign. - **status** (string) - The current status of the campaign. #### Response Example ```json { "campaigns": [ { "id": 1, "name": "Summer Sale", "status": "active" }, { "id": 2, "name": "Winter Clearance", "status": "inactive" } ] } ``` ``` -------------------------------- ### GET /campaigns Source: https://api-docs.wasapi.io/reference/get_campaigns Retrieves a list of all configured campaigns in the system. This endpoint allows you to view existing campaigns and their details. ```APIDOC ## GET /campaigns ### Description Obtiene la lista completa de campañas configuradas en el sistema. ### Method GET ### Endpoint /campaigns ### Parameters #### Query Parameters - **page** (integer) - Optional - Número de página para la paginación. - **per_page** (integer) - Optional - Número de elementos por página. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indica si la operación fue exitosa. - **data** (array) - Lista de campañas. - **id** (integer) - Identificador único de la campaña. - **name** (string) - Nombre de la campaña. - **phone_id** (integer) - Identificador del número de teléfono. - **schedule_timestamp** (integer) - Marca de tiempo programada. - **sender_id** (integer) - Identificador del usuario que creó la campaña. - **status** (string) - Estado actual de la campaña (sent, scheduled, cancel). - **updated_at** (string) - Fecha y hora de última actualización. - **user_id** (integer) - Identificador del usuario propietario. - **uuid** (string) - Identificador único universal de la campaña. - **created_at** (string) - Fecha y hora de creación. #### Response Example ```json { "success": true, "data": [ { "id": 43810, "name": "Nombre campaña", "phone_id": 1, "schedule_timestamp": 1743177540, "sender_id": 1, "status": "scheduled", "updated_at": "2025-03-28T10:18:19.000000Z", "user_id": 1, "uuid": "1d839ff2-1f65-4572-81a6-571990793024", "created_at": "2025-03-28T10:18:19.000000Z" } ] } ``` ``` -------------------------------- ### Ejemplo de Petición GET con cURL Source: https://api-docs.wasapi.io/index Este snippet muestra cómo realizar una petición GET a la API de Wasapi utilizando cURL. Es un ejemplo básico para probar la conexión y obtener una respuesta inicial. ```shell curl --request GET \ --url https://example.com/ ``` -------------------------------- ### GET /whatsapp-templates/sync-meta Source: https://api-docs.wasapi.io/reference/get_whatsapp-templates-sync-meta Synchronizes WhatsApp templates with the Meta platform and updates the local catalog. This endpoint is part of the 'whatsapp' tag. ```APIDOC ## GET /whatsapp-templates/sync-meta ### Description Sincroniza las plantillas de WhatsApp con la plataforma de Meta y actualiza el catálogo local. ### Method GET ### Endpoint /whatsapp-templates/sync-meta ### Parameters #### Query Parameters (No query parameters defined for this endpoint) #### Path Parameters (No path parameters defined for this endpoint) ### Request Body (No request body defined for this endpoint) ### Request Example (No request example provided) ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **results** (array) - Results of the synchronization per application. - **app_id** (integer) - Identifier of the application. - **app_name** (string) - Name of the application. - **success** (boolean) - Indicates if the synchronization was successful for this application. - **message** (string) - Descriptive message of the result. - **phone_number** (string) - Associated phone number. - **phone_display_name** (string) - Display name of the number. #### Response Example ```json { "success": true, "results": [ { "app_id": 1, "app_name": "Vinix Code, LLC", "success": true, "message": "Templates synchronized successfully", "phone_number": "+1 954-947-4394", "phone_display_name": "Wasapi" } ] } ``` #### Error Response (401) - **success** (boolean) - Indicates if the operation was successful (will be false). - **message** (string) - Error message describing the issue (e.g., "Acceso no autorizado"). #### Error Response (500) - **success** (boolean) - Indicates if the operation was successful (will be false). - **message** (string) - Error message describing the issue (e.g., "Error interno del servidor"). ``` -------------------------------- ### GET /whatsapp-templates Source: https://api-docs.wasapi.io/reference/get_whatsapp-templates Retrieves a list of stored WhatsApp message templates. To update the list, use the /whatsapp-templates/sync-meta endpoint. ```APIDOC ## GET /whatsapp-templates ### Description Obtiene la lista de plantillas de mensajes almacenadas en el sistema. Para actualizar la lista debes usar el endpoint /whatsapp-templates/sync-meta. ### Method GET ### Endpoint /whatsapp-templates ### Parameters #### Query Parameters (No query parameters defined) #### Request Body (No request body defined) ### Request Example (No request example provided) ### Response #### Success Response (200) - **success** (boolean) - Indica si la operación fue exitosa - **data** (array) - Lista de plantillas - **id** (string) - Identificador único de la plantilla - **name** (string) - Nombre de la plantilla - **category** (string) - Categoría de la plantilla - **language** (string) - Idioma de la plantilla - **status** (string) - Estado de la plantilla - **components** (array) - Componentes de la plantilla - **type** (string) - Tipo de componente - **text** (string) - Texto del componente - **example** (object) - Ejemplo de uso - **body_text** (array) - Ejemplos de texto #### Response Example { "success": true, "data": [ { "id": "1234567890", "name": "Bienvenida", "category": "MARKETING", "language": "es", "status": "APPROVED", "components": [ { "type": "BODY", "text": "¡Bienvenido {{1}}!", "example": { "body_text": [ "¡Bienvenido Juan!" ] } } ] } ] } ``` -------------------------------- ### POST /websites Source: https://api-docs.wasapi.io/reference/addcontact Creates a new website entry. Requires authentication. ```APIDOC ## POST /websites ### Description Creates a new website entry. Requires authentication. ### Method POST ### Endpoint /websites ### Parameters #### Request Body - **name** (string) - Required - The name of the website. - **url** (string) - Required - The URL of the website. - **contact_email** (string) - Required - The contact email for the website. ### Request Example ```json { "name": "Example Website", "url": "https://example.com", "contact_email": "contact@example.com" } ``` ### Response #### Success Response (201) - **id** (integer) - The unique identifier of the created website. - **name** (string) - The name of the website. - **url** (string) - The URL of the website. - **contact_email** (string) - The contact email for the website. #### Response Example ```json { "id": 1, "name": "Example Website", "url": "https://example.com", "contact_email": "contact@example.com" } ``` #### Error Response (409 Conflict) - **success** (boolean) - Indicates if the operation was successful (false in case of conflict). - **message** (string) - Description of the conflict (e.g., "Ya existe un contacto con este número de teléfono"). #### Error Response (420 Validation Error) - **success** (boolean) - Indicates if the operation was successful (false in case of validation errors). - **errors** (array) - An array of validation error objects. - **field** (string) - The field that has the validation error. - **message** (string) - The error message for the field. ``` -------------------------------- ### Consultar flujos de WhatsApp (Python) Source: https://api-docs.wasapi.io/reference/flows This snippet demonstrates how to retrieve WhatsApp flows from the Wasapi API using Python's 'requests' library. It sends a GET request and expects a JSON response. Make sure the 'requests' library is installed. ```python import requests url = "https://api-ws.wasapi.io/api/v1/whatsapp-flows" headers = { "accept": "application/json" } try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes data = response.json() print(data) except requests.exceptions.RequestException as e: print(f"Error fetching WhatsApp flows: {e}") ``` -------------------------------- ### Consultar flujos de WhatsApp (PHP) Source: https://api-docs.wasapi.io/reference/flows This snippet illustrates how to fetch WhatsApp flows from the Wasapi API using PHP's cURL extension. It performs a GET request and processes the JSON response. Ensure the cURL extension is enabled in your PHP installation. ```php ``` -------------------------------- ### Consultar Etiquetas Source: https://api-docs.wasapi.io/reference/get_labels Obtiene la lista completa de etiquetas configuradas en el sistema. ```APIDOC ## GET /etiquetas ### Description Obtiene la lista completa de etiquetas configuradas en el sistema. ### Method GET ### Endpoint /etiquetas ### Parameters #### Query Parameters (No query parameters defined) #### Request Body (No request body defined) ### Response #### Success Response (200) - **id** (integer) - El identificador único de la etiqueta. - **nombre** (string) - El nombre de la etiqueta. #### Response Example ```json { "etiquetas": [ { "id": 1, "nombre": "Tecnología" }, { "id": 2, "nombre": "Finanzas" } ] } ``` ``` -------------------------------- ### Consultar Recursos de Flujo Source: https://api-docs.wasapi.io/reference/post_whatsapp-flows-flow-id-assets Obtiene los recursos asociados a un flujo, incluyendo la pantalla inicial y su estado. ```APIDOC ## GET /websites/api-docs_wasapi_io/flow/resources ### Description Obtiene los recursos asociados a un flujo, incluyendo la pantalla inicial y su estado. ### Method GET ### Endpoint /websites/api-docs_wasapi_io/flow/resources ### Parameters #### Query Parameters - **flowId** (string) - Required - El identificador único del flujo. ### Response #### Success Response (200) - **initialScreen** (object) - La pantalla inicial del flujo. - **id** (string) - El identificador de la pantalla. - **name** (string) - El nombre de la pantalla. - **status** (string) - El estado actual del flujo (e.g., 'active', 'inactive', 'completed'). #### Response Example ```json { "initialScreen": { "id": "screen-123", "name": "Welcome Screen" }, "status": "active" } ``` ``` -------------------------------- ### GET /websites/{website_id}/api/docs/pages Source: https://api-docs.wasapi.io/reference/get_whatsapp-templates-template-uuid Retrieves a list of all pages within a specific website. This endpoint is useful for getting an overview of the website's structure and content. ```APIDOC ## GET /websites/{website_id}/api/docs/pages ### Description Retrieves a list of all pages within a specific website. This endpoint is useful for getting an overview of the website's structure and content. ### Method GET ### Endpoint /websites/{website_id}/api/docs/pages ### Parameters #### Path Parameters - **website_id** (string) - Required - The unique identifier of the website. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **pages** (array) - A list of page objects, each containing page details. - **id** (string) - The unique identifier of the page. - **title** (string) - The title of the page. - **slug** (string) - The URL-friendly identifier of the page. - **created_at** (string) - The date and time the page was created. - **updated_at** (string) - The date and time the page was last updated. #### Response Example ```json { "pages": [ { "id": "page_123", "title": "Homepage", "slug": "/", "created_at": "2024-12-23T11:59:23.000000Z", "updated_at": "2025-04-16T12:37:10.000000Z" } ] } ``` #### Error Response (401) - **success** (boolean) - Indicates if the request was successful (false in case of error). - **message** (string) - Error message describing the issue (e.g., "Acceso no autorizado"). #### Error Response (404) - **success** (boolean) - Indicates if the request was successful (false in case of error). - **message** (string) - Error message describing the issue (e.g., "Recurso no encontrado"). #### Error Response (500) - **success** (boolean) - Indicates if the request was successful (false in case of error). - **error** (string) - Error message describing the internal server error. ``` -------------------------------- ### GET /whatsapp_business_account Source: https://api-docs.wasapi.io/reference/post_whatsapp-flows-flow-id-assets Retrieves the details of the authenticated WhatsApp Business Account. ```APIDOC ## GET /whatsapp_business_account ### Description Retrieves the details of the authenticated WhatsApp Business Account, including its unique identifier, name, currency, timezone, and message template namespace. ### Method GET ### Endpoint /whatsapp_business_account ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **id** (string) - Identificador único de la cuenta - **name** (string) - Nombre de la cuenta - **currency** (string) - Moneda utilizada - **timezone_id** (string) - Zona horaria - **message_template_namespace** (string) - Espacio de nombres para plantillas #### Response Example ```json { "id": "1023456789012345", "name": "Mi Empresa", "currency": "USD", "timezone_id": "America/New_York", "message_template_namespace": "abcdef1234567890" } ``` #### Error Response (401) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - Provides details about the error. #### Error Response Example ```json { "success": false, "message": "Acceso no autorizado" } ``` ``` -------------------------------- ### Actualizar Campo Personalizado Source: https://api-docs.wasapi.io/reference/put_custom-fields-id Modifica la configuración de un campo personalizado existente. ```APIDOC ## PUT /websites/api-docs_wasapi_io/custom_fields/{id} ### Description Modifica la configuración de un campo personalizado existente. ### Method PUT ### Endpoint /websites/api-docs_wasapi_io/custom_fields/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - El ID del campo personalizado a actualizar. #### Request Body - **name** (string) - Optional - El nuevo nombre del campo personalizado. - **type** (string) - Optional - El nuevo tipo del campo personalizado (e.g., 'text', 'number', 'date'). - **required** (boolean) - Optional - Indica si el campo es obligatorio. ### Request Example ```json { "name": "Nuevo Nombre", "type": "text", "required": false } ``` ### Response #### Success Response (200) - **id** (integer) - El ID del campo personalizado actualizado. - **name** (string) - El nombre del campo personalizado actualizado. - **type** (string) - El tipo del campo personalizado actualizado. - **required** (boolean) - Indica si el campo es obligatorio. #### Response Example ```json { "id": 1, "name": "Nuevo Nombre", "type": "text", "required": false } ``` ``` -------------------------------- ### Consultar Campos Personalizados Source: https://api-docs.wasapi.io/reference/get_custom-fields Obtiene la lista completa de campos personalizados configurados en el sistema. ```APIDOC ## GET /websites/api-docs_wasapi_io/custom_fields ### Description Obtiene la lista completa de campos personalizados configurados en el sistema. ### Method GET ### Endpoint /websites/api-docs_wasapi_io/custom_fields ### Parameters #### Query Parameters * **None** #### Request Body * **None** ### Request Example * **None** ### Response #### Success Response (200) - **id** (integer) - El identificador único del campo personalizado. - **name** (string) - El nombre del campo personalizado. - **type** (string) - El tipo de dato del campo personalizado (ej. 'text', 'number', 'date'). - **required** (boolean) - Indica si el campo es obligatorio. #### Response Example ```json { "custom_fields": [ { "id": 1, "name": "Número de Serie", "type": "text", "required": true }, { "id": 2, "name": "Fecha de Instalación", "type": "date", "required": false } ] } ``` ``` -------------------------------- ### Get Workflow Statuses - OpenAPI Definition Source: https://api-docs.wasapi.io/reference/get_workflow-statuses This OpenAPI 3.0.0 definition describes the 'get' endpoint for retrieving workflow statuses. It supports filtering by action, phone number, agent ID, date range, and pagination parameters. The response includes pagination details and a list of workflow status objects. ```json { "openapi": "3.0.0", "info": { "description": "# Documentación de la API de Gestión de Contactos de Wasapi\n\n## Descripción General\nLa API de Gestión de Contactos de Wasapi proporciona una interfaz robusta y segura para la administración integral de contactos, etiquetas, campañas, flujos y campos personalizados en el sistema.\n\n## Características Principales\n- Gestión completa del ciclo de vida de contactos (CRUD)\n- Sistema de etiquetado avanzado para categorización\n- Campos personalizados configurables\n- Búsqueda y filtrado optimizados\n- Gestión de campañas de mensajería\n- Flujos de trabajo y chatbots\n\n## Autenticación\nLa API implementa autenticación mediante Bearer Token (JWT). Incluya el token en el encabezado `Authorization: Bearer `\n\n## Versiones\nLa versión actual de la API es v1.0.0\n", "version": "1.0.0", "title": "Wasapi API", "contact": { "email": "info@vinixcode.com", "name": "Soporte Wasapi", "url": "https://wasapi.io/soporte" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, "servers": [ { "url": "https://api-ws.wasapi.io/api/v1", "description": "Servidor de producción" } ], "tags": [ { "name": "workflow", "description": "Gestión de estados de flujo de trabajo" } ], "paths": { "/workflow-statuses": { "get": { "tags": [ "workflow" ], "summary": "Obtener estados de flujos de trabajo", "description": "Obtiene una lista paginada de estados de flujos de trabajo con opciones de filtrado", "parameters": [ { "name": "action", "in": "query", "description": "(Opcional) Filtrar por tipo de acción (open, hold, closed)", "schema": { "type": "string" }, "required": false }, { "name": "phone", "in": "query", "description": "(Opcional) Filtrar por el número de teléfono con el que fue la interacción", "schema": { "type": "string" }, "required": false }, { "name": "agent_id", "in": "query", "description": "(Opcional) Filtrar por ID del agente", "schema": { "type": "integer" }, "required": false }, { "name": "dates", "in": "query", "description": "(Opcional) Rango de fechas en formato YYYY-MM-DD separadas por coma. Ejemplo '2024-03-01,2024-03-31'", "schema": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}$" }, "example": "2024-03-01,2024-03-31", "required": false }, { "name": "per_page", "in": "query", "description": "(Opcional) Número de registros por página. Valor máximo permitido es 50. Por defecto es 15.", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 15 }, "required": false }, { "name": "page", "in": "query", "description": "(Opcional) Número de página para la paginación", "schema": { "type": "integer", "minimum": 1, "default": 1 }, "required": false } ], "responses": { "200": { "description": "Lista paginada de estados de flujos de trabajo", "content": { "application/json": { "schema": { "type": "object", "properties": { "current_page": { "type": "integer", "description": "Página actual", "example": 1 }, "data": { "type": "array", "description": "Lista de estados de flujos de trabajo", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "Identificador único del estado", "example": 1 }, "name": { "type": "string", "description": "Nombre del estado", "example": "Pendiente" }, "description": { "type": "string" } } } } } } } } } } } } } } ``` -------------------------------- ### POST /contactos Source: https://api-docs.wasapi.io/reference/addcontact Registra un nuevo contacto en el sistema con sus datos asociados. Permite la creación de un nuevo registro de contacto. ```APIDOC ## POST /contactos ### Description Registra un nuevo contacto en el sistema con sus datos asociados. ### Method POST ### Endpoint /contactos ### Parameters #### Request Body - **nombre** (string) - Required - Nombre del contacto. - **email** (string) - Required - Correo electrónico del contacto. - **telefono** (string) - Optional - Número de teléfono del contacto. ### Request Example ```json { "nombre": "Juan Perez", "email": "juan.perez@example.com", "telefono": "123456789" } ``` ### Response #### Success Response (201) - **id** (string) - El ID único del contacto creado. - **message** (string) - Mensaje de confirmación. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "message": "Contacto creado exitosamente" } ``` ``` -------------------------------- ### GET /whatsapp-templates/{template_uuid} Source: https://api-docs.wasapi.io/reference/get_whatsapp-templates-template-uuid Retrieves the details of a specific WhatsApp template identified by its UUID. ```APIDOC ## GET /whatsapp-templates/{template_uuid} ### Description Retorna los detalles de una plantilla específica identificada por su UUID. ### Method GET ### Endpoint /whatsapp-templates/{template_uuid} ### Parameters #### Path Parameters - **template_uuid** (string) - Required - UUID de la plantilla a obtener ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **success** (boolean) - Indica si la operación fue exitosa - **data** (object) - Contiene los detalles de la plantilla - **id** (integer) - Identificador único de la plantilla - **user_id** (integer) - ID del usuario propietario - **app_id** (integer) - ID de la aplicación asociada - **uuid** (string) - UUID único de la plantilla - **language** (string) - Idioma de la plantilla - **template_id** (string) - Identificador de la plantilla en Meta - **status** (string) - Estado de la plantilla - **header_type** (string) - Tipo de encabezado - **header_value** (string|null) - Valor del encabezado - **body** (string) - Cuerpo del mensaje #### Response Example ```json { "success": true, "data": { "id": 88048, "user_id": 1, "app_id": 8877, "uuid": "6e40eb7a-a0d7-41ff-818c-84e3ff4c1603", "language": "es", "template_id": "iniciar_chat_wsp_v1", "status": "APPROVED", "header_type": "none", "header_value": null, "body": "Hola {{1}}, tu código de verificación es {{2}}. No lo compartas con nadie." } } ``` ``` -------------------------------- ### Resource Not Found Response (404) Source: https://api-docs.wasapi.io/reference/getcontactbyuuid Standard JSON response when a requested resource cannot be found. It includes a success flag set to false and a message indicating the resource was not found. ```json { "success": false, "message": "Recurso no encontrado" } ``` -------------------------------- ### GET /contacts Source: https://api-docs.wasapi.io/reference/get_contacts Retrieves a paginated list of contacts with advanced search and filtering capabilities. ```APIDOC ## GET /contacts ### Description Retorna una lista paginada de contactos con capacidades avanzadas de búsqueda y filtrado. ### Method GET ### Endpoint /contacts ### Parameters #### Query Parameters - **page** (integer) - Optional - Número de página para la paginación. Valor por defecto 1. - **search** (string) - Optional - Término de búsqueda para filtrar contactos. - **labels** (integer) - Optional - ID de etiqueta para filtrar contactos. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **data** (array) - An array of contact objects. - **current_page** (integer) - The current page number. - **data** (array) - The list of contacts for the current page. - **id** (integer) - The unique identifier for the contact. - **user_id** (integer) - The ID of the user associated with the contact. - **uuid** (string) - The universally unique identifier for the contact. - **first_name** (string) - The first name of the contact. - **last_name** (string) - The last name of the contact. - **email** (string) - The email address of the contact. - **country_code** (string) - The country code for the contact's phone number. - **phone** (string) - The phone number of the contact. - **notes** (string) - Any notes associated with the contact. - **blocked** (integer) - Indicates if the contact is blocked (e.g., 0 for not blocked, 1 for blocked). #### Response Example ```json { "success": true, "data": { "current_page": 1, "data": [ { "id": 1, "user_id": 10, "uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "country_code": "US", "phone": "+11234567890", "notes": "Important client", "blocked": 0 } ] } } ``` ``` -------------------------------- ### POST /campaigns Source: https://api-docs.wasapi.io/reference/get_campaigns Creates a new campaign with the provided details. Requires authentication with a JWT token. ```APIDOC ## POST /campaigns ### Description Creates a new campaign with the provided details. Requires authentication with a JWT token. ### Method POST ### Endpoint /campaigns ### Parameters #### Request Body - **name** (string) - Required - Nombre de la campaña - **description** (string) - Optional - Descripción de la campaña - **start_date** (string) - Required - Fecha de inicio de la campaña (formato YYYY-MM-DD) - **end_date** (string) - Optional - Fecha de fin de la campaña (formato YYYY-MM-DD) ### Request Example ```json { "name": "Campaña de Verano", "description": "Promoción especial de verano", "start_date": "2024-07-01", "end_date": "2024-08-31" } ``` ### Response #### Success Response (201) - **id** (integer) - Unique identifier for the created campaign. - **name** (string) - Name of the campaign. - **description** (string) - Description of the campaign. - **start_date** (string) - Start date of the campaign. - **end_date** (string) - End date of the campaign. - **created_at** (string) - Date and time of campaign creation. - **updated_at** (string) - Date and time of last campaign update. #### Response Example ```json { "id": 1, "name": "Campaña de Verano", "description": "Promoción especial de verano", "start_date": "2024-07-01", "end_date": "2024-08-31", "created_at": "2024-06-20T10:00:00.000000Z", "updated_at": "2024-06-20T10:00:00.000000Z" } ``` #### Error Response (401) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - Error message. #### Error Response Example (401) ```json { "success": false, "message": "Acceso no autorizado" } ``` #### Error Response (422) - **success** (boolean) - Indicates if the request was successful. - **errors** (array) - Array of validation errors. - **field** (string) - The field that caused the error. - **message** (string) - The error message for the field. #### Error Response Example (422) ```json { "success": false, "errors": [ { "field": "name", "message": "El nombre de la campaña es requerido" } ] } ``` ``` -------------------------------- ### Consult WhatsApp Numbers - GET Source: https://api-docs.wasapi.io/reference/get_whatsapp-numbers Retrieves a list of configured WhatsApp numbers in the system. This GET request requires authentication via a Bearer Token. The response includes a success status and an array of WhatsApp number objects, each containing details like ID, phone number, and creation timestamps. ```json { "openapi": "3.0.0", "info": { "description": "# Documentación de la API de Gestión de Contactos de Wasapi\n\n## Descripción General\nLa API de Gestión de Contactos de Wasapi proporciona una interfaz robusta y segura para la administración integral de contactos, etiquetas, campañas, flujos y campos personalizados en el sistema.\n\n## Características Principales\n- Gestión completa del ciclo de vida de contactos (CRUD)\n- Sistema de etiquetado avanzado para categorización\n- Campos personalizados configurables\n- Búsqueda y filtrado optimizados\n- Gestión de campañas de mensajería\n- Flujos de trabajo y chatbots\n\n## Autenticación\nLa API implementa autenticación mediante Bearer Token (JWT). Incluya el token en el encabezado `Authorization: Bearer `\n\n## Versiones\nLa versión actual de la API es v1.0.0\n", "version": "1.0.0", "title": "Wasapi API", "contact": { "email": "info@vinixcode.com", "name": "Soporte Wasapi", "url": "https://wasapi.io/soporte" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, "servers": [ { "url": "https://api-ws.wasapi.io/api/v1", "description": "Servidor de producción" } ], "tags": [ { "name": "whatsapp", "description": "Gestión de números de WhatsApp y plantillas" } ], "paths": { "/whatsapp-numbers": { "get": { "tags": [ "whatsapp" ], "summary": "Consultar números de WhatsApp", "description": "Obtiene la lista de números de WhatsApp configurados en el sistema", "responses": { "200": { "description": "Números recuperados exitosamente", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indica si la operación fue exitosa", "example": true }, "data": { "type": "array", "description": "Lista de números de WhatsApp", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "Identificador único del número", "example": 1 }, "uuid": { "type": "string", "format": "uuid", "description": "Identificador único universal del número", "example": "550e8400-e29b-41d4-a716-446655440000" }, "user_id": { "type": "integer", "description": "Identificador del usuario propietario", "example": 1 }, "app_id": { "type": "integer", "description": "Identificador de la aplicación", "example": 1 }, "display_name": { "type": "string", "description": "Nombre para mostrar del número", "example": "Número Principal" }, "phone_number": { "type": "string", "description": "Número de teléfono", "example": "+573001234567" }, "phone_id": { "type": "string", "description": "Identificador del teléfono en WhatsApp", "example": "1234567890" }, "created_at": { "type": "string", "format": "date-time", "description": "Fecha y hora de creación", "example": "2024-03-20T15:30:00Z" }, "updated_at": { "type": "string", "format": "date-time", "description": "Fecha y hora de última actualización", "example": "2024-03-20T15:30:00Z" }, "app": { "type": "object", "description": "Información de la aplicación asociada", "properties": { "id": { "type": "integer", "description": "Identificador de la aplicación", "example": 1 }, "name": { "type": "string", "description": "Nombre de la aplicación", "example": "Mi App Wasapi" } } } } } } } } } } } } } } } } ``` -------------------------------- ### Consultar Volumen de Trabajo por Hora Source: https://api-docs.wasapi.io/reference/get_reports-volume-of-workflow Retorna métricas de volumen de trabajo agrupadas por fecha y hora en un rango específico. Incluye información sobre conversaciones abiertas/cerradas y conteo de primeras respuestas. Opcionalmente, puede incluir comparación con período anterior (totales, porcentaje de cambio y tendencia). ```APIDOC ## GET /websites/api-docs_wasapi_io/workload ### Description Retorna métricas de volumen de trabajo agrupadas por fecha y hora en un rango específico. Incluye información sobre conversaciones abiertas/cerradas y conteo de primeras respuestas. Opcionalmente, puede incluir comparación con período anterior (totales, porcentaje de cambio y tendencia). ### Method GET ### Endpoint /websites/api-docs_wasapi_io/workload ### Parameters #### Query Parameters - **startDate** (string) - Required - Fecha de inicio del rango (YYYY-MM-DD). - **endDate** (string) - Required - Fecha de fin del rango (YYYY-MM-DD). - **previousPeriod** (boolean) - Optional - Si es true, incluye comparación con el período anterior. ### Request Example ``` GET /websites/api-docs_wasapi_io/workload?startDate=2023-01-01&endDate=2023-01-31&previousPeriod=true ``` ### Response #### Success Response (200) - **date** (string) - Fecha de la métrica. - **hour** (integer) - Hora del día (0-23). - **openConversations** (integer) - Número de conversaciones abiertas. - **closedConversations** (integer) - Número de conversaciones cerradas. - **firstResponseCount** (integer) - Conteo de primeras respuestas. - **comparison** (object) - Objeto con datos de comparación con el período anterior (si previousPeriod es true). - **totalOpenConversations** (integer) - Total de conversaciones abiertas en el período anterior. - **totalClosedConversations** (integer) - Total de conversaciones cerradas en el período anterior. - **totalFirstResponseCount** (integer) - Total de primeras respuestas en el período anterior. - **openConversationsChangePercentage** (float) - Porcentaje de cambio en conversaciones abiertas. - **closedConversationsChangePercentage** (float) - Porcentaje de cambio en conversaciones cerradas. - **firstResponseCountChangePercentage** (float) - Porcentaje de cambio en primeras respuestas. - **openConversationsTrend** (string) - Tendencia de conversaciones abiertas (UP/DOWN/NONE). - **closedConversationsTrend** (string) - Tendencia de conversaciones cerradas (UP/DOWN/NONE). - **firstResponseCountTrend** (string) - Tendencia de primeras respuestas (UP/DOWN/NONE). #### Response Example ```json { "data": [ { "date": "2023-01-01", "hour": 10, "openConversations": 50, "closedConversations": 45, "firstResponseCount": 48, "comparison": { "totalOpenConversations": 48, "totalClosedConversations": 42, "totalFirstResponseCount": 46, "openConversationsChangePercentage": 4.17, "closedConversationsChangePercentage": 7.14, "firstResponseCountChangePercentage": 4.35, "openConversationsTrend": "UP", "closedConversationsTrend": "UP", "firstResponseCountTrend": "UP" } } ] } ``` ```