diff --git a/PostmanCollections/VTEX - Weny by VTEX API.json b/PostmanCollections/VTEX - Weny by VTEX API.json new file mode 100644 index 000000000..6662af7c9 --- /dev/null +++ b/PostmanCollections/VTEX - Weny by VTEX API.json @@ -0,0 +1,679 @@ +{ + "_": { + "postman_id": "76493e99-ba8f-464a-b4f9-9e46e42556c4" + }, + "item": [ + { + "id": "fd800c68-9261-47bc-8a4c-262ee598e523", + "name": "Events", + "description": { + "content": "", + "type": "text/plain" + }, + "item": [ + { + "id": "7463638f-ee51-475c-9981-67c99720fd22", + "name": "Retrieve events.", + "request": { + "name": "Retrieve events.", + "description": { + "content": "Events are structured data objects containing information about conversations, agent interactions, tool usage, and user feedback. This endpoint retrieves events from a specified date range. \r\n\r\n Event types: \r\n All events follow a common structure and are separated into two types: \r\n - **Custom events**: User-defined events from action groups (such as CSAT, NPS, and custom events). \r\n - **Fixed events**: System-generated events (such as Resolution, Topics, Tool Calls, and Agent Invocation). \r\n\r\n There are several filters that can be used to retrieve events, and we recommend that you use as much filters as possible to narrow the search, improving API performance. Also, using the `limit` and `offset` parameters avoids large responses and makes pagination easier. \r\n\r\n ## Permissions \r\n Check with your service provider to know what permissions are needed.", + "type": "text/plain" + }, + "url": { + "path": [ + "api", + "v2", + "events.json" + ], + "host": [ + "{{baseUrl}}" + ], + "query": [ + { + "disabled": false, + "description": { + "content": "(Required) Start date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_start", + "value": "2025-06-03T00:00:00Z" + }, + { + "disabled": false, + "description": { + "content": "(Required) End date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_end", + "value": "2025-06-20T23:59:59Z" + }, + { + "disabled": true, + "description": { + "content": "Type of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_type", + "value": "message_received" + }, + { + "disabled": true, + "description": { + "content": "Contact URN. You can use this field to filter events from a specific contact.", + "type": "text/plain" + }, + "key": "contact_urn", + "value": "whatsapp:5511999999999" + }, + { + "disabled": true, + "description": { + "content": "Name of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_name", + "value": "user_signup" + }, + { + "disabled": true, + "description": { + "content": "Key of the event you which to filter.", + "type": "text/plain" + }, + "key": "key", + "value": "session_id" + }, + { + "disabled": true, + "description": { + "content": "Value associated with the key you which to filter. The type of the value must match the `value_type` field.", + "type": "text/plain" + }, + "key": "value", + "value": "12345" + }, + { + "disabled": true, + "description": { + "content": "Type of the value you which to filter.", + "type": "text/plain" + }, + "key": "value_type", + "value": "integer" + }, + { + "disabled": true, + "description": { + "content": "Metadata of the event you which to filter.", + "type": "text/plain" + }, + "key": "metadata", + "value": "{\"source\":\"campaign\"}" + }, + { + "disabled": true, + "description": { + "content": "Maximum number of records to return. We recommended using this parameter for lighter queries and pagination.", + "type": "text/plain" + }, + "key": "limit", + "value": "50" + }, + { + "disabled": true, + "description": { + "content": "Number of records to skip before returning results. You can use this parameter with the `limit` parameter for pagination. For examples, if your `limit` is set to 50, the first page will have `offset=0`, the second page will have `offset=50`, the third page will have `offset=100`.", + "type": "text/plain" + }, + "key": "offset", + "value": "0" + } + ], + "variable": [] + }, + "header": [ + { + "disabled": false, + "description": { + "content": "(Required) Type of the content being sent.", + "type": "text/plain" + }, + "key": "Content-Type", + "value": "application/json" + }, + { + "disabled": false, + "description": { + "content": "(Required) Token for API authentication. You can find your API Token in the Weni by VTEX platform under Applications > Other Apps.", + "type": "text/plain" + }, + "key": "Authorization", + "value": "Token " + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "method": "GET", + "body": {} + }, + "response": [ + { + "_": { + "postman_previewlanguage": "json" + }, + "id": "1a661774-9bb3-40f5-85dc-69f8a0f05075", + "name": "OK", + "originalRequest": { + "url": { + "path": [ + "api", + "v2", + "events.json" + ], + "host": [ + "{{baseUrl}}" + ], + "query": [ + { + "disabled": false, + "description": { + "content": "(Required) Start date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_start", + "value": "2025-06-03T00:00:00Z" + }, + { + "disabled": false, + "description": { + "content": "(Required) End date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_end", + "value": "2025-06-20T23:59:59Z" + }, + { + "disabled": true, + "description": { + "content": "Type of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_type", + "value": "message_received" + }, + { + "disabled": true, + "description": { + "content": "Contact URN. You can use this field to filter events from a specific contact.", + "type": "text/plain" + }, + "key": "contact_urn", + "value": "whatsapp:5511999999999" + }, + { + "disabled": true, + "description": { + "content": "Name of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_name", + "value": "user_signup" + }, + { + "disabled": true, + "description": { + "content": "Key of the event you which to filter.", + "type": "text/plain" + }, + "key": "key", + "value": "session_id" + }, + { + "disabled": true, + "description": { + "content": "Value associated with the key you which to filter. The type of the value must match the `value_type` field.", + "type": "text/plain" + }, + "key": "value", + "value": "12345" + }, + { + "disabled": true, + "description": { + "content": "Type of the value you which to filter.", + "type": "text/plain" + }, + "key": "value_type", + "value": "integer" + }, + { + "disabled": true, + "description": { + "content": "Metadata of the event you which to filter.", + "type": "text/plain" + }, + "key": "metadata", + "value": "{\"source\":\"campaign\"}" + }, + { + "disabled": true, + "description": { + "content": "Maximum number of records to return. We recommended using this parameter for lighter queries and pagination.", + "type": "text/plain" + }, + "key": "limit", + "value": "50" + }, + { + "disabled": true, + "description": { + "content": "Number of records to skip before returning results. You can use this parameter with the `limit` parameter for pagination. For examples, if your `limit` is set to 50, the first page will have `offset=0`, the second page will have `offset=50`, the third page will have `offset=100`.", + "type": "text/plain" + }, + "key": "offset", + "value": "0" + } + ], + "variable": [] + }, + "header": [ + { + "disabled": false, + "description": { + "content": "(Required) Type of the content being sent.", + "type": "text/plain" + }, + "key": "Content-Type", + "value": "application/json" + }, + { + "disabled": false, + "description": { + "content": "(Required) Token for API authentication. You can find your API Token in the Weni by VTEX platform under Applications > Other Apps.", + "type": "text/plain" + }, + "key": "Authorization", + "value": "Token " + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "method": "GET", + "body": {} + }, + "status": "Accepted", + "code": 202, + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": "{\n \"events\": [\n {\n \"event_name\": \"weni_nexus_data\",\n \"key\": \"tool_call\",\n \"date\": \"2025-09-02T21:40:23.492487Z\",\n \"contact_urn\": \"ext:9999008099@\",\n \"value_type\": \"string\",\n \"value\": \"weatherforecast\",\n \"metadata\": {\n \"tool_call\": {\n \"function_name\": \"get_weather-104\",\n \"parameters\": [\n {\n \"name\": \"city\",\n \"type\": \"string\",\n \"value\": \"São Paulo\"\n }\n ],\n \"tool_name\": \"weatherforecast\"\n }\n }\n }\n ]\n}", + "cookie": [] + }, + { + "_": { + "postman_previewlanguage": "json" + }, + "id": "f31c0da0-7e44-4f1f-b8bc-4ee8bdd67a6f", + "name": "Bad Request", + "originalRequest": { + "url": { + "path": [ + "api", + "v2", + "events.json" + ], + "host": [ + "{{baseUrl}}" + ], + "query": [ + { + "disabled": false, + "description": { + "content": "(Required) Start date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_start", + "value": "2025-06-03T00:00:00Z" + }, + { + "disabled": false, + "description": { + "content": "(Required) End date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_end", + "value": "2025-06-20T23:59:59Z" + }, + { + "disabled": true, + "description": { + "content": "Type of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_type", + "value": "message_received" + }, + { + "disabled": true, + "description": { + "content": "Contact URN. You can use this field to filter events from a specific contact.", + "type": "text/plain" + }, + "key": "contact_urn", + "value": "whatsapp:5511999999999" + }, + { + "disabled": true, + "description": { + "content": "Name of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_name", + "value": "user_signup" + }, + { + "disabled": true, + "description": { + "content": "Key of the event you which to filter.", + "type": "text/plain" + }, + "key": "key", + "value": "session_id" + }, + { + "disabled": true, + "description": { + "content": "Value associated with the key you which to filter. The type of the value must match the `value_type` field.", + "type": "text/plain" + }, + "key": "value", + "value": "12345" + }, + { + "disabled": true, + "description": { + "content": "Type of the value you which to filter.", + "type": "text/plain" + }, + "key": "value_type", + "value": "integer" + }, + { + "disabled": true, + "description": { + "content": "Metadata of the event you which to filter.", + "type": "text/plain" + }, + "key": "metadata", + "value": "{\"source\":\"campaign\"}" + }, + { + "disabled": true, + "description": { + "content": "Maximum number of records to return. We recommended using this parameter for lighter queries and pagination.", + "type": "text/plain" + }, + "key": "limit", + "value": "50" + }, + { + "disabled": true, + "description": { + "content": "Number of records to skip before returning results. You can use this parameter with the `limit` parameter for pagination. For examples, if your `limit` is set to 50, the first page will have `offset=0`, the second page will have `offset=50`, the third page will have `offset=100`.", + "type": "text/plain" + }, + "key": "offset", + "value": "0" + } + ], + "variable": [] + }, + "header": [ + { + "disabled": false, + "description": { + "content": "(Required) Type of the content being sent.", + "type": "text/plain" + }, + "key": "Content-Type", + "value": "application/json" + }, + { + "disabled": false, + "description": { + "content": "(Required) Token for API authentication. You can find your API Token in the Weni by VTEX platform under Applications > Other Apps.", + "type": "text/plain" + }, + "key": "Authorization", + "value": "Token " + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "method": "GET", + "body": {} + }, + "status": "Bad Request", + "code": 400, + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": "{\n \"error\": \"Invalid event structure: missing required field 'key'.\"\n}", + "cookie": [] + }, + { + "_": { + "postman_previewlanguage": "text" + }, + "id": "8f3407b5-5fa3-45c8-a524-d8211fa9aae9", + "name": "Unauthorized", + "originalRequest": { + "url": { + "path": [ + "api", + "v2", + "events.json" + ], + "host": [ + "{{baseUrl}}" + ], + "query": [ + { + "disabled": false, + "description": { + "content": "(Required) Start date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_start", + "value": "2025-06-03T00:00:00Z" + }, + { + "disabled": false, + "description": { + "content": "(Required) End date and time for the events you which to filter, sent in ISO 8601 format.", + "type": "text/plain" + }, + "key": "date_end", + "value": "2025-06-20T23:59:59Z" + }, + { + "disabled": true, + "description": { + "content": "Type of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_type", + "value": "message_received" + }, + { + "disabled": true, + "description": { + "content": "Contact URN. You can use this field to filter events from a specific contact.", + "type": "text/plain" + }, + "key": "contact_urn", + "value": "whatsapp:5511999999999" + }, + { + "disabled": true, + "description": { + "content": "Name of the event you which to filter.", + "type": "text/plain" + }, + "key": "event_name", + "value": "user_signup" + }, + { + "disabled": true, + "description": { + "content": "Key of the event you which to filter.", + "type": "text/plain" + }, + "key": "key", + "value": "session_id" + }, + { + "disabled": true, + "description": { + "content": "Value associated with the key you which to filter. The type of the value must match the `value_type` field.", + "type": "text/plain" + }, + "key": "value", + "value": "12345" + }, + { + "disabled": true, + "description": { + "content": "Type of the value you which to filter.", + "type": "text/plain" + }, + "key": "value_type", + "value": "integer" + }, + { + "disabled": true, + "description": { + "content": "Metadata of the event you which to filter.", + "type": "text/plain" + }, + "key": "metadata", + "value": "{\"source\":\"campaign\"}" + }, + { + "disabled": true, + "description": { + "content": "Maximum number of records to return. We recommended using this parameter for lighter queries and pagination.", + "type": "text/plain" + }, + "key": "limit", + "value": "50" + }, + { + "disabled": true, + "description": { + "content": "Number of records to skip before returning results. You can use this parameter with the `limit` parameter for pagination. For examples, if your `limit` is set to 50, the first page will have `offset=0`, the second page will have `offset=50`, the third page will have `offset=100`.", + "type": "text/plain" + }, + "key": "offset", + "value": "0" + } + ], + "variable": [] + }, + "header": [ + { + "disabled": false, + "description": { + "content": "(Required) Type of the content being sent.", + "type": "text/plain" + }, + "key": "Content-Type", + "value": "application/json" + }, + { + "disabled": false, + "description": { + "content": "(Required) Token for API authentication. You can find your API Token in the Weni by VTEX platform under Applications > Other Apps.", + "type": "text/plain" + }, + "key": "Authorization", + "value": "Token " + } + ], + "method": "GET", + "body": {} + }, + "status": "Unauthorized", + "code": 401, + "header": [], + "cookie": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "id": "48abceab-3e2e-4883-8278-390a1fccfc22", + "type": "text/javascript", + "exec": [ + "// Validate status 2xx \npm.test(\"[GET]::/api/v2/events.json - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", + "// Validate if response header has matching content-type\npm.test(\"[GET]::/api/v2/events.json - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", + "// Validate if response has JSON Body \npm.test(\"[GET]::/api/v2/events.json - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", + "// Response Validation\nconst schema = {\"type\":\"array\",\"description\":\"Array containing information about the events.\",\"items\":{\"type\":\"object\",\"description\":\"Information about the events .\",\"properties\":{\"event_name\":{\"type\":\"string\",\"description\":\"Name of the event. The value will be `weni_nexus_data` for all events.\"},\"key\":{\"type\":\"string\",\"description\":\"Type of the event.\"},\"date\":{\"type\":\"string\",\"description\":\"Date and time of the event, in ISO 8601 format.\"},\"contact_urn\":{\"type\":\"string\",\"description\":\"Contact identifier in URN format.\"},\"value_type\":{\"type\":\"string\",\"description\":\"Type of the value sent, such as `string`, `number`, `boolean`, `object`, or `array`.\"},\"value\":{\"description\":\"Value of the event. The type of `value` must match `value_type`.\"},\"metadata\":{\"type\":\"object\",\"description\":\"Additional context-specific information. Structure varies by event type.\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/api/v2/events.json - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + ] + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + } + } + ], + "event": [] + } + ], + "event": [], + "variable": [ + { + "type": "any", + "value": "api.weni.ai", + "key": "host" + }, + { + "type": "any", + "value": "https://flows.weni.ai", + "key": "baseUrl" + } + ], + "info": { + "_postman_id": "76493e99-ba8f-464a-b4f9-9e46e42556c4", + "name": "Weni Events API", + "version": { + "raw": "2.0.0", + "major": 2, + "minor": 0, + "patch": 0, + "prerelease": [], + "build": [], + "string": "2.0.0" + }, + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "description": { + "content": "Weni by VTEX is an AI-powered tool that helps you automate customer service. \r\n\r\n ## Weni by VTEX API Index\r\n\r\n### Events \r\n\r\n- `GET` [Retrieve events](https://flows.weni.ai/api/v2/events.json)", + "type": "text/plain" + } + } +} \ No newline at end of file diff --git a/VTEX - Weny by VTEX API.json b/VTEX - Weny by VTEX API.json new file mode 100644 index 000000000..e38c3a654 --- /dev/null +++ b/VTEX - Weny by VTEX API.json @@ -0,0 +1,290 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Weni Events API", + "description": "Weni by VTEX is an AI-powered tool that helps you automate customer service. \r\n\r\n ## Weni by VTEX API Index\r\n\r\n### Events \r\n\r\n- `GET` [Retrieve events](https:\/\/flows.weni.ai\/api\/v2\/events.json)", + "version": "2.0.0" + }, + "servers": [ + { + "url": "https://flows.weni.ai", + "variables": { + "host": { + "default": "api.weni.ai", + "description": "Host of the Weni/Nexus API. Used as part of the URL." + } + } + } + ], + "paths": { + "/api/v2/events.json": { + "get": { + "summary": "Retrieve events.", + "description": "Events are structured data objects containing information about conversations, agent interactions, tool usage, and user feedback. This endpoint retrieves events from a specified date range. \r\n\r\n Event types: \r\n All events follow a common structure and are separated into two types: \r\n - **Custom events**: User-defined events from action groups (such as CSAT, NPS, and custom events). \r\n - **Fixed events**: System-generated events (such as Resolution, Topics, Tool Calls, and Agent Invocation). \r\n\r\n There are several filters that can be used to retrieve events, and we recommend that you use as much filters as possible to narrow the search, improving API performance. Also, using the `limit` and `offset` parameters avoids large responses and makes pagination easier. \r\n\r\n ## Permissions \r\n Check with your service provider to know what permissions are needed.", + "tags": ["Events"], + "parameters": [ + { + "$ref": "#/components/parameters/Content-Type" + }, + { + "$ref": "#/components/parameters/Authorization" + }, + { + "name": "date_start", + "in": "query", + "description": "Start date and time for the events you which to filter, sent in ISO 8601 format.", + "required": true, + "style": "form", + "schema": { + "type": "string", + "example": "2025-06-03T00:00:00Z" + } + }, + { + "name": "date_end", + "in": "query", + "description": "End date and time for the events you which to filter, sent in ISO 8601 format.", + "required": true, + "style": "form", + "schema": { + "type": "string", + "example": "2025-06-20T23:59:59Z" + } + }, + { + "name": "event_type", + "in": "query", + "description": "Type of the event you which to filter.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "message_received" + } + }, + { + "name": "contact_urn", + "in": "query", + "description": "Contact URN. You can use this field to filter events from a specific contact.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "whatsapp:5511999999999" + } + }, + { + "name": "event_name", + "in": "query", + "description": "Name of the event you which to filter.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "user_signup" + } + }, + { + "name": "key", + "in": "query", + "description": "Key of the event you which to filter.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "session_id" + } + }, + { + "name": "value", + "in": "query", + "description": "Value associated with the key you which to filter. The type of the value must match the `value_type` field.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "12345" + } + }, + { + "name": "value_type", + "in": "query", + "description": "Type of the value you which to filter.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "integer", + "enum": ["string", "boolean", "integer", "object", "array"] + } + }, + { + "name": "metadata", + "in": "query", + "description": "Metadata of the event you which to filter.", + "required": false, + "style": "form", + "schema": { + "type": "object", + "example": "{\"source\":\"campaign\"}" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of records to return. We recommended using this parameter for lighter queries and pagination.", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "example": 50 + } + }, + { + "name": "offset", + "in": "query", + "description": "Number of records to skip before returning results. You can use this parameter with the `limit` parameter for pagination. For examples, if your `limit` is set to 50, the first page will have `offset=0`, the second page will have `offset=50`, the third page will have `offset=100`.", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "example": 0 + } + } + ], + "responses": { + "202": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventsResponse" + }, + "example": { + "events": [ + { + "event_name": "weni_nexus_data", + "key": "tool_call", + "date": "2025-09-02T21:40:23.492487Z", + "contact_urn": "ext:9999008099@", + "value_type": "string", + "value": "weatherforecast", + "metadata": { + "tool_call": { + "function_name": "get_weather-104", + "parameters": [ + { + "name": "city", + "type": "string", + "value": "São Paulo" + } + ], + "tool_name": "weatherforecast" + } + } + } + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Error details when the request body is invalid.", + "properties": { + "error": { + "type": "string", + "description": "Error message." + } + } + }, + "example": { + "error": "Invalid event structure: missing required field 'key'." + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "Authorization": [] + } + ] + } + } + }, + "components": { + "parameters": { + "Content-Type": { + "name": "Content-Type", + "in": "header", + "description": "Type of the content being sent.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "application/json" + } + }, + "Authorization": { + "name": "Authorization", + "in": "header", + "description": "Token for API authentication. You can find your API Token in the Weni by VTEX platform under Applications > Other Apps.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "Token " + } + } + }, + "schemas": { + "EventsResponse": { + "type": "array", + "description": "Array containing information about the events.", + "items": { + "type": "object", + "description": "Information about the events .", + "properties":{ + "event_name": { + "type": "string", + "description": "Name of the event. The value will be `weni_nexus_data` for all events." + }, + "key": { + "type": "string", + "description": "Type of the event." + }, + "date": { + "type": "string", + "description": "Date and time of the event, in ISO 8601 format." + }, + "contact_urn": { + "type": "string", + "description": "Contact identifier in URN format." + }, + "value_type": { + "type": "string", + "description": "Type of the value sent, such as `string`, `number`, `boolean`, `object`, or `array`." + }, + "value": { + "description": "Value of the event. The type of `value` must match `value_type`." + }, + "metadata": { + "type": "object", + "description": "Additional context-specific information. Structure varies by event type." + } + } + } + } + } + }, + "security": [] + } + \ No newline at end of file