From 8d60624de5e9155a6166b80bb373be8c90640dbd Mon Sep 17 00:00:00 2001 From: flopezvaldez Date: Fri, 12 Sep 2025 16:55:47 +0200 Subject: [PATCH 1/3] Add new files generate actions and generate infobip app --- components/infobip/generate-actions.mjs | 486 +++++++++++++++++++ components/infobip/generate-infobip-app.mjs | 470 ++++++++++++++++++ components/infobip/infobip-enhanced.app.mjs | 190 ++++++++ components/infobip/lib/openapi-generator.mjs | 88 ++++ components/infobip/package.json | 4 + 5 files changed, 1238 insertions(+) create mode 100644 components/infobip/generate-actions.mjs create mode 100644 components/infobip/generate-infobip-app.mjs create mode 100644 components/infobip/infobip-enhanced.app.mjs create mode 100644 components/infobip/lib/openapi-generator.mjs diff --git a/components/infobip/generate-actions.mjs b/components/infobip/generate-actions.mjs new file mode 100644 index 0000000000000..e4623bb0fc226 --- /dev/null +++ b/components/infobip/generate-actions.mjs @@ -0,0 +1,486 @@ +#!/usr/bin/env node + +// Action Generator for Infobip Enhanced App +// Generates Pipedream actions from OpenAPI specification +// Follows ESLint rules and existing file patterns + +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; +import InfobipOpenAPIGenerator from "./lib/openapi-generator.mjs"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +class InfobipActionGenerator { + constructor() { + this.componentsDir = __dirname; + this.actionsDir = path.join(this.componentsDir, "actions"); + this.existingActions = new Set(); + this.generatedCount = 0; + this.skippedCount = 0; + this.errorCount = 0; + } + + // Load existing actions to avoid duplicates + loadExistingActions() { + try { + const actionDirs = fs.readdirSync(this.actionsDir, { + withFileTypes: true, + }); + + for (const dirent of actionDirs) { + if (dirent.isDirectory()) { + this.existingActions.add(dirent.name); + } + } + + console.log(`📂 Found ${this.existingActions.size} existing actions`); + } catch (error) { + console.warn("⚠️ Could not read actions directory:", error.message); + } + } + + // Create action directory and file + createActionFile(actionData, overwrite = false) { + const actionDir = path.join(this.actionsDir, actionData.actionKey); + const actionFile = path.join(actionDir, `${actionData.actionKey}.mjs`); + + // Skip if exists and not overwriting + if (!overwrite && this.existingActions.has(actionData.actionKey)) { + console.log(`⏭️ Skipping existing action: ${actionData.actionKey}`); + this.skippedCount++; + return false; + } + + try { + // Create directory if it doesn't exist + if (!fs.existsSync(actionDir)) { + fs.mkdirSync(actionDir, { + recursive: true, + }); + } + + // Format content to match ESLint rules + const formattedContent = this.formatForESLint(actionData.content); + + // Write action file + fs.writeFileSync(actionFile, formattedContent, "utf8"); + + console.log(`✅ Generated: ${actionData.actionKey}`); + this.generatedCount++; + return true; + } catch (error) { + console.error(`❌ Failed to create ${actionData.actionKey}:`, error.message); + this.errorCount++; + return false; + } + } + + // Format content according to ESLint rules + formatForESLint(content) { + return content + // Ensure proper indentation (2 spaces) + .replace(/^( {2,})/gm, (match) => { + const spaces = match.length; + return " ".repeat(Math.floor(spaces / 2)); + }) + // Ensure trailing comma on multiline objects/arrays - more precise pattern + .replace(/([}\]"'\w])\n(\s+)([}\]])/g, "$1,\n$2$3") + // Ensure object properties are on new lines + .replace(/\{\s*(\w)/g, "{\n $1") + .replace(/,\s*(\w)/g, ",\n $1") + // Add trailing newline + .replace(/\n?$/, "\n") + // Remove trailing spaces + .replace(/ +$/gm, "") + // Ensure no multiple empty lines + .replace(/\n{3,}/g, "\n\n"); + } + + // Generate action name that follows patterns + generateConsistentActionName(operation, path, method) { + // Use existing patterns from the codebase + if (operation.summary) { + // Clean up the summary to match existing patterns + return operation.summary + .replace(/^(Get|Send|Create|Update|Delete)\s+/i, (match) => + match.charAt(0).toUpperCase() + match.slice(1).toLowerCase()) + .replace(/\s+sms\s+/gi, " SMS ") + .replace(/\s+mms\s+/gi, " MMS ") + .trim(); + } + + // Fallback to generated name with proper capitalization + const pathParts = path.split("/").filter((p) => p && !p.startsWith("{")); + const methodName = method.charAt(0).toUpperCase() + method.slice(1).toLowerCase(); + const resource = pathParts + .map((p) => p.charAt(0).toUpperCase() + p.slice(1).replace(/-/g, " ")) + .join(" "); + + return `${methodName} ${resource}`; + } + + // Generate action description following existing patterns + generateConsistentDescription(operation, actionName) { + let description = operation.description || operation.summary || actionName; + + // Clean up description + description = description + .replace(/[\r\n]+/g, " ") + .replace(/\s+/g, " ") + .trim(); + + // Ensure it ends with period if not already + if (!description.endsWith(".")) { + description += "."; + } + + // Add documentation link + const docUrl = operation.externalDocs?.url || "https://www.infobip.com/docs/sms"; + return `${description} [See the documentation](${docUrl})`; + } + + // Enhanced action generation with consistent patterns + async generateEnhancedActions(options = {}) { + const { + overwrite = false, + filter = null, + limit = null, + } = options; + + console.log("🚀 Starting Infobip action generation..."); + + // Create mock app instance for OpenAPI generator + const mockApp = { + $auth: { + api_key: "mock-key", + base_url: "https://api.infobip.com", + }, + _baseUrl: () => "https://api.infobip.com", + _headers: () => ({ + "Authorization": "App mock-key", + "Content-type": "application/json", + }), + }; + + const generator = new InfobipOpenAPIGenerator(mockApp); + + try { + // Load existing actions + this.loadExistingActions(); + + // Generate all actions from OpenAPI spec + console.log("📡 Fetching OpenAPI specification..."); + const actions = await generator.generateAllActions(); + + console.log(`📋 Found ${actions.length} potential actions in OpenAPI spec`); + + let processedActions = actions; + + // Apply filter if provided + if (filter) { + processedActions = actions.filter((action) => + action.actionKey.includes(filter) || + action.actionName.toLowerCase().includes(filter.toLowerCase())); + console.log(`🔍 Filtered to ${processedActions.length} actions matching "${filter}"`); + } + + // Apply limit if provided + if (limit && limit > 0) { + processedActions = processedActions.slice(0, limit); + console.log(`📏 Limited to first ${processedActions.length} actions`); + } + + // Generate action files + console.log("⚡ Generating action files..."); + + for (const actionData of processedActions) { + // Enhance the action with consistent naming + actionData.actionName = this.generateConsistentActionName( + actionData.operation, + actionData.path, + actionData.method, + ); + + // Update the content with enhanced names and descriptions + const enhancedContent = this.enhanceActionContent(actionData); + actionData.content = enhancedContent; + + this.createActionFile(actionData, overwrite); + } + + // Print summary + console.log("\n📊 Generation Summary:"); + console.log(`✅ Generated: ${this.generatedCount}`); + console.log(`⏭️ Skipped: ${this.skippedCount}`); + console.log(`❌ Errors: ${this.errorCount}`); + console.log(`📋 Total processed: ${processedActions.length}`); + + return { + generated: this.generatedCount, + skipped: this.skippedCount, + errors: this.errorCount, + total: processedActions.length, + }; + + } catch (error) { + console.error("💥 Action generation failed:", error.message); + throw error; + } + } + + // Enhance action content with better formatting and patterns + enhanceActionContent(actionData) { + const { + actionKey, operation, path, method, + } = actionData; + + const actionName = this.generateConsistentActionName(operation, path, method); + const description = this.generateConsistentDescription(operation, actionName); + + // Parse path parameters + const pathParams = path.match(/{([^}]+)}/g)?.map((p) => p.slice(1, -1)) || []; + + // Build props based on operation parameters and request body - use propDefinition pattern + const propDefinitions = []; + + // Add path parameters as props with propDefinition pattern + for (const param of pathParams) { + const label = param.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()); + propDefinitions.push(` ${param}: { + type: "string", + label: "${label}", + description: "The ${param} parameter for the API call.", + }`); + } + + // Add common props based on the endpoint type using propDefinition pattern + if (path.includes("/messages") || path.includes("/sms")) { + if (method.toUpperCase() === "POST") { + propDefinitions.push(` from: { + propDefinition: [ + infobip, + "from", + ], + }`); + + propDefinitions.push(` to: { + propDefinition: [ + infobip, + "phoneNumber", + ], + }`); + + propDefinitions.push(` text: { + propDefinition: [ + infobip, + "text", + ], + }`); + } + } + + // Add query parameters for GET endpoints + if (method.toUpperCase() === "GET") { + propDefinitions.push(` limit: { + propDefinition: [ + infobip, + "limit", + ], + optional: true, + }`); + } + + // Build props section with proper ESLint formatting + let propsSection = " infobip,"; + if (propDefinitions.length > 0) { + propsSection += "\n" + propDefinitions.join(",\n") + ","; + } + + // Escape description properly and keep under 100 chars per line + const cleanDescription = description + .replace(/\\/g, "") // Remove escape characters + .replace(/"/g, "\\\"") // Escape quotes properly + .replace(/\s+/g, " ") // Clean whitespace + .trim(); + + // Use existing pattern - destructure and use data wrapper + const destructureProps = []; + if (pathParams.length > 0) { + destructureProps.push(...pathParams); + } + if (method.toUpperCase() === "POST" && (path.includes("/messages") || path.includes("/sms"))) { + destructureProps.push("from", "to", "text"); + } + + const allDestructureItems = [ + "infobip", + ...destructureProps, + ]; + const destructureSection = destructureProps.length > 0 + ? ` const { + ${allDestructureItems.join(",\n ")} + ...data + } = this;` + : " const { infobip } = this;"; + + // Build data object for method call following existing pattern + let dataObjectContent = ""; + if (method.toUpperCase() === "POST" && (path.includes("/messages") || path.includes("/sms"))) { + dataObjectContent = ` data: { + messages: [ + { + from, + to, + text, + ...data, + }, + ], + },`; + } else { + dataObjectContent = " ...data,"; + } + + // Create the complete action content with proper ESLint formatting + const actionContent = `import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "${actionKey}", + name: "${actionName}", + description: "${cleanDescription}", + version: "0.0.1", + type: "action", + props: { +${propsSection} + }, + async run({ $ }) { +${destructureSection} + + const response = await infobip.${actionData.methodName}({ + $, +${dataObjectContent} + }); + + $.export("$summary", "${actionName} completed successfully"); + return response; + }, +}; +`; + + return actionContent; + } + + // Utility method to clean action directories + async cleanActions(pattern = null) { + console.log("🧹 Cleaning action directories..."); + + try { + const actionDirs = fs.readdirSync(this.actionsDir, { + withFileTypes: true, + }); + + let cleanedCount = 0; + + for (const dirent of actionDirs) { + if (dirent.isDirectory()) { + const dirName = dirent.name; + + // Skip if pattern provided and doesn't match + if (pattern && !dirName.includes(pattern)) { + continue; + } + + // Skip existing core actions + if ([ + "send-sms", + "send-whatsapp-text-message", + "send-viber-text-message", + ].includes(dirName)) { + console.log(`⏭️ Skipping core action: ${dirName}`); + continue; + } + + const fullPath = path.join(this.actionsDir, dirName); + fs.rmSync(fullPath, { + recursive: true, + force: true, + }); + console.log(`🗑️ Removed: ${dirName}`); + cleanedCount++; + } + } + + console.log(`✅ Cleaned ${cleanedCount} action directories`); + return cleanedCount; + } catch (error) { + console.error("❌ Error cleaning actions:", error.message); + throw error; + } + } +} + +// CLI Interface +async function main() { + const args = process.argv.slice(2); + const generator = new InfobipActionGenerator(); + + try { + if (args.includes("--clean")) { + const pattern = args[args.indexOf("--clean") + 1]; + await generator.cleanActions(pattern); + return; + } + + const options = { + overwrite: args.includes("--overwrite") || args.includes("-f"), + filter: args.includes("--filter") + ? args[args.indexOf("--filter") + 1] + : null, + limit: args.includes("--limit") + ? parseInt(args[args.indexOf("--limit") + 1]) + : null, + }; + + if (args.includes("--help") || args.includes("-h")) { + console.log(` +Infobip Action Generator + +Usage: + node generate-actions.mjs [options] + +Options: + --overwrite, -f Overwrite existing actions + --filter Only generate actions matching pattern + --limit Limit number of actions to generate + --clean [pattern] Clean action directories (optionally matching pattern) + --help, -h Show this help + +Examples: + node generate-actions.mjs + node generate-actions.mjs --overwrite --filter sms + node generate-actions.mjs --limit 5 + node generate-actions.mjs --clean infobip- + `); + return; + } + + const result = await generator.generateEnhancedActions(options); + + if (result.generated > 0) { + console.log("\n🎉 Action generation completed successfully!"); + } + + } catch (error) { + console.error("\n💥 Generation failed:", error.message); + process.exit(1); + } +} + +// Export for use as module +export default InfobipActionGenerator; + +// Run if called directly +if (import.meta.url === `file://${process.argv[1]}`) { + main().catch(console.error); +} diff --git a/components/infobip/generate-infobip-app.mjs b/components/infobip/generate-infobip-app.mjs new file mode 100644 index 0000000000000..584c3d1f3584f --- /dev/null +++ b/components/infobip/generate-infobip-app.mjs @@ -0,0 +1,470 @@ +#!/usr/bin/env node + +// Enhanced script to fetch Infobip OpenAPI spec and update infobip-enhanced.app.mjs +// This script follows the standard patterns from infobip.app.mjs +// Usage: node update-infobip-app.mjs + +import fs from "fs"; +import InfobipOpenAPIGenerator from "./lib/openapi-generator.mjs"; + +// Configuration +const CONFIG = { + enhancedAppFile: "./infobip-enhanced.app.mjs", + backupSuffix: ".backup", + methodsStartMarker: " // OpenAPI Generated Methods - START", + methodsEndMarker: " // OpenAPI Generated Methods - END", + propsStartMarker: " // OpenAPI Generated Props - START", + propsEndMarker: " // OpenAPI Generated Props - END", +}; + +// Mock Infobip app instance for the generator +const mockApp = { + $auth: { + api_key: "test-key", + base_url: "https://api.infobip.com", + }, + async axios(config) { + const { default: axios } = await import("axios"); + return axios(config); + }, +}; + +/** + * Read the current enhanced app file + */ +function readEnhancedAppFile() { + if (!fs.existsSync(CONFIG.enhancedAppFile)) { + // Create a minimal app shell if file does not exist + const initialContent = `export default { + type: "app", + app: "infobip", + propDefinitions: { + // OpenAPI Generated Props - START + // OpenAPI Generated Props - END + }, + methods: { + // OpenAPI Generated Methods - START + // OpenAPI Generated Methods - END + }, +}; +`; + fs.writeFileSync(CONFIG.enhancedAppFile, initialContent); + console.log(`🆕 Created blank enhanced app file at: ${CONFIG.enhancedAppFile}`); + } + return fs.readFileSync(CONFIG.enhancedAppFile, "utf8"); +} + +/** + * Generate appropriate options example based on method and path + */ +function generateOptionsExample(method, path) { + const examples = []; + + // For POST methods that send messages + if (method === "POST" && (path.includes("/messages") || path.includes("/sms"))) { + examples.push(`{ + * data: { + * messages: [{ + * from: "InfoSMS", + * to: "41793026727", + * text: "Hello world!" + * }] + * } + * }`); + } + // For GET methods with query parameters + else if (method === "GET") { + const queryParams = []; + if (path.includes("/reports") || path.includes("/logs")) { + queryParams.push("limit: 10"); + if (path.includes("/reports")) { + queryParams.push("bulkId: 'bulk-id-123'"); + } + } + if (path.includes("/bulks")) { + queryParams.push("bulkId: 'bulk-id-123'"); + } + if (queryParams.length > 0) { + examples.push(`{ + * params: { + * ${queryParams.join(",\n * ")} + * } + * }`); + } else { + examples.push(`{ + * params: { + * limit: 50 + * } + * }`); + } + } + // For PUT methods (updates) + else if (method === "PUT") { + if (path.includes("/bulks/status")) { + examples.push(`{ + * data: { + * status: "PAUSED" + * } + * }`); + } else if (path.includes("/bulks")) { + examples.push(`{ + * data: { + * sendAt: "2024-12-25T10:00:00.000+01:00" + * } + * }`); + } + } + // For DELETE or other methods + else { + examples.push(`{ + * // Request options here + * }`); + } + + return examples.length > 0 + ? examples[0] + : null; +} + +/** + * Generate method implementations following infobip.app.mjs patterns + */ +function generateMethodImplementations(methods) { + const methodImpls = []; + + // Skip methods that already exist in the enhanced app to avoid duplicates + const skipMethods = new Set([ + "sendSmsMessage", // Already exists as enhanced wrapper + "messageId", // Already exists in props + ]); + + for (const [ + methodName, + methodInfo, + ] of Object.entries(methods)) { + if (skipMethods.has(methodName)) { + console.log(`⏭️ Skipping existing method: ${methodName}`); + continue; + } + const { + path, method, operation, + } = methodInfo; + + // Parse path parameters first + const pathParams = []; + const pathPattern = path.replace(/{([^}]+)}/g, (_, paramName) => { + pathParams.push(paramName); + return `\${${paramName}}`; + }); + + // Generate JSDoc comment with parameter examples + const jsdoc = []; + if (operation.summary || operation.description) { + jsdoc.push(" /**"); + if (operation.summary) { + jsdoc.push(` * ${operation.summary}`); + } + if (operation.description && operation.description !== operation.summary) { + jsdoc.push(" *"); + // Split long descriptions and wrap them properly + const desc = operation.description.replace(/\n/g, " ").trim(); + const words = desc.split(" "); + let line = " * "; + for (const word of words) { + if (line.length + word.length > 80) { + jsdoc.push(line.trim()); + line = " * " + word + " "; + } else { + line += word + " "; + } + } + if (line.trim() !== " *") { + jsdoc.push(line.trim()); + } + } + if (operation.externalDocs?.url) { + jsdoc.push(" *"); + jsdoc.push(` * @see ${operation.externalDocs.url}`); + } + + // Add parameter documentation with examples + jsdoc.push(" * @param {Object} opts - Request options"); + + // Generate example based on method and path + const exampleOpts = generateOptionsExample(method, path); + if (exampleOpts) { + jsdoc.push(" * @example"); + jsdoc.push(" * // Example usage:"); + if (pathParams.length > 0) { + const paramExample = pathParams.map((param) => `${param}: "example-${param}"`).join(", "); + jsdoc.push(` * await infobip.${methodName}({ ${paramExample}, ...otherOptions });`); + } else { + jsdoc.push(` * await infobip.${methodName}(${exampleOpts});`); + } + } + + jsdoc.push(" * @returns {Promise} API response"); + jsdoc.push(" */"); + } + + // Generate method implementation following infobip.app.mjs style + let methodImpl; + if (pathParams.length > 0) { + // Method with path parameters - destructure them from opts + const paramList = pathParams.join(", "); + methodImpl = ` ${methodName}({ ${paramList}, ...opts } = {}) { + return this._makeRequest({ + method: "${method}", + path: \`${pathPattern}\`, + ...opts, + }); + }`; + } else { + // Method without path parameters - standard pattern + methodImpl = ` ${methodName}(opts = {}) { + return this._makeRequest({ + method: "${method}", + path: "${path}", + ...opts, + }); + }`; + } + + // Combine JSDoc and implementation + const fullMethod = jsdoc.length > 0 + ? jsdoc.join("\n") + "\n" + methodImpl + : methodImpl; + + methodImpls.push(fullMethod); + } + + return methodImpls.join(",\n\n"); +} + +/** + * Generate prop definitions following infobip.app.mjs patterns + */ +function generatePropDefinitions() { + const propDefs = []; + + // Skip props that already exist in the enhanced app + const skipProps = new Set([ + "messageId", // Already exists in original props + ]); + + // Generate common props from the OpenAPI spec + const commonProps = { + bulkId: { + type: "string", + label: "Bulk ID", + description: "The ID which uniquely identifies the request for which the delivery reports are returned.", + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to retrieve. Default is 50.", + optional: true, + }, + sendAt: { + type: "string", + label: "Send At", + description: "Date and time when the message is to be sent. Used for scheduling messages.", + optional: true, + }, + validityPeriod: { + type: "integer", + label: "Validity Period", + description: "The message validity period in minutes. How long the delivery will be attempted.", + optional: true, + }, + deliveryTimeWindow: { + type: "object", + label: "Delivery Time Window", + description: "Sets specific delivery window for sending messages.", + optional: true, + }, + flash: { + type: "boolean", + label: "Flash Message", + description: "Allows you to send a flash SMS to the destination number.", + optional: true, + }, + transliteration: { + type: "string", + label: "Transliteration", + description: "Conversion of a message text from one script to another.", + optional: true, + options: [ + "TURKISH", + "GREEK", + "CYRILLIC", + "SERBIAN_CYRILLIC", + "CENTRAL_EUROPEAN", + "BALTIC", + ], + }, + }; + + for (const [ + propName, + propDef, + ] of Object.entries(commonProps)) { + if (skipProps.has(propName)) { + console.log(`⏭️ Skipping existing prop: ${propName}`); + continue; + } + + const propLines = [ + ` ${propName}: {`, + ]; + propLines.push(` type: "${propDef.type}",`); + propLines.push(` label: "${propDef.label}",`); + propLines.push(` description: "${propDef.description}",`); + + if (propDef.optional) { + propLines.push(" optional: true,"); + } + if (propDef.options) { + propLines.push(` options: ${JSON.stringify(propDef.options)},`); + } + + propLines.push(" },"); + propDefs.push(propLines.join("\n")); + } + + return propDefs.join("\n"); +} + +/** + * Update the enhanced app file with new methods and props + */ +function updateEnhancedAppFile(content, methods, generator) { + let updatedContent = content; + + // Generate new method implementations + const newMethods = generateMethodImplementations(methods); + const methodsSection = `${CONFIG.methodsStartMarker} +${newMethods} + ${CONFIG.methodsEndMarker}`; + + // Generate new prop definitions + const newProps = generatePropDefinitions(generator); + const propsSection = `${CONFIG.propsStartMarker} +${newProps} + ${CONFIG.propsEndMarker}`; + + // Replace or add methods section + const methodsStartIndex = updatedContent.indexOf(CONFIG.methodsStartMarker); + const methodsEndIndex = updatedContent.indexOf(CONFIG.methodsEndMarker); + + if (methodsStartIndex !== -1 && methodsEndIndex !== -1) { + // Replace existing methods section + const before = updatedContent.substring(0, methodsStartIndex); + const after = updatedContent.substring(methodsEndIndex + CONFIG.methodsEndMarker.length); + updatedContent = before + methodsSection + after; + console.log("🔄 Updated existing methods section"); + } else { + // Add methods section before the closing bracket of the methods object + const methodsObjectEnd = updatedContent.lastIndexOf(" },\n};"); + if (methodsObjectEnd !== -1) { + const before = updatedContent.substring(0, methodsObjectEnd); + const after = updatedContent.substring(methodsObjectEnd); + updatedContent = before + "\n" + methodsSection + ",\n" + after; + console.log("➕ Added new methods section"); + } else { + throw new Error("Could not find methods object end to insert new methods"); + } + } + + // Replace or add props section + const propsStartIndex = updatedContent.indexOf(CONFIG.propsStartMarker); + const propsEndIndex = updatedContent.indexOf(CONFIG.propsEndMarker); + + if (propsStartIndex !== -1 && propsEndIndex !== -1) { + // Replace existing props section + const before = updatedContent.substring(0, propsStartIndex); + const after = updatedContent.substring(propsEndIndex + CONFIG.propsEndMarker.length); + updatedContent = before + propsSection + after; + console.log("🔄 Updated existing props section"); + } else { + // Add props section after the existing props + const propDefinitionsEnd = updatedContent.indexOf(" },\n methods:"); + if (propDefinitionsEnd !== -1) { + const before = updatedContent.substring(0, propDefinitionsEnd); + const after = updatedContent.substring(propDefinitionsEnd); + updatedContent = before + ",\n" + propsSection + "\n " + after; + console.log("➕ Added new props section"); + } else { + console.log("⚠️ Could not find props section location, skipping props update"); + } + } + + return updatedContent; +} + +/** + * Main function + */ +async function main() { + try { + console.log("🚀 Starting Infobip Enhanced App Update...\n"); + + // Read current enhanced app file + console.log("📖 Reading current enhanced app file..."); + const currentContent = readEnhancedAppFile(); + + // Initialize generator and fetch methods + console.log("📡 Fetching OpenAPI specification..."); + const generator = new InfobipOpenAPIGenerator(mockApp); + const { methods } = await generator.generateMethods(); + + console.log(`✅ Generated ${Object.keys(methods).length} methods from OpenAPI spec\n`); + + // Update the enhanced app file + console.log("🔧 Updating enhanced app file..."); + const updatedContent = updateEnhancedAppFile(currentContent, methods, generator); + + // Write updated file + fs.writeFileSync(CONFIG.enhancedAppFile, updatedContent); + console.log(`💾 Updated ${CONFIG.enhancedAppFile}`); + + // Summary + console.log("\n📋 Update Summary:"); + console.log("=".repeat(50)); + + const methodNames = Object.keys(methods); + console.log(`📊 Total methods: ${methodNames.length}`); + console.log(`📁 Updated file: ${CONFIG.enhancedAppFile}`); + console.log(`💾 Backup created: ${CONFIG.enhancedAppFile}${CONFIG.backupSuffix}`); + + console.log("\n🔍 Sample Generated Methods:"); + console.log("-".repeat(30)); + methodNames.slice(0, 5).forEach((name, index) => { + const method = methods[name]; + console.log(`${index + 1}. ${name}`); + console.log(` ${method.method} ${method.path}`); + if (method.operation.summary) { + console.log(` → ${method.operation.summary}`); + } + }); + + if (methodNames.length > 5) { + console.log(` ... and ${methodNames.length - 5} more methods`); + } + + console.log("\n✅ Enhanced app update completed successfully!"); + console.log("\n💡 Next steps:"); + console.log(" 1. Review the updated infobip-enhanced.app.mjs file"); + console.log(" 2. Test the new methods with your Infobip credentials"); + console.log(" 3. Run any linting/type checking if needed"); + console.log(" 4. Commit the changes when satisfied"); + + } catch (error) { + console.error("❌ Error updating enhanced app:", error.message); + console.error(error.stack); + process.exit(1); + } +} + +// Run the script +main(); diff --git a/components/infobip/infobip-enhanced.app.mjs b/components/infobip/infobip-enhanced.app.mjs new file mode 100644 index 0000000000000..cd654fcf1569b --- /dev/null +++ b/components/infobip/infobip-enhanced.app.mjs @@ -0,0 +1,190 @@ +export default { + type: "app", + app: "infobip", + propDefinitions: { + // OpenAPI Generated Props - START + bulkId: { + type: "string", + label: "Bulk ID", + description: "The ID which uniquely identifies the request for which the delivery reports are returned.", + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to retrieve. Default is 50.", + optional: true, + }, + sendAt: { + type: "string", + label: "Send At", + description: "Date and time when the message is to be sent. Used for scheduling messages.", + optional: true, + }, + validityPeriod: { + type: "integer", + label: "Validity Period", + description: "The message validity period in minutes. How long the delivery will be attempted.", + optional: true, + }, + deliveryTimeWindow: { + type: "object", + label: "Delivery Time Window", + description: "Sets specific delivery window for sending messages.", + optional: true, + }, + flash: { + type: "boolean", + label: "Flash Message", + description: "Allows you to send a flash SMS to the destination number.", + optional: true, + }, + transliteration: { + type: "string", + label: "Transliteration", + description: "Conversion of a message text from one script to another.", + optional: true, + options: [ + "TURKISH", + "GREEK", + "CYRILLIC", + "SERBIAN_CYRILLIC", + "CENTRAL_EUROPEAN", + "BALTIC", + ], + }, + // OpenAPI Generated Props - END + }, + methods: { + // OpenAPI Generated Methods - START + /** + * Send SMS message + * +* With this API method, you can do anything from sending a basic message to +* one person, all the way to sending customized messages to thousands of +* recipients in one go. It comes with a range of useful features like +* transliteration, scheduling, and tracking in a unified way. + * + * @see https://www.infobip.com/docs/sms + * @param {Object} opts - Request options + * @example + * // Example usage: + * await infobip.sendSmsMessages({ + * data: { + * messages: [{ + * from: "InfoSMS", + * to: "41793026727", + * text: "Hello world!" + * }] + * } + * }); + * @returns {Promise} API response + */ + sendSmsMessages(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/sms/3/messages", + ...opts, + }); + }, + + /** + * Get outbound SMS message delivery reports + * +* If you are for any reason unable to receive real-time delivery reports on +* your endpoint, you can use this API method to learn if and when the +* message has been delivered to the recipient. + * + * @see https://www.infobip.com/docs/sms + * @param {Object} opts - Request options + * @example + * // Example usage: + * await infobip.getOutboundSmsMessageDeliveryReports({ + * params: { + * limit: 10, + * bulkId: 'bulk-id-123' + * } + * }); + * @returns {Promise} API response + */ + getOutboundSmsMessageDeliveryReports(opts = {}) { + return this._makeRequest({ + method: "GET", + path: "/sms/1/reports", + ...opts, + }); + }, + + /** + * Reschedule SMS messages + * +* Change the date and time of already scheduled messages. To schedule a +* message, use the sendAt field when sending a message. + * + * @see https://www.infobip.com/docs/sms + * @param {Object} opts - Request options + * @example + * // Example usage: + * await infobip.rescheduleSmsMessages({ + * data: { + * sendAt: "2024-12-25T10:00:00.000+01:00" + * } + * }); + * @returns {Promise} API response + */ + rescheduleSmsMessages(opts = {}) { + return this._makeRequest({ + method: "PUT", + path: "/sms/1/bulks", + ...opts, + }); + }, + + /** + * Update scheduled SMS messages status + * +* Change the status or completely cancel sending of scheduled messages. To +* schedule a message, use the sendAt field when sending a message. + * + * @see https://www.infobip.com/docs/sms + * @param {Object} opts - Request options + * @example + * // Example usage: + * await infobip.updateScheduledSmsMessagesStatus({ + * data: { + * status: "PAUSED" + * } + * }); + * @returns {Promise} API response + */ + updateScheduledSmsMessagesStatus(opts = {}) { + return this._makeRequest({ + method: "PUT", + path: "/sms/1/bulks/status", + ...opts, + }); + }, + + /** + * Confirm conversion + * +* Use this endpoint to inform the Infobip platform about the successful +* conversion on your side. Infobip will use this information to monitor SMS +* performance and provide you with better service. + * @param {Object} opts - Request options + * @example + * // Example usage: + * await infobip.logEndTag({ messageId: "example-messageId", ...otherOptions }); + * @returns {Promise} API response + */ + logEndTag({ + messageId, ...opts + } = {}) { + return this._makeRequest({ + method: "POST", + path: `/ct/1/log/end/${messageId}`, + ...opts, + }); + }, + // OpenAPI Generated Methods - END + }, +}; diff --git a/components/infobip/lib/openapi-generator.mjs b/components/infobip/lib/openapi-generator.mjs new file mode 100644 index 0000000000000..40b8799f49872 --- /dev/null +++ b/components/infobip/lib/openapi-generator.mjs @@ -0,0 +1,88 @@ +// Enhanced OpenAPI generator for Infobip API +export default class InfobipOpenAPIGenerator { + constructor(app) { + this.app = app; + } + + async generateMethods() { + // Return sample methods for testing enhanced JSDoc generation + const methods = { + sendSmsMessages: { + path: "/sms/3/messages", + method: "POST", + operation: { + summary: "Send SMS message", + description: "With this API method, you can do anything from sending a basic message to one person, all the way to sending customized messages to thousands of recipients in one go. It comes with a range of useful features like transliteration, scheduling, and tracking in a unified way.", + externalDocs: { + url: "https://www.infobip.com/docs/sms", + }, + }, + }, + getOutboundSmsMessageDeliveryReports: { + path: "/sms/1/reports", + method: "GET", + operation: { + summary: "Get outbound SMS message delivery reports", + description: "If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has been delivered to the recipient.", + externalDocs: { + url: "https://www.infobip.com/docs/sms", + }, + }, + }, + rescheduleSmsMessages: { + path: "/sms/1/bulks", + method: "PUT", + operation: { + summary: "Reschedule SMS messages", + description: "Change the date and time of already scheduled messages. To schedule a message, use the sendAt field when sending a message.", + externalDocs: { + url: "https://www.infobip.com/docs/sms", + }, + }, + }, + updateScheduledSmsMessagesStatus: { + path: "/sms/1/bulks/status", + method: "PUT", + operation: { + summary: "Update scheduled SMS messages status", + description: "Change the status or completely cancel sending of scheduled messages. To schedule a message, use the sendAt field when sending a message.", + externalDocs: { + url: "https://www.infobip.com/docs/sms", + }, + }, + }, + logEndTag: { + path: "/ct/1/log/end/{messageId}", + method: "POST", + operation: { + summary: "Confirm conversion", + description: "Use this endpoint to inform the Infobip platform about the successful conversion on your side. Infobip will use this information to monitor SMS performance and provide you with better service.", + }, + }, + }; + + return { + methods, + }; + } + + async generateAllActions() { + // Return minimal test data for testing the action generation + return [ + { + actionKey: "infobip-send-test-sms", + actionName: "Send Test SMS", + methodName: "sendSms", + path: "/sms/2/text/advanced", + method: "POST", + operation: { + summary: "Send Test SMS", + description: "Test SMS sending action for validation", + externalDocs: { + url: "https://www.infobip.com/docs/sms", + }, + }, + }, + ]; + } +} diff --git a/components/infobip/package.json b/components/infobip/package.json index 99b7557839902..5f6c98ec34b75 100644 --- a/components/infobip/package.json +++ b/components/infobip/package.json @@ -12,6 +12,10 @@ "publishConfig": { "access": "public" }, + "scripts": { + "generate-actions": "node generate-actions.mjs", + "generate-infobip-app": "node generate-infobip-app.mjs" + }, "dependencies": { "@pipedream/platform": "^1.6.2" } From 6c012953ac4211e6abd280da042926b52bc83ab0 Mon Sep 17 00:00:00 2001 From: Xaiid Date: Thu, 18 Sep 2025 13:33:18 +0200 Subject: [PATCH 2/3] Added actions generated by scripts --- .../get-inbound-sms-messages.mjs | 24 ++++++++++++++ ...tbound-sms-message-delivery-reports-v3.mjs | 24 ++++++++++++++ ...-outbound-sms-message-delivery-reports.mjs | 24 ++++++++++++++ .../get-outbound-sms-message-logs-v3.mjs | 24 ++++++++++++++ .../get-outbound-sms-message-logs.mjs | 24 ++++++++++++++ .../get-scheduled-sms-messages-status.mjs | 24 ++++++++++++++ .../get-scheduled-sms-messages.mjs | 24 ++++++++++++++ .../actions/log-end-tag/log-end-tag.mjs | 24 ++++++++++++++ .../reschedule-sms-messages.mjs | 24 ++++++++++++++ .../send-binary-sms-message.mjs | 24 ++++++++++++++ ...send-sms-message-over-query-parameters.mjs | 32 +++++++++++++++++++ .../send-sms-message/send-sms-message.mjs | 24 ++++++++++++++ ...end-sms-messages-over-query-parameters.mjs | 32 +++++++++++++++++++ .../send-sms-messages/send-sms-messages.mjs | 24 ++++++++++++++ .../update-scheduled-sms-messages-status.mjs | 24 ++++++++++++++ 15 files changed, 376 insertions(+) create mode 100644 components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs create mode 100644 components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs create mode 100644 components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs create mode 100644 components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs create mode 100644 components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs create mode 100644 components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs create mode 100644 components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs create mode 100644 components/infobip/actions/log-end-tag/log-end-tag.mjs create mode 100644 components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs create mode 100644 components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs create mode 100644 components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs create mode 100644 components/infobip/actions/send-sms-message/send-sms-message.mjs create mode 100644 components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs create mode 100644 components/infobip/actions/send-sms-messages/send-sms-messages.mjs create mode 100644 components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs diff --git a/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs b/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs new file mode 100644 index 0000000000000..d0b71a67b6694 --- /dev/null +++ b/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-inbound-sms-messages", + name: "Get Inbound SMS Messages", + description: + "Get inbound SMS messages If you are unable to receive incoming SMS to the endpoint of your choice in real-time, you can use this API call to fetch messages. Each request will return a batch of rece... [See the documentation](https://www.infobip.com/docs/api)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getInboundSmsMessages({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs b/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs new file mode 100644 index 0000000000000..2639f09304890 --- /dev/null +++ b/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-outbound-sms-message-delivery-reports-v3", + name: "Get Outbound SMS Message Delivery Reports V3", + description: + "Get outbound SMS message delivery reports If you are unable to receive real-time message delivery reports towards your endpoint for various reasons, we offer you an API method to fetch batches of m... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getOutboundSmsMessageDeliveryReportsV3({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs b/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs new file mode 100644 index 0000000000000..21fb01662ef8f --- /dev/null +++ b/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-outbound-sms-message-delivery-reports", + name: "Get Outbound SMS Message Delivery Reports", + description: + "Get outbound SMS message delivery reports If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has b... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getOutboundSmsMessageDeliveryReports({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs b/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs new file mode 100644 index 0000000000000..8b2a773d2a81a --- /dev/null +++ b/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-outbound-sms-message-logs-v3", + name: "Get Outbound SMS Message Logs V3", + description: + "Get outbound SMS message logs Use this method to obtain the logs associated with outbound messages. The available logs are limited to those generated in the last 48 hours, and you can retrieve a ma... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getOutboundSmsMessageLogsV3({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs b/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs new file mode 100644 index 0000000000000..1c738638fcf6e --- /dev/null +++ b/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-outbound-sms-message-logs", + name: "Get Outbound SMS Message Logs", + description: + "Get outbound SMS message logs Use this method for displaying logs for example in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per ... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getOutboundSmsMessageLogs({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs b/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs new file mode 100644 index 0000000000000..5b57daeea190d --- /dev/null +++ b/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-scheduled-sms-messages-status", + name: "Get Scheduled SMS Messages Status", + description: + "Get scheduled SMS messages status See the status of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a m... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getScheduledSmsMessagesStatus({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs b/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs new file mode 100644 index 0000000000000..033881b455328 --- /dev/null +++ b/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-get-scheduled-sms-messages", + name: "Get Scheduled SMS Messages", + description: + "Get scheduled SMS messages See all [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms) and their scheduled date and time. To schedule a message, use the `sendAt` field ... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.getScheduledSmsMessages({ $ }); + + $.export( + "$summary", + `Data retrieved successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/log-end-tag/log-end-tag.mjs b/components/infobip/actions/log-end-tag/log-end-tag.mjs new file mode 100644 index 0000000000000..e89ee06f1c58d --- /dev/null +++ b/components/infobip/actions/log-end-tag/log-end-tag.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-log-end-tag", + name: "Confirm Conversion (Log End Tag)", + description: + "Confirm conversion Use this endpoint to inform the Infobip platform about the successful conversion on your side. Infobip will use this information to monitor SMS performance and provide you with b... [See the documentation](https://www.infobip.com/docs/api)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.logEndTag({ $ }); + + $.export( + "$summary", + `Conversion logged successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs b/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs new file mode 100644 index 0000000000000..712df5a01dfbc --- /dev/null +++ b/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-reschedule-sms-messages", + name: "Reschedule SMS Messages", + description: + "Reschedule SMS messages Change the date and time of already [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sen... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.rescheduleSmsMessages({ $ }); + + $.export( + "$summary", + `Update completed successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs b/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs new file mode 100644 index 0000000000000..e1c41a51e581a --- /dev/null +++ b/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-send-binary-sms-message", + name: "Send Binary SMS Message", + description: + "Send binary SMS message Send single or multiple binary messages to one or more destination address. The API response will not contain the final delivery status, use [Delivery Reports](https://www.i... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.sendBinarySmsMessage({ $ }); + + $.export( + "$summary", + `Message sent successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs b/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs new file mode 100644 index 0000000000000..22231245a6d6c --- /dev/null +++ b/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs @@ -0,0 +1,32 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-send-sms-message-over-query-parameters", + name: "Send SMS Message Over Query Parameters", + description: + "Send SMS message over query parameters All message parameters of the message can be defined in the query string. Use this method only if [Send SMS message](#channels/sms/send-sms-message) is not an... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip, + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], + optional: true, + } + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.sendSmsMessageOverQueryParameters({ $ }); + + $.export( + "$summary", + `Message sent successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/send-sms-message/send-sms-message.mjs b/components/infobip/actions/send-sms-message/send-sms-message.mjs new file mode 100644 index 0000000000000..03566e77d6c31 --- /dev/null +++ b/components/infobip/actions/send-sms-message/send-sms-message.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-send-sms-message", + name: "Send SMS Message V2", + description: + "Send SMS message Use this endpoint to send an SMS and set up a rich set of features, such as batch sending with a single API request, scheduling, URL tracking, language and transliteration configur... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.sendSmsMessage({ $ }); + + $.export( + "$summary", + `Message sent successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs b/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs new file mode 100644 index 0000000000000..3ebfae0621ce6 --- /dev/null +++ b/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs @@ -0,0 +1,32 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-send-sms-messages-over-query-parameters", + name: "Send SMS Messages Over Query Parameters", + description: + "Send SMS message over query parameters All message parameters of the message can be defined in the query string. Use this method only if [Send SMS message](#channels/sms/send-sms-messages) is not a... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip, + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], + optional: true, + } + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.sendSmsMessagesOverQueryParameters({ $ }); + + $.export( + "$summary", + `Message sent successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/send-sms-messages/send-sms-messages.mjs b/components/infobip/actions/send-sms-messages/send-sms-messages.mjs new file mode 100644 index 0000000000000..e971748ecf7dd --- /dev/null +++ b/components/infobip/actions/send-sms-messages/send-sms-messages.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-send-sms-messages", + name: "Send SMS message", + description: + "Send SMS message With this API method, you can do anything from sending a basic message to one person, all the way to sending customized messages to thousands of recipients in one go. It comes with... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.sendSmsMessages({ $ }); + + $.export( + "$summary", + `Message sent successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; diff --git a/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs b/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs new file mode 100644 index 0000000000000..8dccd0bb0eab6 --- /dev/null +++ b/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs @@ -0,0 +1,24 @@ +import infobip from "../../infobip-enhanced.app.mjs"; + +export default { + key: "infobip-update-scheduled-sms-messages-status", + name: "Update Scheduled SMS Messages Status", + description: + "Update scheduled SMS messages status Change the status or completely cancel sending of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use t... [See the documentation](https://www.infobip.com/docs/sms)", + version: "0.0.1", + type: "action", + props: { + infobip + }, + async run({ $ }) { + const { infobip, ...params } = this; + + const response = await infobip.updateScheduledSmsMessagesStatus({ $ }); + + $.export( + "$summary", + `Update completed successfully: ${response.status?.description || "Success"}` + ); + return response; + }, +}; From 7ce03cf3ebab50fe1d6eae8b81524d6787a21832 Mon Sep 17 00:00:00 2001 From: Xaiid Date: Thu, 18 Sep 2025 13:32:52 +0200 Subject: [PATCH 3/3] Added scripts to generate actions --- components/infobip/README.md | 97 +- .../get-inbound-sms-messages.mjs | 49 +- ...tbound-sms-message-delivery-reports-v3.mjs | 63 +- ...-outbound-sms-message-delivery-reports.mjs | 63 +- .../get-outbound-sms-message-logs-v3.mjs | 126 +- .../get-outbound-sms-message-logs.mjs | 112 +- .../get-scheduled-sms-messages-status.mjs | 28 +- .../get-scheduled-sms-messages.mjs | 28 +- .../actions/log-end-tag/log-end-tag.mjs | 17 +- .../reschedule-sms-messages.mjs | 28 +- .../send-binary-sms-message.mjs | 44 +- ...send-sms-message-over-query-parameters.mjs | 187 +- .../send-sms-message/send-sms-message.mjs | 44 +- ...end-sms-messages-over-query-parameters.mjs | 180 +- .../send-sms-messages/send-sms-messages.mjs | 44 +- .../infobip/actions/send-sms/send-sms.mjs | 84 - .../send-viber-text-message.mjs | 53 - .../send-whatsapp-text-message.mjs | 58 - .../update-scheduled-sms-messages-status.mjs | 28 +- components/infobip/generate-actions.mjs | 1154 ++- components/infobip/generate-app.mjs | 425 + components/infobip/generate-infobip-app.mjs | 470 -- components/infobip/infobip-enhanced.app.mjs | 190 - components/infobip/infobip.app.mjs | 597 +- components/infobip/openapi-spec.json | 7381 +++++++++++++++++ components/infobip/package.json | 4 +- 26 files changed, 10213 insertions(+), 1341 deletions(-) delete mode 100644 components/infobip/actions/send-sms/send-sms.mjs delete mode 100644 components/infobip/actions/send-viber-text-message/send-viber-text-message.mjs delete mode 100644 components/infobip/actions/send-whatsapp-text-message/send-whatsapp-text-message.mjs create mode 100644 components/infobip/generate-app.mjs delete mode 100644 components/infobip/generate-infobip-app.mjs delete mode 100644 components/infobip/infobip-enhanced.app.mjs create mode 100644 components/infobip/openapi-spec.json diff --git a/components/infobip/README.md b/components/infobip/README.md index 64c17fa54824e..5513333822fa0 100644 --- a/components/infobip/README.md +++ b/components/infobip/README.md @@ -1,11 +1,96 @@ -# Overview +# Enhanced Infobip App -The Infobip API is a communication platform that enables seamless integration of messaging, voice, and email functionalities into various applications. With Infobip, you can automate notifications, authenticate users via one-time passwords, engage customers across multiple channels, and track communication performance. Pipedream's serverless execution environment lets you create sophisticated workflows that harness the capabilities of Infobip by triggering actions based on events, manipulating data, and connecting with numerous other apps. +Auto-generated Infobip SMS components using the official OpenAPI specification. -# Example Use Cases +## Features -- **Customer Support Automation**: When a new ticket is created in Zendesk, use Infobip to send an SMS confirmation to the customer. Automatically escalate unresolved issues by triggering a voice call after a set period, enhancing customer experience and response times. +- **Auto-Generated Methods**: All SMS API methods from OpenAPI spec +- **Always Up-to-Date**: Methods stay current with latest Infobip API +- **Backward Compatible**: Existing manual methods still work +- **Type-Safe**: JSDoc comments from OpenAPI descriptions -- **Multi-channel Marketing Campaigns**: Trigger an Infobip workflow from a Shopify order event. Send personalized SMS messages for order confirmations, then follow up with email campaigns for related products, feedback requests, or loyalty program invites, all orchestrated within Pipedream. +## Quick Start -- **Two-factor Authentication (2FA)**: Implement 2FA by integrating Infobip with a custom authentication system. Generate and send one-time passwords via SMS when a user attempts to log in, and verify the tokens within Pipedream workflows to enhance security across your application. +### Send SMS (v3 - Recommended) +```javascript +const response = await this.infobip.sendSmsMessage({ + data: { + messages: [{ + sender: "TestSender", + destinations: [{ to: "+1234567890" }], + content: { text: "Hello World" } + }] + } +}); +``` + +### Legacy Method (Still Works) +```javascript +const response = await this.infobip.sendSms({ + data: { + messages: [{ + destinations: [{ to: "+1234567890" }], + from: "TestSender", + text: "Hello World" + }] + } +}); +``` + +## Available Scripts + +Run these npm scripts for development: + +```bash +# Generate enhanced app with OpenAPI methods +npm run generate-infobip-enhanced-app + +# Generate action components from OpenAPI spec +npm run generate-infobip-actions +``` + +## Auto-Generated Methods + +Key methods available from OpenAPI: + +- `sendSmsMessages` - Send SMS (v3 API) +- `getSmsDeliveryReports` - Get delivery reports +- `getSmsLogs` - Get SMS logs +- `getScheduledSmsMessages` - Get scheduled messages +- `previewSms` - Preview SMS before sending +- `getInboundSmsMessages` - Get inbound messages + +## Advanced Usage + +### List All Methods +```javascript +const methods = await this.infobip.getOpenAPIMethods(); +console.log('Available methods:', methods); +``` + +### Dynamic Method Calling +```javascript +const reports = await this.infobip.callOpenAPIMethod('getSmsDeliveryReports', { + params: { messageId: 'your-message-id' } +}); +``` + +### Debug OpenAPI Spec +```javascript +const spec = await this.infobip.debugOpenAPISpec(); +console.log('OpenAPI version:', spec.info.version); +``` + +## Troubleshooting + +**OpenAPI Fetch Issues**: If spec fails to load, fallback manual methods still work. + +**Method Not Found**: +```javascript +const methods = await this.infobip.debugAvailableMethods(); +``` + +## References + +- [Infobip OpenAPI Spec](https://api.infobip.com/platform/1/openapi/sms) +- [Infobip SMS Docs](https://www.infobip.com/docs/sms) \ No newline at end of file diff --git a/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs b/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs index d0b71a67b6694..ad63159e35dc9 100644 --- a/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs +++ b/components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs @@ -1,19 +1,58 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-inbound-sms-messages", + key: "get-inbound-sms-messages", name: "Get Inbound SMS Messages", description: "Get inbound SMS messages If you are unable to receive incoming SMS to the endpoint of your choice in real-time, you can use this API call to fetch messages. Each request will return a batch of rece... [See the documentation](https://www.infobip.com/docs/api)", version: "0.0.1", type: "action", props: { - infobip + infobip, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to be returned in a response. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access messages for the last 48h.", + optional: true, + }, + applicationId: { + type: "string", + label: "Application Id", + description: "Application id that the message is linked to. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + entityId: { + type: "string", + label: "Entity Id", + description: "Entity id that the message is linked to. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + campaignReferenceId: { + type: "string", + label: "Campaign Reference Id", + description: "ID of a campaign that was sent in the message.", + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, limit, applicationId, entityId, campaignReferenceId, ...params } = this; - const response = await infobip.getInboundSmsMessages({ $ }); + const pathQuery = []; + if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() }); + if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() }); + if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() }); + if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getInboundSmsMessages({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs b/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs index 2639f09304890..c26131d89a0fd 100644 --- a/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs +++ b/components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs @@ -1,19 +1,72 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-outbound-sms-message-delivery-reports-v3", + key: "get-outbound-sms-message-delivery-reports-v3", name: "Get Outbound SMS Message Delivery Reports V3", description: "Get outbound SMS message delivery reports If you are unable to receive real-time message delivery reports towards your endpoint for various reasons, we offer you an API method to fetch batches of m... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.", + optional: true, + }, + messageId: { + type: "string", + label: "Message Id", + description: "The ID that uniquely identifies the message sent.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access reports for the last 48h", + optional: true, + }, + entityId: { + type: "string", + label: "Entity Id", + description: "Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + applicationId: { + type: "string", + label: "Application Id", + description: "Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + campaignReferenceId: { + type: "string", + label: "Campaign Reference Id", + description: "ID of a campaign that was sent in the message.", + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, messageId, limit, entityId, applicationId, campaignReferenceId, ...params } = this; - const response = await infobip.getOutboundSmsMessageDeliveryReportsV3({ $ }); + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + if (messageId !== undefined && messageId !== null) pathQuery.push({ name: "messageId", value: messageId.toString() }); + if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() }); + if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() }); + if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() }); + if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getOutboundSmsMessageDeliveryReportsV3({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs b/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs index 21fb01662ef8f..28cba4f73e989 100644 --- a/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs +++ b/components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs @@ -1,19 +1,72 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-outbound-sms-message-delivery-reports", + key: "get-outbound-sms-message-delivery-reports", name: "Get Outbound SMS Message Delivery Reports", description: "Get outbound SMS message delivery reports If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has b... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + optional: true, + }, + messageId: { + type: "string", + label: "Message Id", + description: "Unique message ID for which a report is requested.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access reports for the last 48h.", + optional: true, + }, + applicationId: { + type: "string", + label: "Application Id", + description: "Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + entityId: { + type: "string", + label: "Entity Id", + description: "Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + campaignReferenceId: { + type: "string", + label: "Campaign Reference Id", + description: "ID of a campaign that was sent in the message.", + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, messageId, limit, applicationId, entityId, campaignReferenceId, ...params } = this; - const response = await infobip.getOutboundSmsMessageDeliveryReports({ $ }); + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + if (messageId !== undefined && messageId !== null) pathQuery.push({ name: "messageId", value: messageId.toString() }); + if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() }); + if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() }); + if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() }); + if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getOutboundSmsMessageDeliveryReports({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs b/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs index 8b2a773d2a81a..68410677d2b29 100644 --- a/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs +++ b/components/infobip/actions/get-outbound-sms-message-logs-v3/get-outbound-sms-message-logs-v3.mjs @@ -1,19 +1,135 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-outbound-sms-message-logs-v3", + key: "get-outbound-sms-message-logs-v3", name: "Get Outbound SMS Message Logs V3", description: "Get outbound SMS message logs Use this method to obtain the logs associated with outbound messages. The available logs are limited to those generated in the last 48 hours, and you can retrieve a ma... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + mcc: { + type: "string", + label: "Mcc", + description: "Mobile Country Code.", + optional: true, + }, + mnc: { + type: "string", + label: "Mnc", + description: "Mobile Network Code. Mobile Country Code is required if this property is used.", + optional: true, + }, + sender: { + type: "string", + label: "Sender", + description: "The sender ID which can be alphanumeric or numeric.", + optional: true, + }, + destination: { + type: "string", + label: "Destination", + description: "Message destination address.", + optional: true, + }, + bulkId: { + type: "string", + label: "Bulk Id", + description: "Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. May contain multiple comma-separated values. Maximum length 2048 characters.", + optional: true, + }, + messageId: { + type: "string", + label: "Message Id", + description: "Unique message ID for which a log is requested. May contain multiple comma-separated values. Maximum length 2048 characters.", + optional: true, + }, + generalStatus: { + type: "string", + label: "General Status", + description: "generalStatus parameter", + optional: true, + }, + sentSince: { + type: "string", + label: "Sent Since", + description: "The logs will only include messages sent after this date. Use it alongside sentUntil to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.", + optional: true, + }, + sentUntil: { + type: "string", + label: "Sent Until", + description: "The logs will only include messages sent before this date. Use it alongside sentSince to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access logs for the last 48h.", + optional: true, + }, + entityId: { + type: "string", + label: "Entity Id", + description: "Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + applicationId: { + type: "string", + label: "Application Id", + description: "Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + campaignReferenceId: { + type: "string", + label: "Campaign Reference Id", + description: "ID of a campaign that was sent in the message. May contain multiple comma-separated values.", + optional: true, + }, + useCursor: { + type: "boolean", + label: "Use Cursor", + description: "Flag used to enable cursor-based pagination. When set to true, the system will use the cursor to fetch the next set of logs.", + optional: true, + }, + cursor: { + type: "string", + label: "Cursor", + description: "Value which represents the current position in the data set. For the first request, this field shouldn't be defined. In subsequent requests, use the `nextCursor` value returned from the previous response to continue fetching data.", + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, mcc, mnc, sender, destination, bulkId, messageId, generalStatus, sentSince, sentUntil, limit, entityId, applicationId, campaignReferenceId, useCursor, cursor, ...params } = this; - const response = await infobip.getOutboundSmsMessageLogsV3({ $ }); + const pathQuery = []; + if (mcc !== undefined && mcc !== null) pathQuery.push({ name: "mcc", value: mcc.toString() }); + if (mnc !== undefined && mnc !== null) pathQuery.push({ name: "mnc", value: mnc.toString() }); + if (sender !== undefined && sender !== null) pathQuery.push({ name: "sender", value: sender.toString() }); + if (destination !== undefined && destination !== null) pathQuery.push({ name: "destination", value: destination.toString() }); + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + if (messageId !== undefined && messageId !== null) pathQuery.push({ name: "messageId", value: messageId.toString() }); + if (generalStatus !== undefined && generalStatus !== null) pathQuery.push({ name: "generalStatus", value: generalStatus.toString() }); + if (sentSince !== undefined && sentSince !== null) pathQuery.push({ name: "sentSince", value: sentSince.toString() }); + if (sentUntil !== undefined && sentUntil !== null) pathQuery.push({ name: "sentUntil", value: sentUntil.toString() }); + if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() }); + if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() }); + if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() }); + if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() }); + if (useCursor !== undefined && useCursor !== null) pathQuery.push({ name: "useCursor", value: useCursor.toString() }); + if (cursor !== undefined && cursor !== null) pathQuery.push({ name: "cursor", value: cursor.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getOutboundSmsMessageLogsV3({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs b/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs index 1c738638fcf6e..9a430c68b5e6e 100644 --- a/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs +++ b/components/infobip/actions/get-outbound-sms-message-logs/get-outbound-sms-message-logs.mjs @@ -1,19 +1,121 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-outbound-sms-message-logs", + key: "get-outbound-sms-message-logs", name: "Get Outbound SMS Message Logs", description: "Get outbound SMS message logs Use this method for displaying logs for example in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per ... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + from: { + type: "string", + label: "From", + description: "The sender ID which can be alphanumeric or numeric.", + optional: true, + }, + to: { + type: "string", + label: "To", + description: "Message destination address.", + optional: true, + }, + bulkId: { + type: "string", + label: "Bulk Id", + description: "Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. May contain multiple comma-separated values. Maximum length 2048 characters.", + optional: true, + }, + messageId: { + type: "string", + label: "Message Id", + description: "Unique message ID for which a log is requested. May contain multiple comma-separated values. Maximum length 2048 characters.", + optional: true, + }, + generalStatus: { + type: "string", + label: "General Status", + description: "Sent [message status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes).", + optional: true, + }, + sentSince: { + type: "string", + label: "Sent Since", + description: "The logs will only include messages sent after this date. Use it alongside `sentUntil` to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.", + optional: true, + }, + sentUntil: { + type: "string", + label: "Sent Until", + description: "The logs will only include messages sent before this date. Use it alongside `sentSince` to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access logs for the last 48h.", + optional: true, + }, + mcc: { + type: "string", + label: "Mcc", + description: "Mobile Country Code.", + optional: true, + }, + mnc: { + type: "string", + label: "Mnc", + description: "Mobile Network Code. Mobile Country Code is required if this property is used. ", + optional: true, + }, + applicationId: { + type: "string", + label: "Application Id", + description: "Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + entityId: { + type: "string", + label: "Entity Id", + description: "Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + optional: true, + }, + campaignReferenceId: { + type: "string", + label: "Campaign Reference Id", + description: "ID of a campaign that was sent in the message. May contain multiple comma-separated values.", + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, from, to, bulkId, messageId, generalStatus, sentSince, sentUntil, limit, mcc, mnc, applicationId, entityId, campaignReferenceId, ...params } = this; - const response = await infobip.getOutboundSmsMessageLogs({ $ }); + const pathQuery = []; + if (from !== undefined && from !== null) pathQuery.push({ name: "from", value: from.toString() }); + if (to !== undefined && to !== null) pathQuery.push({ name: "to", value: to.toString() }); + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + if (messageId !== undefined && messageId !== null) pathQuery.push({ name: "messageId", value: messageId.toString() }); + if (generalStatus !== undefined && generalStatus !== null) pathQuery.push({ name: "generalStatus", value: generalStatus.toString() }); + if (sentSince !== undefined && sentSince !== null) pathQuery.push({ name: "sentSince", value: sentSince.toString() }); + if (sentUntil !== undefined && sentUntil !== null) pathQuery.push({ name: "sentUntil", value: sentUntil.toString() }); + if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() }); + if (mcc !== undefined && mcc !== null) pathQuery.push({ name: "mcc", value: mcc.toString() }); + if (mnc !== undefined && mnc !== null) pathQuery.push({ name: "mnc", value: mnc.toString() }); + if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() }); + if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() }); + if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getOutboundSmsMessageLogs({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs b/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs index 5b57daeea190d..355b6959e8eee 100644 --- a/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs +++ b/components/infobip/actions/get-scheduled-sms-messages-status/get-scheduled-sms-messages-status.mjs @@ -1,19 +1,37 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-scheduled-sms-messages-status", + key: "get-scheduled-sms-messages-status", name: "Get Scheduled SMS Messages Status", description: "Get scheduled SMS messages status See the status of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a m... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "bulkId parameter", + optional: false, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, ...params } = this; - const response = await infobip.getScheduledSmsMessagesStatus({ $ }); + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getScheduledSmsMessagesStatus({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs b/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs index 033881b455328..15f76370848e1 100644 --- a/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs +++ b/components/infobip/actions/get-scheduled-sms-messages/get-scheduled-sms-messages.mjs @@ -1,19 +1,37 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-get-scheduled-sms-messages", + key: "get-scheduled-sms-messages", name: "Get Scheduled SMS Messages", description: "Get scheduled SMS messages See all [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms) and their scheduled date and time. To schedule a message, use the `sendAt` field ... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "bulkId parameter", + optional: false, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, ...params } = this; - const response = await infobip.getScheduledSmsMessages({ $ }); + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.getScheduledSmsMessages({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/log-end-tag/log-end-tag.mjs b/components/infobip/actions/log-end-tag/log-end-tag.mjs index e89ee06f1c58d..cc0666bc3750f 100644 --- a/components/infobip/actions/log-end-tag/log-end-tag.mjs +++ b/components/infobip/actions/log-end-tag/log-end-tag.mjs @@ -1,19 +1,26 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-log-end-tag", + key: "log-end-tag", name: "Confirm Conversion (Log End Tag)", description: "Confirm conversion Use this endpoint to inform the Infobip platform about the successful conversion on your side. Infobip will use this information to monitor SMS performance and provide you with b... [See the documentation](https://www.infobip.com/docs/api)", version: "0.0.1", type: "action", props: { - infobip + infobip, + messageId: { + propDefinition: [infobip, "messageId"], + optional: false, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, messageId, ...params } = this; - const response = await infobip.logEndTag({ $ }); + const response = await infobip.logEndTag({ + $, + pathParams: [{ name: "messageId", value: messageId }], + }); $.export( "$summary", diff --git a/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs b/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs index 712df5a01dfbc..d0649eea4c718 100644 --- a/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs +++ b/components/infobip/actions/reschedule-sms-messages/reschedule-sms-messages.mjs @@ -1,19 +1,37 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-reschedule-sms-messages", + key: "reschedule-sms-messages", name: "Reschedule SMS Messages", description: "Reschedule SMS messages Change the date and time of already [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sen... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "bulkId parameter", + optional: false, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, ...params } = this; - const response = await infobip.rescheduleSmsMessages({ $ }); + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.rescheduleSmsMessages({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs b/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs index e1c41a51e581a..8e9f7f86b971c 100644 --- a/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs +++ b/components/infobip/actions/send-binary-sms-message/send-binary-sms-message.mjs @@ -1,19 +1,53 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-send-binary-sms-message", + key: "send-binary-sms-message", name: "Send Binary SMS Message", description: "Send binary SMS message Send single or multiple binary messages to one or more destination address. The API response will not contain the final delivery status, use [Delivery Reports](https://www.i... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + phoneNumber: { + propDefinition: [infobip, "phoneNumber"], + optional: false, + }, + text: { + propDefinition: [infobip, "text"], + optional: false, + }, + from: { + propDefinition: [infobip, "from"], + optional: true, + }, + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, phoneNumber, text, from, applicationId, entityId, ...params } = this; - const response = await infobip.sendBinarySmsMessage({ $ }); + const response = await infobip.sendBinarySmsMessage({ + $, + data: { + messages: [ + { + destinations: [{ to: phoneNumber }], + ...(from && { from }), + text, + ...(applicationId && { applicationId }), + ...(entityId && { entityId }), + }, + ], + ...params, + }, + }); $.export( "$summary", diff --git a/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs b/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs index 22231245a6d6c..71a8b8fbb0c38 100644 --- a/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs +++ b/components/infobip/actions/send-sms-message-over-query-parameters/send-sms-message-over-query-parameters.mjs @@ -1,7 +1,7 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-send-sms-message-over-query-parameters", + key: "send-sms-message-over-query-parameters", name: "Send SMS Message Over Query Parameters", description: "Send SMS message over query parameters All message parameters of the message can be defined in the query string. Use this method only if [Send SMS message](#channels/sms/send-sms-message) is not an... [See the documentation](https://www.infobip.com/docs/sms)", @@ -9,6 +9,150 @@ export default { type: "action", props: { infobip, + username: { + type: "string", + label: "Username", + description: "Username for authentication.", + optional: false, + }, + password: { + type: "string", + label: "Password", + description: "Password for authentication.", + optional: false, + }, + bulkId: { + type: "string", + label: "Bulk Id", + description: "Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Anything above 100 characters passed in the request will be clipped during processing and returned in response, reports and logs.", + optional: true, + }, + from: { + type: "string", + label: "From", + description: "The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`).", + optional: true, + }, + to: { + type: "string", + label: "To", + description: "List of message recipients.", + optional: false, + }, + text: { + type: "string", + label: "Text", + description: "Content of the message being sent.", + optional: true, + }, + flash: { + type: "boolean", + label: "Flash", + description: "Sends a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) if set to true.", + optional: true, + }, + transliteration: { + type: "string", + label: "Transliteration", + description: "Conversion of a message text from one script to another.", + optional: true, + }, + languageCode: { + type: "string", + label: "Language Code", + description: "Code for language character set of a message content.", + optional: true, + }, + intermediateReport: { + type: "boolean", + label: "Intermediate Report", + description: "Use a [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) that will be sent on your callback server.", + optional: true, + }, + notifyUrl: { + type: "string", + label: "Notify Url", + description: "The URL on your call back server on to which a delivery report will be sent.", + optional: true, + }, + notifyContentType: { + type: "string", + label: "Notify Content Type", + description: "Preferred delivery report content type, `application/json` or `application/xml`.", + optional: true, + }, + callbackData: { + type: "string", + label: "Callback Data", + description: "Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters.", + optional: true, + }, + validityPeriod: { + type: "integer", + label: "Validity Period", + description: "The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`.", + optional: true, + }, + sendAt: { + type: "string", + label: "Send At", + description: "Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. Must be sooner than 180 days from now.", + optional: true, + }, + track: { + type: "string", + label: "Track", + description: "Sets the conversion element to be tracked. Possible values: `SMS` and `URL`. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion).", + optional: true, + }, + processKey: { + type: "string", + label: "Process Key", + description: "The process key which uniquely identifies conversion tracking.", + optional: true, + }, + trackingType: { + type: "string", + label: "Tracking Type", + description: "Sets a custom conversion type naming convention, e.g. ONE_TIME_PIN, SOCIAL_INVITES, etc.", + optional: true, + }, + indiaDltContentTemplateId: { + type: "string", + label: "India Dlt Content Template Id", + description: "The ID of your registered DLT (Distributed Ledger Technology) content template.", + optional: true, + }, + indiaDltPrincipalEntityId: { + type: "string", + label: "India Dlt Principal Entity Id", + description: "Your DLT (Distributed Ledger Technology) entity id.", + optional: true, + }, + indiaDltTelemarketerId: { + type: "string", + label: "India Dlt Telemarketer Id", + description: "Your assigned Telemarketer ID. (required for Aggregators)", + optional: true, + }, + turkeyIysBrandCode: { + type: "integer", + label: "Turkey Iys Brand Code", + description: "Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account.", + optional: true, + }, + turkeyIysRecipientType: { + type: "string", + label: "Turkey Iys Recipient Type", + description: "Recipient Type must be TACIR or BIREYSEL", + optional: true, + }, + southKoreaResellerCode: { + type: "integer", + label: "South Korea Reseller Code", + description: "Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending.", + optional: true, + }, applicationId: { propDefinition: [infobip, "applicationId"], optional: true, @@ -19,9 +163,44 @@ export default { } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, username, password, bulkId, from, to, text, flash, transliteration, languageCode, intermediateReport, notifyUrl, notifyContentType, callbackData, validityPeriod, sendAt, track, processKey, trackingType, indiaDltContentTemplateId, indiaDltPrincipalEntityId, indiaDltTelemarketerId, turkeyIysBrandCode, turkeyIysRecipientType, southKoreaResellerCode, ...params } = this; + + const pathQuery = []; + if (username !== undefined && username !== null) pathQuery.push({ name: "username", value: username.toString() }); + if (password !== undefined && password !== null) pathQuery.push({ name: "password", value: password.toString() }); + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + if (from !== undefined && from !== null) pathQuery.push({ name: "from", value: from.toString() }); + if (to !== undefined && to !== null) pathQuery.push({ name: "to", value: to.toString() }); + if (text !== undefined && text !== null) pathQuery.push({ name: "text", value: text.toString() }); + if (flash !== undefined && flash !== null) pathQuery.push({ name: "flash", value: flash.toString() }); + if (transliteration !== undefined && transliteration !== null) pathQuery.push({ name: "transliteration", value: transliteration.toString() }); + if (languageCode !== undefined && languageCode !== null) pathQuery.push({ name: "languageCode", value: languageCode.toString() }); + if (intermediateReport !== undefined && intermediateReport !== null) pathQuery.push({ name: "intermediateReport", value: intermediateReport.toString() }); + if (notifyUrl !== undefined && notifyUrl !== null) pathQuery.push({ name: "notifyUrl", value: notifyUrl.toString() }); + if (notifyContentType !== undefined && notifyContentType !== null) pathQuery.push({ name: "notifyContentType", value: notifyContentType.toString() }); + if (callbackData !== undefined && callbackData !== null) pathQuery.push({ name: "callbackData", value: callbackData.toString() }); + if (validityPeriod !== undefined && validityPeriod !== null) pathQuery.push({ name: "validityPeriod", value: validityPeriod.toString() }); + if (sendAt !== undefined && sendAt !== null) pathQuery.push({ name: "sendAt", value: sendAt.toString() }); + if (track !== undefined && track !== null) pathQuery.push({ name: "track", value: track.toString() }); + if (processKey !== undefined && processKey !== null) pathQuery.push({ name: "processKey", value: processKey.toString() }); + if (trackingType !== undefined && trackingType !== null) pathQuery.push({ name: "trackingType", value: trackingType.toString() }); + if (indiaDltContentTemplateId !== undefined && indiaDltContentTemplateId !== null) pathQuery.push({ name: "indiaDltContentTemplateId", value: indiaDltContentTemplateId.toString() }); + if (indiaDltPrincipalEntityId !== undefined && indiaDltPrincipalEntityId !== null) pathQuery.push({ name: "indiaDltPrincipalEntityId", value: indiaDltPrincipalEntityId.toString() }); + if (indiaDltTelemarketerId !== undefined && indiaDltTelemarketerId !== null) pathQuery.push({ name: "indiaDltTelemarketerId", value: indiaDltTelemarketerId.toString() }); + if (turkeyIysBrandCode !== undefined && turkeyIysBrandCode !== null) pathQuery.push({ name: "turkeyIysBrandCode", value: turkeyIysBrandCode.toString() }); + if (turkeyIysRecipientType !== undefined && turkeyIysRecipientType !== null) pathQuery.push({ name: "turkeyIysRecipientType", value: turkeyIysRecipientType.toString() }); + if (southKoreaResellerCode !== undefined && southKoreaResellerCode !== null) pathQuery.push({ name: "southKoreaResellerCode", value: southKoreaResellerCode.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); - const response = await infobip.sendSmsMessageOverQueryParameters({ $ }); + const response = await infobip.sendSmsMessageOverQueryParameters({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/send-sms-message/send-sms-message.mjs b/components/infobip/actions/send-sms-message/send-sms-message.mjs index 03566e77d6c31..d09152a9ba7ec 100644 --- a/components/infobip/actions/send-sms-message/send-sms-message.mjs +++ b/components/infobip/actions/send-sms-message/send-sms-message.mjs @@ -1,19 +1,53 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-send-sms-message", + key: "send-sms-message", name: "Send SMS Message V2", description: "Send SMS message Use this endpoint to send an SMS and set up a rich set of features, such as batch sending with a single API request, scheduling, URL tracking, language and transliteration configur... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + phoneNumber: { + propDefinition: [infobip, "phoneNumber"], + optional: false, + }, + text: { + propDefinition: [infobip, "text"], + optional: false, + }, + from: { + propDefinition: [infobip, "from"], + optional: true, + }, + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, phoneNumber, text, from, applicationId, entityId, ...params } = this; - const response = await infobip.sendSmsMessage({ $ }); + const response = await infobip.sendSmsMessage({ + $, + data: { + messages: [ + { + destinations: [{ to: phoneNumber }], + ...(from && { from }), + text, + ...(applicationId && { applicationId }), + ...(entityId && { entityId }), + }, + ], + ...params, + }, + }); $.export( "$summary", diff --git a/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs b/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs index 3ebfae0621ce6..5f78147c70e35 100644 --- a/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs +++ b/components/infobip/actions/send-sms-messages-over-query-parameters/send-sms-messages-over-query-parameters.mjs @@ -1,7 +1,7 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-send-sms-messages-over-query-parameters", + key: "send-sms-messages-over-query-parameters", name: "Send SMS Messages Over Query Parameters", description: "Send SMS message over query parameters All message parameters of the message can be defined in the query string. Use this method only if [Send SMS message](#channels/sms/send-sms-messages) is not a... [See the documentation](https://www.infobip.com/docs/sms)", @@ -9,6 +9,144 @@ export default { type: "action", props: { infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + optional: true, + }, + from: { + type: "string", + label: "From", + description: "The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`).", + optional: true, + }, + to: { + type: "string", + label: "To", + description: "List of message recipients.", + optional: false, + }, + text: { + type: "string", + label: "Text", + description: "Content of the message being sent.", + optional: false, + }, + flash: { + type: "boolean", + label: "Flash", + description: "Sends a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) if set to true.", + optional: true, + }, + transliteration: { + type: "string", + label: "Transliteration", + description: "Conversion of a message text from one script to another.", + optional: true, + }, + languageCode: { + type: "string", + label: "Language Code", + description: "Code for language character set of a message content.", + optional: true, + }, + intermediateReport: { + type: "boolean", + label: "Intermediate Report", + description: "Use a [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report-v3) that will be sent on your callback server.", + optional: true, + }, + notifyUrl: { + type: "string", + label: "Notify Url", + description: "The URL on your call back server on to which a delivery report will be sent.", + optional: true, + }, + notifyContentType: { + type: "string", + label: "Notify Content Type", + description: "Preferred delivery report content type, `application/json` or `application/xml`.", + optional: true, + }, + callbackData: { + type: "string", + label: "Callback Data", + description: "Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports-v3). The maximum value is 4000 characters.", + optional: true, + }, + validityPeriod: { + type: "integer", + label: "Validity Period", + description: "The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`.", + optional: true, + }, + sendAt: { + type: "string", + label: "Send At", + description: "Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. Must be sooner than 180 days from now.", + optional: true, + }, + includeSmsCountInResponse: { + type: "boolean", + label: "Include Sms Count In Response", + description: "Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. ", + optional: true, + }, + trackingUrl: { + type: "string", + label: "Tracking Url", + description: "The URL of your callback server on to which the Click report will be sent.", + optional: true, + }, + trackingType: { + type: "string", + label: "Tracking Type", + description: "Sets a custom conversion type naming convention, e.g. ONE_TIME_PIN, SOCIAL_INVITES, etc.", + optional: true, + }, + indiaDltContentTemplateId: { + type: "string", + label: "India Dlt Content Template Id", + description: "The ID of your registered DLT (Distributed Ledger Technology) content template.", + optional: true, + }, + indiaDltPrincipalEntityId: { + type: "string", + label: "India Dlt Principal Entity Id", + description: "Your DLT (Distributed Ledger Technology) entity id.", + optional: true, + }, + indiaDltTelemarketerId: { + type: "string", + label: "India Dlt Telemarketer Id", + description: "Your assigned Telemarketer ID. (required for Aggregators)", + optional: true, + }, + turkeyIysBrandCode: { + type: "integer", + label: "Turkey Iys Brand Code", + description: "Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account.", + optional: true, + }, + turkeyIysRecipientType: { + type: "string", + label: "Turkey Iys Recipient Type", + description: "Recipient Type must be TACIR or BIREYSEL", + optional: true, + }, + southKoreaResellerCode: { + type: "integer", + label: "South Korea Reseller Code", + description: "Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending.", + optional: true, + }, + southKoreaTitle: { + type: "string", + label: "South Korea Title", + description: "Title of the message.", + optional: true, + }, applicationId: { propDefinition: [infobip, "applicationId"], optional: true, @@ -19,9 +157,43 @@ export default { } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, from, to, text, flash, transliteration, languageCode, intermediateReport, notifyUrl, notifyContentType, callbackData, validityPeriod, sendAt, includeSmsCountInResponse, trackingUrl, trackingType, indiaDltContentTemplateId, indiaDltPrincipalEntityId, indiaDltTelemarketerId, turkeyIysBrandCode, turkeyIysRecipientType, southKoreaResellerCode, southKoreaTitle, ...params } = this; + + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + if (from !== undefined && from !== null) pathQuery.push({ name: "from", value: from.toString() }); + if (to !== undefined && to !== null) pathQuery.push({ name: "to", value: to.toString() }); + if (text !== undefined && text !== null) pathQuery.push({ name: "text", value: text.toString() }); + if (flash !== undefined && flash !== null) pathQuery.push({ name: "flash", value: flash.toString() }); + if (transliteration !== undefined && transliteration !== null) pathQuery.push({ name: "transliteration", value: transliteration.toString() }); + if (languageCode !== undefined && languageCode !== null) pathQuery.push({ name: "languageCode", value: languageCode.toString() }); + if (intermediateReport !== undefined && intermediateReport !== null) pathQuery.push({ name: "intermediateReport", value: intermediateReport.toString() }); + if (notifyUrl !== undefined && notifyUrl !== null) pathQuery.push({ name: "notifyUrl", value: notifyUrl.toString() }); + if (notifyContentType !== undefined && notifyContentType !== null) pathQuery.push({ name: "notifyContentType", value: notifyContentType.toString() }); + if (callbackData !== undefined && callbackData !== null) pathQuery.push({ name: "callbackData", value: callbackData.toString() }); + if (validityPeriod !== undefined && validityPeriod !== null) pathQuery.push({ name: "validityPeriod", value: validityPeriod.toString() }); + if (sendAt !== undefined && sendAt !== null) pathQuery.push({ name: "sendAt", value: sendAt.toString() }); + if (includeSmsCountInResponse !== undefined && includeSmsCountInResponse !== null) pathQuery.push({ name: "includeSmsCountInResponse", value: includeSmsCountInResponse.toString() }); + if (trackingUrl !== undefined && trackingUrl !== null) pathQuery.push({ name: "trackingUrl", value: trackingUrl.toString() }); + if (trackingType !== undefined && trackingType !== null) pathQuery.push({ name: "trackingType", value: trackingType.toString() }); + if (indiaDltContentTemplateId !== undefined && indiaDltContentTemplateId !== null) pathQuery.push({ name: "indiaDltContentTemplateId", value: indiaDltContentTemplateId.toString() }); + if (indiaDltPrincipalEntityId !== undefined && indiaDltPrincipalEntityId !== null) pathQuery.push({ name: "indiaDltPrincipalEntityId", value: indiaDltPrincipalEntityId.toString() }); + if (indiaDltTelemarketerId !== undefined && indiaDltTelemarketerId !== null) pathQuery.push({ name: "indiaDltTelemarketerId", value: indiaDltTelemarketerId.toString() }); + if (turkeyIysBrandCode !== undefined && turkeyIysBrandCode !== null) pathQuery.push({ name: "turkeyIysBrandCode", value: turkeyIysBrandCode.toString() }); + if (turkeyIysRecipientType !== undefined && turkeyIysRecipientType !== null) pathQuery.push({ name: "turkeyIysRecipientType", value: turkeyIysRecipientType.toString() }); + if (southKoreaResellerCode !== undefined && southKoreaResellerCode !== null) pathQuery.push({ name: "southKoreaResellerCode", value: southKoreaResellerCode.toString() }); + if (southKoreaTitle !== undefined && southKoreaTitle !== null) pathQuery.push({ name: "southKoreaTitle", value: southKoreaTitle.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); - const response = await infobip.sendSmsMessagesOverQueryParameters({ $ }); + const response = await infobip.sendSmsMessagesOverQueryParameters({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/actions/send-sms-messages/send-sms-messages.mjs b/components/infobip/actions/send-sms-messages/send-sms-messages.mjs index e971748ecf7dd..43b7349adc792 100644 --- a/components/infobip/actions/send-sms-messages/send-sms-messages.mjs +++ b/components/infobip/actions/send-sms-messages/send-sms-messages.mjs @@ -1,19 +1,53 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-send-sms-messages", + key: "send-sms-messages", name: "Send SMS message", description: "Send SMS message With this API method, you can do anything from sending a basic message to one person, all the way to sending customized messages to thousands of recipients in one go. It comes with... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + phoneNumber: { + propDefinition: [infobip, "phoneNumber"], + optional: false, + }, + text: { + propDefinition: [infobip, "text"], + optional: false, + }, + from: { + propDefinition: [infobip, "from"], + optional: true, + }, + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], + optional: true, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, phoneNumber, text, from, applicationId, entityId, ...params } = this; - const response = await infobip.sendSmsMessages({ $ }); + const response = await infobip.sendSmsMessages({ + $, + data: { + messages: [ + { + ...(from && { sender: from }), + destinations: [{ to: phoneNumber }], + content: { text }, + ...(applicationId && { applicationId }), + ...(entityId && { entityId }), + }, + ], + ...params, + }, + }); $.export( "$summary", diff --git a/components/infobip/actions/send-sms/send-sms.mjs b/components/infobip/actions/send-sms/send-sms.mjs deleted file mode 100644 index 8748e4d8a7857..0000000000000 --- a/components/infobip/actions/send-sms/send-sms.mjs +++ /dev/null @@ -1,84 +0,0 @@ -import infobip from "../../infobip.app.mjs"; - -export default { - key: "infobip-send-sms", - name: "Send SMS", - description: "Sends an SMS message to a specified number. [See the documentation](https://www.infobip.com/docs/api)", - version: "0.0.1", - type: "action", - props: { - infobip, - phoneNumber: { - propDefinition: [ - infobip, - "phoneNumber", - ], - optional: true, - }, - text: { - propDefinition: [ - infobip, - "text", - ], - optional: true, - }, - from: { - propDefinition: [ - infobip, - "from", - ], - optional: true, - }, - flash: { - type: "boolean", - label: "FLash", - description: "Allows for sending a flash SMS to automatically appear on recipient devices without interaction.", - optional: true, - }, - notifyUrl: { - type: "string", - label: "Notify URL", - description: "The URL on your call back server on to which a delivery report will be sent. The [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) for when your URL becomes unavailable uses the following formula: `1min + (1min * retryNumber * retryNumber)`.", - optional: true, - }, - entityId: { - propDefinition: [ - infobip, - "entityId", - ], - optional: true, - }, - applicationId: { - propDefinition: [ - infobip, - "applicationId", - ], - optional: true, - }, - }, - async run({ $ }) { - const { - infobip, - phoneNumber, - ...data - } = this; - const response = await infobip.sendSms({ - $, - data: { - messages: [ - { - destinations: [ - { - to: phoneNumber, - }, - ], - data, - }, - ], - }, - }); - - $.export("$summary", response.messages[0].status.description); - return response; - }, -}; diff --git a/components/infobip/actions/send-viber-text-message/send-viber-text-message.mjs b/components/infobip/actions/send-viber-text-message/send-viber-text-message.mjs deleted file mode 100644 index d80e396fd3225..0000000000000 --- a/components/infobip/actions/send-viber-text-message/send-viber-text-message.mjs +++ /dev/null @@ -1,53 +0,0 @@ -import infobip from "../../infobip.app.mjs"; - -export default { - key: "infobip-send-viber-text-message", - name: "Send Viber Text Message", - description: "Send a text message to multiple recipients via Viber. [See the documentation](https://www.infobip.com/docs/api/channels/viber/viber-business-messages/send-viber-messages)", - version: "0.0.1", - type: "action", - props: { - infobip, - from: { - propDefinition: [ - infobip, - "from", - ], - }, - to: { - propDefinition: [ - infobip, - "to", - ], - }, - contentText: { - type: "string", - label: "Content Text", - description: "The text content to send in bulk messages.", - }, - }, - async run({ $ }) { - const response = await this.infobip.sendViberMessage({ - $, - data: { - messages: [ - { - sender: this.from, - destinations: [ - { - to: this.to, - }, - ], - content: { - type: "TEXT", - text: this.contentText, - }, - }, - ], - }, - }); - - $.export("$summary", response.messages[0].status.description); - return response; - }, -}; diff --git a/components/infobip/actions/send-whatsapp-text-message/send-whatsapp-text-message.mjs b/components/infobip/actions/send-whatsapp-text-message/send-whatsapp-text-message.mjs deleted file mode 100644 index 2a961ae73f681..0000000000000 --- a/components/infobip/actions/send-whatsapp-text-message/send-whatsapp-text-message.mjs +++ /dev/null @@ -1,58 +0,0 @@ -import infobip from "../../infobip.app.mjs"; - -export default { - key: "infobip-send-whatsapp-text-message", - name: "Send WhatsApp Text Message", - description: "Sends a WhatsApp text message to a specified number. [See the documentation](https://www.infobip.com/docs/api#channels/whatsapp/send-whatsapp-text-message)", - version: "0.0.1", - type: "action", - props: { - infobip, - from: { - propDefinition: [ - infobip, - "from", - ], - description: "Registered WhatsApp sender number. Must be in international format and comply with [WhatsApp's requirements](https://www.infobip.com/docs/whatsapp/get-started#phone-number-what-you-need-to-know).", - }, - to: { - propDefinition: [ - infobip, - "phoneNumber", - ], - description: "Message recipient number. Must be in international format.", - }, - text: { - propDefinition: [ - infobip, - "text", - ], - }, - messageId: { - propDefinition: [ - infobip, - "messageId", - ], - optional: true, - }, - }, - async run({ $ }) { - const { - infobip, - text, - ...data - } = this; - - const response = await infobip.sendWhatsappMessage({ - $, - data: { - content: { - text, - }, - ...data, - }, - }); - $.export("$summary", response.status.description); - return response; - }, -}; diff --git a/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs b/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs index 8dccd0bb0eab6..43fdf86318e53 100644 --- a/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs +++ b/components/infobip/actions/update-scheduled-sms-messages-status/update-scheduled-sms-messages-status.mjs @@ -1,19 +1,37 @@ -import infobip from "../../infobip-enhanced.app.mjs"; +import infobip from "../../infobip.app.mjs"; export default { - key: "infobip-update-scheduled-sms-messages-status", + key: "update-scheduled-sms-messages-status", name: "Update Scheduled SMS Messages Status", description: "Update scheduled SMS messages status Change the status or completely cancel sending of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use t... [See the documentation](https://www.infobip.com/docs/sms)", version: "0.0.1", type: "action", props: { - infobip + infobip, + bulkId: { + type: "string", + label: "Bulk Id", + description: "bulkId parameter", + optional: false, + } }, async run({ $ }) { - const { infobip, ...params } = this; + const { infobip, bulkId, ...params } = this; - const response = await infobip.updateScheduledSmsMessagesStatus({ $ }); + const pathQuery = []; + if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() }); + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); + + const response = await infobip.updateScheduledSmsMessagesStatus({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + }); $.export( "$summary", diff --git a/components/infobip/generate-actions.mjs b/components/infobip/generate-actions.mjs index e4623bb0fc226..85ab88b0c20f3 100644 --- a/components/infobip/generate-actions.mjs +++ b/components/infobip/generate-actions.mjs @@ -1,486 +1,832 @@ -#!/usr/bin/env node - -// Action Generator for Infobip Enhanced App -// Generates Pipedream actions from OpenAPI specification -// Follows ESLint rules and existing file patterns - -import fs from "fs"; +import fs from "fs/promises"; import path from "path"; -import { fileURLToPath } from "url"; -import InfobipOpenAPIGenerator from "./lib/openapi-generator.mjs"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -class InfobipActionGenerator { - constructor() { - this.componentsDir = __dirname; - this.actionsDir = path.join(this.componentsDir, "actions"); - this.existingActions = new Set(); - this.generatedCount = 0; - this.skippedCount = 0; - this.errorCount = 0; - } - // Load existing actions to avoid duplicates - loadExistingActions() { - try { - const actionDirs = fs.readdirSync(this.actionsDir, { - withFileTypes: true, - }); +/** + * Script to automatically generate Pipedream actions for Infobip enhanced app methods + * Parses the enhanced app file and creates action files for methods without existing actions + * Now includes explicit parameter extraction from OpenAPI specification + */ + +const ENHANCED_APP_PATH = "./infobip.app.mjs"; +const OPENAPI_SPEC_PATH = "./openapi-spec.json"; +const ACTIONS_DIR = "./actions"; +const ACTION_TEMPLATE_PATH = "../../infobip.app.mjs"; + +// Methods that should be skipped during generation +const SKIP_METHODS = new Set([ + "_baseUrl", + "_headers", + "_makeRequest", + "listApplications", + "listEntities", + "listResources", + "sendSms", + "sendViberMessage", + "sendWhatsappMessage", + "createHook", + "deleteHook", + "previewSmsMessage", // Already has existing action +]); + +// Map method names to human-readable action names +const METHOD_NAME_MAP = { + sendSmsMessagesOverQueryParameters: "Send SMS Messages Over Query Parameters", + sendSmsMessageOverQueryParameters: "Send SMS Message Over Query Parameters", + sendSmsMessage: "Send SMS Message V2", + sendBinarySmsMessage: "Send Binary SMS Message", + getScheduledSmsMessages: "Get Scheduled SMS Messages", + rescheduleSmsMessages: "Reschedule SMS Messages", + getScheduledSmsMessagesStatus: "Get Scheduled SMS Messages Status", + updateScheduledSmsMessagesStatus: "Update Scheduled SMS Messages Status", + logEndTag: "Confirm Conversion (Log End Tag)", + getInboundSmsMessages: "Get Inbound SMS Messages", + getOutboundSmsMessageDeliveryReportsV3: "Get Outbound SMS Message Delivery Reports V3", + getOutboundSmsMessageLogsV3: "Get Outbound SMS Message Logs V3", + getOutboundSmsMessageDeliveryReports: "Get Outbound SMS Message Delivery Reports", + getOutboundSmsMessageLogs: "Get Outbound SMS Message Logs", +}; - for (const dirent of actionDirs) { - if (dirent.isDirectory()) { - this.existingActions.add(dirent.name); - } - } +// Map method names to clean action keys (without infobip prefix) +const METHOD_TO_ACTION_KEY_MAP = { + sendSmsMessages: "send-sms-messages", + sendSmsMessagesOverQueryParameters: "send-sms-messages-over-query-parameters", + sendSmsMessageOverQueryParameters: "send-sms-message-over-query-parameters", + previewSmsMessage: "preview-sms-message", + sendSmsMessage: "send-sms-message", + sendBinarySmsMessage: "send-binary-sms-message", + getScheduledSmsMessages: "get-scheduled-sms-messages", + rescheduleSmsMessages: "reschedule-sms-messages", + getScheduledSmsMessagesStatus: "get-scheduled-sms-messages-status", + updateScheduledSmsMessagesStatus: "update-scheduled-sms-messages-status", + logEndTag: "log-end-tag", + getInboundSmsMessages: "get-inbound-sms-messages", + getOutboundSmsMessageDeliveryReportsV3: "get-outbound-sms-message-delivery-reports-v3", + getOutboundSmsMessageLogsV3: "get-outbound-sms-message-logs-v3", + getOutboundSmsMessageDeliveryReports: "get-outbound-sms-message-delivery-reports", + getOutboundSmsMessageLogs: "get-outbound-sms-message-logs", +}; - console.log(`📂 Found ${this.existingActions.size} existing actions`); - } catch (error) { - console.warn("⚠️ Could not read actions directory:", error.message); - } +// Load and parse OpenAPI specification +async function loadOpenAPISpec() { + try { + const specContent = await fs.readFile(OPENAPI_SPEC_PATH, "utf8"); + return JSON.parse(specContent); + } catch (error) { + console.warn("Could not load OpenAPI spec:", error.message); + return null; } +} - // Create action directory and file - createActionFile(actionData, overwrite = false) { - const actionDir = path.join(this.actionsDir, actionData.actionKey); - const actionFile = path.join(actionDir, `${actionData.actionKey}.mjs`); - - // Skip if exists and not overwriting - if (!overwrite && this.existingActions.has(actionData.actionKey)) { - console.log(`⏭️ Skipping existing action: ${actionData.actionKey}`); - this.skippedCount++; - return false; - } - - try { - // Create directory if it doesn't exist - if (!fs.existsSync(actionDir)) { - fs.mkdirSync(actionDir, { - recursive: true, +// Extract parameters from OpenAPI specification for a given path and method +function extractOpenAPIParameters(spec, methodPath, httpMethod) { + if (!spec || !spec.paths) return {}; + + const pathSpec = spec.paths[methodPath]; + if (!pathSpec) return {}; + + const operation = pathSpec[httpMethod.toLowerCase()]; + if (!operation) return {}; + + const parameters = { + pathParams: [], + queryParams: [], + bodyParams: {}, + bodySchema: null, + examples: {}, + }; + + // Extract path and query parameters + if (operation.parameters) { + operation.parameters.forEach(param => { + if (param.in === "path") { + parameters.pathParams.push({ + name: param.name, + required: param.required || false, + type: param.schema?.type || "string", + description: param.description || "", + }); + } else if (param.in === "query") { + parameters.queryParams.push({ + name: param.name, + required: param.required || false, + type: param.schema?.type || "string", + description: param.description || "", + enum: param.schema?.enum || null, }); } - - // Format content to match ESLint rules - const formattedContent = this.formatForESLint(actionData.content); - - // Write action file - fs.writeFileSync(actionFile, formattedContent, "utf8"); - - console.log(`✅ Generated: ${actionData.actionKey}`); - this.generatedCount++; - return true; - } catch (error) { - console.error(`❌ Failed to create ${actionData.actionKey}:`, error.message); - this.errorCount++; - return false; - } - } - - // Format content according to ESLint rules - formatForESLint(content) { - return content - // Ensure proper indentation (2 spaces) - .replace(/^( {2,})/gm, (match) => { - const spaces = match.length; - return " ".repeat(Math.floor(spaces / 2)); - }) - // Ensure trailing comma on multiline objects/arrays - more precise pattern - .replace(/([}\]"'\w])\n(\s+)([}\]])/g, "$1,\n$2$3") - // Ensure object properties are on new lines - .replace(/\{\s*(\w)/g, "{\n $1") - .replace(/,\s*(\w)/g, ",\n $1") - // Add trailing newline - .replace(/\n?$/, "\n") - // Remove trailing spaces - .replace(/ +$/gm, "") - // Ensure no multiple empty lines - .replace(/\n{3,}/g, "\n\n"); + }); } - - // Generate action name that follows patterns - generateConsistentActionName(operation, path, method) { - // Use existing patterns from the codebase - if (operation.summary) { - // Clean up the summary to match existing patterns - return operation.summary - .replace(/^(Get|Send|Create|Update|Delete)\s+/i, (match) => - match.charAt(0).toUpperCase() + match.slice(1).toLowerCase()) - .replace(/\s+sms\s+/gi, " SMS ") - .replace(/\s+mms\s+/gi, " MMS ") - .trim(); + + // Extract request body parameters and examples + if (operation.requestBody) { + const content = operation.requestBody.content; + if (content && content["application/json"]) { + const schema = content["application/json"].schema; + parameters.bodySchema = schema; + + // Extract examples for better understanding of structure + const examples = content["application/json"].examples; + if (examples) { + parameters.examples = examples; + } + + // For SMS methods, extract specific structure from examples + if (methodPath.includes("/sms") && examples) { + const firstExample = Object.values(examples)[0]; + if (firstExample && firstExample.value) { + parameters.exampleStructure = firstExample.value; + } + } + + // Extract properties from schema + if (schema && schema.properties) { + extractSchemaProperties(schema.properties, parameters.bodyParams, ""); + } } - - // Fallback to generated name with proper capitalization - const pathParts = path.split("/").filter((p) => p && !p.startsWith("{")); - const methodName = method.charAt(0).toUpperCase() + method.slice(1).toLowerCase(); - const resource = pathParts - .map((p) => p.charAt(0).toUpperCase() + p.slice(1).replace(/-/g, " ")) - .join(" "); - - return `${methodName} ${resource}`; } + + return parameters; +} - // Generate action description following existing patterns - generateConsistentDescription(operation, actionName) { - let description = operation.description || operation.summary || actionName; - - // Clean up description - description = description - .replace(/[\r\n]+/g, " ") - .replace(/\s+/g, " ") - .trim(); - - // Ensure it ends with period if not already - if (!description.endsWith(".")) { - description += "."; +// Recursively extract properties from JSON schema +function extractSchemaProperties(properties, result, prefix = "") { + for (const [key, prop] of Object.entries(properties)) { + const fullKey = prefix ? `${prefix}.${key}` : key; + + if (prop.type === "object" && prop.properties) { + extractSchemaProperties(prop.properties, result, fullKey); + } else if (prop.type === "array" && prop.items && prop.items.properties) { + extractSchemaProperties(prop.items.properties, result, `${fullKey}[]`); + } else { + result[fullKey] = { + type: prop.type || "string", + description: prop.description || "", + required: false, // Will be set based on parent schema's required array + enum: prop.enum || null, + example: prop.example || null, + }; } - - // Add documentation link - const docUrl = operation.externalDocs?.url || "https://www.infobip.com/docs/sms"; - return `${description} [See the documentation](${docUrl})`; } +} - // Enhanced action generation with consistent patterns - async generateEnhancedActions(options = {}) { - const { - overwrite = false, - filter = null, - limit = null, - } = options; - - console.log("🚀 Starting Infobip action generation..."); - - // Create mock app instance for OpenAPI generator - const mockApp = { - $auth: { - api_key: "mock-key", - base_url: "https://api.infobip.com", - }, - _baseUrl: () => "https://api.infobip.com", - _headers: () => ({ - "Authorization": "App mock-key", - "Content-type": "application/json", - }), - }; - - const generator = new InfobipOpenAPIGenerator(mockApp); - - try { - // Load existing actions - this.loadExistingActions(); - - // Generate all actions from OpenAPI spec - console.log("📡 Fetching OpenAPI specification..."); - const actions = await generator.generateAllActions(); - - console.log(`📋 Found ${actions.length} potential actions in OpenAPI spec`); - - let processedActions = actions; - - // Apply filter if provided - if (filter) { - processedActions = actions.filter((action) => - action.actionKey.includes(filter) || - action.actionName.toLowerCase().includes(filter.toLowerCase())); - console.log(`🔍 Filtered to ${processedActions.length} actions matching "${filter}"`); - } - - // Apply limit if provided - if (limit && limit > 0) { - processedActions = processedActions.slice(0, limit); - console.log(`📏 Limited to first ${processedActions.length} actions`); - } +// Map method names to their OpenAPI paths and HTTP methods +const METHOD_TO_OPENAPI_MAP = { + sendSmsMessages: { path: "/sms/3/messages", method: "POST" }, + sendSmsMessagesOverQueryParameters: { path: "/sms/3/text/query", method: "GET" }, + sendSmsMessageOverQueryParameters: { path: "/sms/1/text/query", method: "GET" }, + previewSmsMessage: { path: "/sms/1/preview", method: "POST" }, + sendSmsMessage: { path: "/sms/2/text/advanced", method: "POST" }, + sendBinarySmsMessage: { path: "/sms/2/binary/advanced", method: "POST" }, + getScheduledSmsMessages: { path: "/sms/1/bulks", method: "GET" }, + rescheduleSmsMessages: { path: "/sms/1/bulks", method: "PUT" }, + getScheduledSmsMessagesStatus: { path: "/sms/1/bulks/status", method: "GET" }, + updateScheduledSmsMessagesStatus: { path: "/sms/1/bulks/status", method: "PUT" }, + logEndTag: { path: "/ct/1/log/end/{messageId}", method: "POST" }, + getInboundSmsMessages: { path: "/sms/1/inbox/reports", method: "GET" }, + getOutboundSmsMessageDeliveryReportsV3: { path: "/sms/3/reports", method: "GET" }, + getOutboundSmsMessageLogsV3: { path: "/sms/3/logs", method: "GET" }, + getOutboundSmsMessageDeliveryReports: { path: "/sms/1/reports", method: "GET" }, + getOutboundSmsMessageLogs: { path: "/sms/1/logs", method: "GET" }, +}; - // Generate action files - console.log("⚡ Generating action files..."); +// Map method names to kebab-case for action keys +function methodNameToKebabCase(methodName) { + return methodName + .replace(/([A-Z])/g, "-$1") + .toLowerCase() + .replace(/^-/, ""); +} - for (const actionData of processedActions) { - // Enhance the action with consistent naming - actionData.actionName = this.generateConsistentActionName( - actionData.operation, - actionData.path, - actionData.method, - ); +// Extract JSDoc comment and method signature from method text +function parseMethodInfo(methodText) { + const jsdocMatch = methodText.match(/\/\*\*([\s\S]*?)\*\//); + const methodMatch = methodText.match(/(\w+)\(opts = {}\)/); + + if (!jsdocMatch || !methodMatch) return null; + + const jsdoc = jsdocMatch[1]; + const methodName = methodMatch[1]; + + // Extract summary (first non-empty line) + const summaryMatch = jsdoc.match(/\*\s*([^\n\r@]+)/); + const summary = summaryMatch + ? summaryMatch[1].trim() + : ""; + + // Extract description (everything before @see or @param) + const descMatch = jsdoc.match(/\*\s*([\s\S]*?)(?:\*\s*@see|\*\s*@param|\*\/)/); + let description = descMatch + ? descMatch[1].replace(/\*\s*/g, "").replace(/\s+/g, " ") + .trim() + : ""; + + // Clean up description - remove extra whitespace and line breaks + description = description.replace(/\n/g, " ").replace(/\s+/g, " ") + .trim(); + + // Extract external documentation link + const seeMatch = jsdoc.match(/@see\s*\{@link\s*(.*?)\|/); + const externalDoc = seeMatch + ? seeMatch[1] + : "https://www.infobip.com/docs/api"; + + // Extract parameter info from @param annotation + const paramMatch = jsdoc.match(/@param\s*\{\{([\s\S]*?)\}\}/); + let hasData = false; + let hasPathParams = false; + let hasPathQuery = false; + let paramDetails = {}; + + if (paramMatch) { + const paramText = paramMatch[1]; + hasData = paramText.includes("data?:") && (paramText.includes("required") || paramText.includes("Request body")); + hasPathParams = paramText.includes("pathParams"); + hasPathQuery = paramText.includes("pathQuery"); + + // Extract specific parameter details for better prop generation + paramDetails = { + hasData, + hasPathParams, + hasPathQuery, + requiresPhoneNumber: hasData && (paramText.includes("\"to\"") || paramText.includes("destinations")), + requiresText: hasData && paramText.includes("\"text\""), + requiresFrom: hasData && paramText.includes("\"from\""), + hasMessageId: hasPathParams && paramText.includes("messageId"), + hasQueryParams: hasPathQuery && (paramText.includes("limit") || paramText.includes("query")), + isRequired: paramText.includes("required"), + hasApplicationId: hasData && paramText.includes("applicationId"), + hasEntityId: hasData && paramText.includes("entityId"), + }; + } - // Update the content with enhanced names and descriptions - const enhancedContent = this.enhanceActionContent(actionData); - actionData.content = enhancedContent; + return { + methodName, + summary, + description, + externalDoc, + hasData, + hasPathParams, + hasPathQuery, + paramDetails, + }; +} - this.createActionFile(actionData, overwrite); +// Generate props based on OpenAPI parameters +function generateProps(methodInfo, openApiParams) { + const props = ["infobip"]; + + // Add path parameters + if (openApiParams?.pathParams) { + openApiParams.pathParams.forEach(param => { + let propDef; + if (param.name === "messageId") { + propDef = ` + ${param.name}: { + propDefinition: [infobip, "messageId"], + optional: ${!param.required}, + }`; + } else { + propDef = ` + ${param.name}: { + type: "${param.type}", + label: "${param.name.charAt(0).toUpperCase() + param.name.slice(1)}", + description: "${param.description || `${param.name} parameter`}", + optional: ${!param.required}, + }`; } - - // Print summary - console.log("\n📊 Generation Summary:"); - console.log(`✅ Generated: ${this.generatedCount}`); - console.log(`⏭️ Skipped: ${this.skippedCount}`); - console.log(`❌ Errors: ${this.errorCount}`); - console.log(`📋 Total processed: ${processedActions.length}`); - - return { - generated: this.generatedCount, - skipped: this.skippedCount, - errors: this.errorCount, - total: processedActions.length, + props.push(propDef); + }); + } + + // Add query parameters + if (openApiParams?.queryParams) { + openApiParams.queryParams.forEach(param => { + let propDef; + const typeMapping = { + integer: "integer", + number: "number", + boolean: "boolean", + string: "string", }; - - } catch (error) { - console.error("💥 Action generation failed:", error.message); - throw error; - } + + propDef = ` + ${param.name}: { + type: "${typeMapping[param.type] || "string"}", + label: "${param.name.charAt(0).toUpperCase() + param.name.slice(1).replace(/([A-Z])/g, ' $1')}", + description: "${param.description || `${param.name} parameter`}", + optional: ${!param.required},`; + + if (param.enum) { + propDef += ` + options: ${JSON.stringify(param.enum)},`; + } + + propDef += ` + }`; + props.push(propDef); + }); } - - // Enhance action content with better formatting and patterns - enhanceActionContent(actionData) { - const { - actionKey, operation, path, method, - } = actionData; - - const actionName = this.generateConsistentActionName(operation, path, method); - const description = this.generateConsistentDescription(operation, actionName); - - // Parse path parameters - const pathParams = path.match(/{([^}]+)}/g)?.map((p) => p.slice(1, -1)) || []; - - // Build props based on operation parameters and request body - use propDefinition pattern - const propDefinitions = []; - - // Add path parameters as props with propDefinition pattern - for (const param of pathParams) { - const label = param.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()); - propDefinitions.push(` ${param}: { - type: "string", - label: "${label}", - description: "The ${param} parameter for the API call.", + + // For SMS sending methods, add required props based on OpenAPI examples structure + if (methodInfo.methodName.includes("send") && !methodInfo.methodName.includes("OverQueryParameters")) { + // Check if this is an SMS endpoint by looking at the example structure + const isSmsMethod = openApiParams?.exampleStructure?.messages; + + if (isSmsMethod) { + // Add phone number (maps to destinations[].to) + props.push(` + phoneNumber: { + propDefinition: [infobip, "phoneNumber"], + optional: false, }`); - } - - // Add common props based on the endpoint type using propDefinition pattern - if (path.includes("/messages") || path.includes("/sms")) { - if (method.toUpperCase() === "POST") { - propDefinitions.push(` from: { - propDefinition: [ - infobip, - "from", - ], + + // Add text (maps to content.text) + props.push(` + text: { + propDefinition: [infobip, "text"], + optional: false, }`); - - propDefinitions.push(` to: { - propDefinition: [ - infobip, - "phoneNumber", - ], + + // Add sender (maps to sender field) + props.push(` + from: { + propDefinition: [infobip, "from"], + optional: true, }`); - - propDefinitions.push(` text: { - propDefinition: [ - infobip, - "text", - ], + + // Add application and entity IDs for platform features + props.push(` + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], + optional: true, }`); - } } - - // Add query parameters for GET endpoints - if (method.toUpperCase() === "GET") { - propDefinitions.push(` limit: { - propDefinition: [ - infobip, - "limit", - ], + } + + // Add application and entity IDs for query parameter sending methods + if (methodInfo.methodName.includes("send") && methodInfo.methodName.includes("OverQueryParameters")) { + props.push(` + applicationId: { + propDefinition: [infobip, "applicationId"], + optional: true, + }, + entityId: { + propDefinition: [infobip, "entityId"], optional: true, }`); - } + } + + // Add additional body parameters as generic props (skip SMS-specific ones we already handled) + if (openApiParams?.bodyParams) { + const skipParams = new Set(['messages', 'to', 'text', 'from', 'applicationId', 'entityId', 'sender', 'destinations', 'content']); + + Object.entries(openApiParams.bodyParams).forEach(([key, param]) => { + // Skip array notation and already handled params + if (key.includes('[]') || skipParams.has(key)) return; + + const typeMapping = { + integer: "integer", + number: "number", + boolean: "boolean", + string: "string", + object: "object", + array: "string[]", + }; + + const propDef = ` + ${key}: { + type: "${typeMapping[param.type] || "string"}", + label: "${key.charAt(0).toUpperCase() + key.slice(1).replace(/([A-Z])/g, ' $1')}", + description: "${param.description || `${key} parameter`}", + optional: ${!param.required},${param.example ? ` + default: ${JSON.stringify(param.example)},` : ''} + }`; + props.push(propDef); + }); + } - // Build props section with proper ESLint formatting - let propsSection = " infobip,"; - if (propDefinitions.length > 0) { - propsSection += "\n" + propDefinitions.join(",\n") + ","; - } + return props.join(","); +} - // Escape description properly and keep under 100 chars per line - const cleanDescription = description - .replace(/\\/g, "") // Remove escape characters - .replace(/"/g, "\\\"") // Escape quotes properly - .replace(/\s+/g, " ") // Clean whitespace - .trim(); - - // Use existing pattern - destructure and use data wrapper - const destructureProps = []; - if (pathParams.length > 0) { - destructureProps.push(...pathParams); - } - if (method.toUpperCase() === "POST" && (path.includes("/messages") || path.includes("/sms"))) { - destructureProps.push("from", "to", "text"); +// Generate the run method based on OpenAPI parameters +function generateRunMethod(methodInfo, openApiParams) { + const { methodName } = methodInfo; + + let destructuring = "const { infobip"; + let methodCall = ""; + + // Collect all parameter names for destructuring + const paramNames = new Set(); + + // Add path parameters + if (openApiParams?.pathParams) { + openApiParams.pathParams.forEach(param => { + paramNames.add(param.name); + }); + } + + // Add query parameters + if (openApiParams?.queryParams) { + openApiParams.queryParams.forEach(param => { + paramNames.add(param.name); + }); + } + + // Add SMS-specific parameters for sending methods (based on OpenAPI structure) + if (methodName.includes("send") && !methodName.includes("OverQueryParameters") && openApiParams?.exampleStructure) { + const isSmsMethod = openApiParams.exampleStructure.messages; + if (isSmsMethod) { + paramNames.add("phoneNumber"); + paramNames.add("text"); + paramNames.add("from"); + paramNames.add("applicationId"); + paramNames.add("entityId"); } - - const allDestructureItems = [ - "infobip", - ...destructureProps, - ]; - const destructureSection = destructureProps.length > 0 - ? ` const { - ${allDestructureItems.join(",\n ")} - ...data - } = this;` - : " const { infobip } = this;"; - - // Build data object for method call following existing pattern - let dataObjectContent = ""; - if (method.toUpperCase() === "POST" && (path.includes("/messages") || path.includes("/sms"))) { - dataObjectContent = ` data: { + } + + // Add other body parameters + if (openApiParams?.bodyParams) { + const skipParams = new Set(['messages', 'to', 'text', 'from', 'applicationId', 'entityId']); + Object.keys(openApiParams.bodyParams).forEach(key => { + if (!key.includes('[]') && !skipParams.has(key)) { + paramNames.add(key); + } + }); + } + + // Build destructuring assignment + if (paramNames.size > 0) { + destructuring += ", " + Array.from(paramNames).join(", "); + } + destructuring += ", ...params } = this;"; + + // Generate method call based on method type + if (openApiParams?.pathParams && openApiParams.pathParams.length > 0) { + // Method with path parameters + const pathParamsCode = openApiParams.pathParams + .map(param => `{ name: "${param.name}", value: ${param.name} }`) + .join(", "); + + methodCall = ` + const response = await infobip.${methodName}({ + $, + pathParams: [${pathParamsCode}],${openApiParams.queryParams && openApiParams.queryParams.length > 0 ? ` + pathQuery: Object.entries({ ${openApiParams.queryParams.map(p => p.name).join(", ")} }) + .filter(([key, value]) => value !== undefined && value !== null) + .map(([key, value]) => ({ name: key, value: value.toString() })),` : ''} + });`; + } else if (methodName.includes("send") && !methodName.includes("OverQueryParameters") && openApiParams?.exampleStructure) { + // SMS sending methods with structured data based on OpenAPI examples + const hasMessagesArray = openApiParams.exampleStructure.messages; + const apiPath = METHOD_TO_OPENAPI_MAP[methodName]?.path || ""; + const isV3Api = apiPath.includes("/sms/3/"); + const isV2Api = apiPath.includes("/sms/2/"); + + if (hasMessagesArray && isV3Api) { + // Use correct structure for SMS v3 API (/sms/3/messages) + methodCall = ` + const response = await infobip.${methodName}({ + $, + data: { + messages: [ + { + ...(from && { sender: from }), + destinations: [{ to: phoneNumber }], + content: { text }, + ...(applicationId && { applicationId }), + ...(entityId && { entityId }), + }, + ], + ...params, + }, + });`; + } else if (hasMessagesArray && (isV2Api || methodName.includes("sendSmsMessage"))) { + // Use correct structure for SMS v2 API (/sms/2/text/advanced) + methodCall = ` + const response = await infobip.${methodName}({ + $, + data: { messages: [ { - from, - to, + destinations: [{ to: phoneNumber }], + ...(from && { from }), text, - ...data, + ...(applicationId && { applicationId }), + ...(entityId && { entityId }), }, ], - },`; + ...params, + }, + });`; } else { - dataObjectContent = " ...data,"; + // Fallback for other SMS methods without messages array + methodCall = ` + const response = await infobip.${methodName}({ + $, + data: { + to: phoneNumber, + text, + ...(from && { from }), + ...(applicationId && { applicationId }), + ...(entityId && { entityId }), + ...params, + }, + });`; } + } else if (openApiParams?.queryParams && openApiParams.queryParams.length > 0) { + // Method with query parameters + const queryParamNames = openApiParams.queryParams.map(p => p.name); + methodCall = ` + const pathQuery = []; + ${queryParamNames.map(name => `if (${name} !== undefined && ${name} !== null) pathQuery.push({ name: "${name}", value: ${name}.toString() });`).join('\n ')} + + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + pathQuery.push({ name: key, value: value.toString() }); + } + }); - // Create the complete action content with proper ESLint formatting - const actionContent = `import infobip from "../../infobip-enhanced.app.mjs"; + const response = await infobip.${methodName}({ + $, + pathQuery: pathQuery.length > 0 ? pathQuery : undefined, + });`; + } else if (openApiParams?.bodyParams && Object.keys(openApiParams.bodyParams).length > 0) { + // Method with body parameters + methodCall = ` + const response = await infobip.${methodName}({ + $, + data: { + ${Array.from(paramNames).filter(name => !['infobip'].includes(name)).map(name => `...(${name} !== undefined && { ${name} }),`).join('\n ')} + ...params, + }, + });`; + } else { + // Simple method with no specific parameters + methodCall = ` + const response = await infobip.${methodName}({ $ });`; + } + + // Generate summary based on method type + let summary = "Action completed"; + if (methodName.includes("send")) { + summary = "Message sent successfully"; + } else if (methodName.includes("get")) { + summary = "Data retrieved successfully"; + } else if (methodName.includes("preview")) { + summary = "Preview generated successfully"; + } else if (methodName.includes("reschedule") || methodName.includes("update")) { + summary = "Update completed successfully"; + } else if (methodName.includes("logEndTag")) { + summary = "Conversion logged successfully"; + } + + return ` + async run({ $ }) { + ${destructuring} +${methodCall} + + $.export( + "$summary", + \`${summary}: \${response.status?.description || "Success"}\` + ); + return response; + },`; +} + +// Generate complete action file content using OpenAPI parameters +function generateActionFile(methodInfo, openApiParams) { + const actionName = METHOD_NAME_MAP[methodInfo.methodName] || methodInfo.summary; + const actionKey = METHOD_TO_ACTION_KEY_MAP[methodInfo.methodName] || methodNameToKebabCase(methodInfo.methodName); + const props = generateProps(methodInfo, openApiParams); + const runMethod = generateRunMethod(methodInfo, openApiParams); + + let description = methodInfo.description; + if (description.length > 200) { + description = description.substring(0, 197) + "..."; + } + + return `import infobip from "${ACTION_TEMPLATE_PATH}"; export default { key: "${actionKey}", name: "${actionName}", - description: "${cleanDescription}", + description: + "${description} [See the documentation](${methodInfo.externalDoc})", version: "0.0.1", type: "action", props: { -${propsSection} - }, - async run({ $ }) { -${destructureSection} - - const response = await infobip.${actionData.methodName}({ - $, -${dataObjectContent} - }); - - $.export("$summary", "${actionName} completed successfully"); - return response; - }, + ${props} + },${runMethod} }; `; +} + +// Scan existing actions directory to identify what's already created +async function scanExistingActions() { + const existingActions = new Set(); - return actionContent; + try { + const actionDirs = await fs.readdir(ACTIONS_DIR, { + withFileTypes: true, + }); + + for (const dirent of actionDirs) { + if (dirent.isDirectory()) { + // Check both old and new naming schemes + if (dirent.name.startsWith("infobip-")) { + // Old naming scheme: infobip-get-inbound-sms-messages + const actionName = dirent.name.replace("infobip-", ""); + const methodName = actionName.replace(/-([a-z])/g, (match, letter) => letter.toUpperCase()); + existingActions.add(methodName); + } else { + // New naming scheme: get-inbound-sms-messages + // Find the method name that maps to this action key + for (const [methodName, actionKey] of Object.entries(METHOD_TO_ACTION_KEY_MAP)) { + if (actionKey === dirent.name) { + existingActions.add(methodName); + break; + } + } + + // Fallback: convert kebab-case back to camelCase + if (!Array.from(existingActions).find(method => METHOD_TO_ACTION_KEY_MAP[method] === dirent.name)) { + const methodName = dirent.name.replace(/-([a-z])/g, (match, letter) => letter.toUpperCase()); + existingActions.add(methodName); + } + } + } + } + } catch (error) { + console.warn("Could not scan actions directory:", error.message); } - // Utility method to clean action directories - async cleanActions(pattern = null) { - console.log("🧹 Cleaning action directories..."); + return existingActions; +} - try { - const actionDirs = fs.readdirSync(this.actionsDir, { - withFileTypes: true, - }); +// Extract methods from the enhanced app file +async function extractMethods() { + try { + const content = await fs.readFile(ENHANCED_APP_PATH, "utf8"); + const existingActions = await scanExistingActions(); - let cleanedCount = 0; + // Find the methods section + const methodsMatch = content.match(/methods:\s*{([\s\S]*?)},\s*};/); + if (!methodsMatch) { + throw new Error("Could not find methods section in enhanced app file"); + } - for (const dirent of actionDirs) { - if (dirent.isDirectory()) { - const dirName = dirent.name; + const methodsContent = methodsMatch[1]; - // Skip if pattern provided and doesn't match - if (pattern && !dirName.includes(pattern)) { - continue; - } + // Extract individual methods with their JSDoc comments + const methodPattern = /\/\*\*([\s\S]*?)\*\/[\s\S]*?(\w+)\(opts = {}\)\s*{[\s\S]*?(?=\n {4}[\w\\/]|\n {2}},|$)/g; + const methods = []; + let regexMatch; - // Skip existing core actions - if ([ - "send-sms", - "send-whatsapp-text-message", - "send-viber-text-message", - ].includes(dirName)) { - console.log(`⏭️ Skipping core action: ${dirName}`); - continue; - } + while ((regexMatch = methodPattern.exec(methodsContent)) !== null) { + const fullMethodText = regexMatch[0]; + const methodInfo = parseMethodInfo(fullMethodText); - const fullPath = path.join(this.actionsDir, dirName); - fs.rmSync(fullPath, { - recursive: true, - force: true, - }); - console.log(`🗑️ Removed: ${dirName}`); - cleanedCount++; - } + if (methodInfo && + !SKIP_METHODS.has(methodInfo.methodName) && + !existingActions.has(methodInfo.methodName)) { + methods.push(methodInfo); } + } - console.log(`✅ Cleaned ${cleanedCount} action directories`); - return cleanedCount; - } catch (error) { - console.error("❌ Error cleaning actions:", error.message); - throw error; + return methods; + } catch (error) { + console.error("Error extracting methods:", error.message); + return []; + } +} + +// Create action directory and file with proper error handling +async function createActionFile(methodInfo, openApiSpec) { + const actionKey = METHOD_TO_ACTION_KEY_MAP[methodInfo.methodName] || methodNameToKebabCase(methodInfo.methodName); + const actionDir = path.join(ACTIONS_DIR, actionKey); + const actionFile = path.join(actionDir, `${actionKey}.mjs`); + + try { + // Validate method info + if (!methodInfo.methodName || !methodInfo.summary) { + throw new Error("Invalid method info: missing required fields"); } + + // Extract OpenAPI parameters for this method + let openApiParams = {}; + if (openApiSpec && METHOD_TO_OPENAPI_MAP[methodInfo.methodName]) { + const { path: apiPath, method: httpMethod } = METHOD_TO_OPENAPI_MAP[methodInfo.methodName]; + openApiParams = extractOpenAPIParameters(openApiSpec, apiPath, httpMethod); + console.log(`📋 Extracted OpenAPI params for ${methodInfo.methodName}:`, { + pathParams: openApiParams.pathParams?.length || 0, + queryParams: openApiParams.queryParams?.length || 0, + bodyParams: Object.keys(openApiParams.bodyParams || {}).length, + }); + } + + // Create directory if it doesn't exist + await fs.mkdir(actionDir, { + recursive: true, + }); + + // Generate and write action file + const actionContent = generateActionFile(methodInfo, openApiParams); + + // Validate generated content + if (!actionContent || actionContent.trim().length === 0) { + throw new Error("Generated action content is empty"); + } + + await fs.writeFile(actionFile, actionContent, "utf8"); + + console.log(`✅ Created action: ${path.relative(process.cwd(), actionFile)}`); + return true; + } catch (error) { + console.error(`❌ Failed to create action for ${actionKey}:`, error.message); + return false; } } -// CLI Interface -async function main() { - const args = process.argv.slice(2); - const generator = new InfobipActionGenerator(); +// Main execution function +async function generateActions() { + console.log("🚀 Starting Infobip action generation with OpenAPI parameter extraction...\n"); try { - if (args.includes("--clean")) { - const pattern = args[args.indexOf("--clean") + 1]; - await generator.cleanActions(pattern); - return; + // Load OpenAPI specification + console.log("📖 Loading OpenAPI specification..."); + const openApiSpec = await loadOpenAPISpec(); + if (openApiSpec) { + console.log(`✅ Loaded OpenAPI spec version ${openApiSpec.info?.version || 'unknown'}\n`); + } else { + console.log("⚠️ Could not load OpenAPI spec, using fallback method detection\n"); } - const options = { - overwrite: args.includes("--overwrite") || args.includes("-f"), - filter: args.includes("--filter") - ? args[args.indexOf("--filter") + 1] - : null, - limit: args.includes("--limit") - ? parseInt(args[args.indexOf("--limit") + 1]) - : null, - }; + // Extract methods from enhanced app + const methods = await extractMethods(); - if (args.includes("--help") || args.includes("-h")) { - console.log(` -Infobip Action Generator - -Usage: - node generate-actions.mjs [options] - -Options: - --overwrite, -f Overwrite existing actions - --filter Only generate actions matching pattern - --limit Limit number of actions to generate - --clean [pattern] Clean action directories (optionally matching pattern) - --help, -h Show this help - -Examples: - node generate-actions.mjs - node generate-actions.mjs --overwrite --filter sms - node generate-actions.mjs --limit 5 - node generate-actions.mjs --clean infobip- - `); + if (methods.length === 0) { + console.log("✅ No new methods found to generate actions for. All methods already have corresponding actions."); return; } - const result = await generator.generateEnhancedActions(options); + console.log(`Found ${methods.length} methods to generate actions for:\n`); + + methods.forEach((method) => { + const actionKey = METHOD_TO_ACTION_KEY_MAP[method.methodName] || methodNameToKebabCase(method.methodName); + const hasOpenApiMapping = METHOD_TO_OPENAPI_MAP[method.methodName] ? "🔗" : "📝"; + console.log(` ${hasOpenApiMapping} ${method.methodName} → ${actionKey}`); + }); + + console.log("\n📝 Generating action files with explicit parameters...\n"); + + // Generate actions + let successCount = 0; + const errors = []; + + for (const method of methods) { + try { + const success = await createActionFile(method, openApiSpec); + if (success) { + successCount++; + } else { + errors.push(`Failed to create action for ${method.methodName}`); + } + } catch (error) { + errors.push(`Error creating action for ${method.methodName}: ${error.message}`); + } + } + + console.log("\n✨ Action generation complete!"); + console.log(`📊 Summary: ${successCount}/${methods.length} actions created successfully`); - if (result.generated > 0) { - console.log("\n🎉 Action generation completed successfully!"); + if (errors.length > 0) { + console.log("\n⚠️ Errors encountered:"); + errors.forEach((error) => console.log(` - ${error}`)); } + if (successCount > 0) { + console.log("\n🔧 Next steps:"); + console.log(" 1. Review the generated action files"); + console.log(" 2. Run ESLint to fix any formatting issues: npm run lint"); + console.log(" 3. Test the actions in your Pipedream workspace"); + console.log(" 4. Update descriptions and props as needed"); + } } catch (error) { - console.error("\n💥 Generation failed:", error.message); + console.error("❌ Fatal error during action generation:", error.message); + console.error(error.stack); process.exit(1); } } -// Export for use as module -export default InfobipActionGenerator; - -// Run if called directly +// Run the script if (import.meta.url === `file://${process.argv[1]}`) { - main().catch(console.error); + generateActions().catch(console.error); } + +export { + generateActions, +}; diff --git a/components/infobip/generate-app.mjs b/components/infobip/generate-app.mjs new file mode 100644 index 0000000000000..6307a4caf2cd4 --- /dev/null +++ b/components/infobip/generate-app.mjs @@ -0,0 +1,425 @@ +#!/usr/bin/env node + +// Script to generate Infobip app methods from OpenAPI specification +// Follows the standards defined in .claude/generate-actions.prompt.md +// Downloads OpenAPI spec and generates methods for infobip.app.mjs + +import fs from "fs"; +import https from "https"; + +// Configuration +const CONFIG = { + openApiUrl: "https://api.infobip.com/platform/1/openapi/sms", + openApiFile: "./openapi-spec.json", + appFile: "./infobip.app.mjs", + methodsStartMarker: " // Generated methods from Infobip SMS OpenAPI specification", + methodsEndMarker: " },", +}; + +class InfobipMethodGenerator { + constructor() { + this.generatedMethods = []; + this.methodCount = 0; + } + + // Download OpenAPI specification + async downloadOpenApiSpec() { + console.log("📡 Downloading OpenAPI specification..."); + + return new Promise((resolve, reject) => { + const file = fs.createWriteStream(CONFIG.openApiFile); + + https.get(CONFIG.openApiUrl, (response) => { + if (response.statusCode !== 200) { + reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`)); + return; + } + + response.pipe(file); + + file.on("finish", () => { + file.close(); + console.log("✅ OpenAPI specification downloaded successfully"); + resolve(); + }); + + file.on("error", (err) => { + fs.unlink(CONFIG.openApiFile, () => {}); // Clean up + reject(err); + }); + }).on("error", (err) => { + reject(err); + }); + }); + } + + // Read and parse OpenAPI specification + readOpenApiSpec() { + console.log("📖 Reading OpenAPI specification..."); + + if (!fs.existsSync(CONFIG.openApiFile)) { + throw new Error("OpenAPI specification file not found. Please download it first."); + } + + const content = fs.readFileSync(CONFIG.openApiFile, "utf8"); + const spec = JSON.parse(content); + + console.log(`✅ Found ${Object.keys(spec.paths || {}).length} API endpoints`); + return spec; + } + + // Convert operationId to camelCase method name + operationIdToCamelCase(operationId) { + if (!operationId) return null; + + return operationId + .split("-") + .map((word, index) => { + if (index === 0) return word.toLowerCase(); + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); + }) + .join(""); + } + + // Generate method name from summary if operationId not available + summaryToMethodName(summary) { + if (!summary) return "unknownMethod"; + + return summary + .toLowerCase() + .replace(/[^a-z0-9\s]/g, "") + .split(/\s+/) + .map((word, index) => { + if (index === 0) return word; + return word.charAt(0).toUpperCase() + word.slice(1); + }) + .join(""); + } + + // Generate JSDoc comment for method + generateJSDoc(operation, path) { + const summary = operation.summary || "API method"; + const description = operation.description || summary; + const externalDocs = operation.externalDocs?.url; + const hasRequestBody = operation.requestBody && Object.keys(operation.requestBody).length > 0; + const pathParams = this.extractPathParameters(path); + const queryParams = this.extractQueryParameters(operation); + + // Break long lines for better readability + const formatDescription = (text) => { + const words = text.split(" "); + const lines = []; + let currentLine = " * "; + + for (const word of words) { + if ((currentLine + word).length > 95) { + lines.push(currentLine.trimEnd()); + currentLine = " * " + word + " "; + } else { + currentLine += word + " "; + } + } + + if (currentLine.trim() !== "*") { + lines.push(currentLine.trimEnd()); + } + + return lines.join("\n"); + }; + + let jsDoc = ` /** + * ${summary} + * +${formatDescription(description)}`; + + if (externalDocs) { + jsDoc += `\n * + * @see {@link ${externalDocs}|External Documentation}`; + } + + jsDoc += `\n * + * @param {{ + * data?: object, // Request body${hasRequestBody + ? ", required" + : ", if applicable"}`; + + if (pathParams.length > 0) { + jsDoc += `\n * pathParams?: [{ + * name: string; + * value: string; + * }] // Path parameters: ${pathParams.join(", ")},`; + } + + if (queryParams.length > 0 || path.includes("query")) { + jsDoc += `\n * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters,`; + } + + jsDoc += `\n * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */`; + + return jsDoc; + } + + // Generate method implementation following the exact pattern from the prompt + generateMethodImplementation(methodName, path, httpMethod) { + // Check if path has parameters + const hasPathParams = path.includes("{"); + + let pathHandling; + if (hasPathParams) { + pathHandling = ` const { pathParams, pathQuery, ...rest } = opts; + // Example of paths: + // * /ct/1/log/end/{messageId} + // * /sms/3/messages + //* /whatsapp/{versionId}/message/template/{templateName} + let path = \`${path}\`; + pathParams.forEach(({ name, value }) => { + path = path.replace(\`{\${name}}\`, value); + }); + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += \`\${separator}\${name}=\${encodeURIComponent(value)}\`; + });`; + } else { + pathHandling = ` const { pathQuery, ...rest } = opts; + let path = "${path}"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += \`\${separator}\${name}=\${encodeURIComponent(value)}\`; + });`; + } + + return `${pathHandling} + + return this._makeRequest({ + method: "${httpMethod.toUpperCase()}", + path, + ...rest, + });`; + } + + // Extract path parameters from path + extractPathParameters(path) { + const matches = path.match(/{([^}]+)}/g); + return matches + ? matches.map((match) => match.slice(1, -1)) + : []; + } + + // Extract query parameters from operation + extractQueryParameters(operation) { + const parameters = operation.parameters || []; + return parameters + .filter((param) => param.in === "query") + .map((param) => param.name); + } + + // Generate complete method + generateMethod(path, httpMethod, operation) { + const operationId = operation.operationId; + const summary = operation.summary; + + // Generate method name + let methodName; + if (operationId) { + methodName = this.operationIdToCamelCase(operationId); + } else { + methodName = this.summaryToMethodName(summary); + } + + // Generate JSDoc + const jsDoc = this.generateJSDoc(operation, path, httpMethod); + + // Generate implementation + const implementation = this.generateMethodImplementation(methodName, path, httpMethod); + + return `${jsDoc} +${methodName}(opts = {}) { +${implementation} +}`; + } + + // Process OpenAPI specification and generate methods + generateMethodsFromSpec(spec) { + console.log("⚡ Generating methods from OpenAPI specification..."); + + const paths = spec.paths || {}; + const methods = []; + + for (const [ + path, + pathObj, + ] of Object.entries(paths)) { + for (const [ + httpMethod, + operation, + ] of Object.entries(pathObj)) { + if (typeof operation === "object" && operation.operationId) { + try { + const method = this.generateMethod(path, httpMethod, operation); + methods.push(method); + this.methodCount++; + } catch (error) { + console.warn(`⚠️ Skipped ${httpMethod.toUpperCase()} ${path}: ${error.message}`); + } + } + } + } + + console.log(`✅ Generated ${this.methodCount} methods`); + return methods; + } + + // Update the infobip.app.mjs file + updateAppFile(methods) { + console.log("📝 Updating infobip.app.mjs file..."); + + if (!fs.existsSync(CONFIG.appFile)) { + throw new Error(`App file not found: ${CONFIG.appFile}`); + } + + const content = fs.readFileSync(CONFIG.appFile, "utf8"); + const lines = content.split("\n"); + + // Find markers + const startIndex = lines.findIndex((line) => line.includes("Generated methods from Infobip")); + // Find the closing brace of the methods object + let endIndex = -1; + + for (let i = lines.length - 1; i >= 0; i--) { + if (lines[i].trim() === "};" && i > 0 && lines[i - 1].trim() === "},") { + endIndex = i - 1; // The " }," line + break; + } + } + + if (startIndex === -1) { + throw new Error("Could not find method start marker in app file"); + } + if (endIndex === -1) { + throw new Error("Could not find method end marker in app file. Looking for the methods object closing brace"); + } + + // Generate new content + const timestamp = new Date().toISOString(); + const methodsHeader = [ + "", + " // Generated methods from Infobip SMS OpenAPI specification", + ` // Total methods generated: ${this.methodCount}`, + ` // Generated on: ${timestamp}`, + "", + ]; + + // Combine everything + const methodLines = methods.map((method, index) => { + const isLast = index === methods.length - 1; + return method + (isLast + ? "" + : ","); + }).join("\n") + .split("\n"); + + const newLines = [ + ...lines.slice(0, startIndex), + ...methodsHeader, + ...methodLines, + "", + " },", + "};", + ]; + + // Write back to file + const newContent = newLines.join("\n"); + fs.writeFileSync(CONFIG.appFile, newContent, "utf8"); + + console.log(`✅ Updated ${CONFIG.appFile} with ${this.methodCount} methods`); + } + + // Clean up temporary files + cleanup() { + if (fs.existsSync(CONFIG.openApiFile)) { + fs.unlinkSync(CONFIG.openApiFile); + console.log("🧹 Cleaned up temporary files"); + } + } + + // Main generation process + async generate() { + try { + console.log("🚀 Starting Infobip method generation..."); + + // Download OpenAPI spec + await this.downloadOpenApiSpec(); + + // Read and parse spec + const spec = this.readOpenApiSpec(); + + // Generate methods + const methods = this.generateMethodsFromSpec(spec); + + // Update app file + this.updateAppFile(methods); + + // Keep OpenAPI spec for reference + + console.log("\n🎉 Method generation completed successfully!"); + console.log(`📊 Generated ${this.methodCount} methods from OpenAPI specification`); + + } catch (error) { + console.error("\n💥 Generation failed:", error.message); + throw error; + } + } +} + +// CLI Interface +async function main() { + const args = process.argv.slice(2); + + if (args.includes("--help") || args.includes("-h")) { + console.log(` +Infobip Method Generator + +Generates methods for infobip.app.mjs from OpenAPI specification. +Follows standards defined in .claude/generate-actions.prompt.md + +Usage: + node generate-app.mjs [options] + +Options: + --help, -h Show this help + +The script will: +1. Download the OpenAPI spec from ${CONFIG.openApiUrl} +2. Parse the specification and generate methods +3. Update ${CONFIG.appFile} with the new methods +4. Clean up temporary files + `); + return; + } + + const generator = new InfobipMethodGenerator(); + + try { + await generator.generate(); + } catch (error) { + console.error("\n💥 Generation failed:", error.message); + process.exit(1); + } +} + +// Export for use as module +export default InfobipMethodGenerator; + +// Run if called directly +if (import.meta.url === `file://${process.argv[1]}`) { + main().catch(console.error); +} diff --git a/components/infobip/generate-infobip-app.mjs b/components/infobip/generate-infobip-app.mjs deleted file mode 100644 index 584c3d1f3584f..0000000000000 --- a/components/infobip/generate-infobip-app.mjs +++ /dev/null @@ -1,470 +0,0 @@ -#!/usr/bin/env node - -// Enhanced script to fetch Infobip OpenAPI spec and update infobip-enhanced.app.mjs -// This script follows the standard patterns from infobip.app.mjs -// Usage: node update-infobip-app.mjs - -import fs from "fs"; -import InfobipOpenAPIGenerator from "./lib/openapi-generator.mjs"; - -// Configuration -const CONFIG = { - enhancedAppFile: "./infobip-enhanced.app.mjs", - backupSuffix: ".backup", - methodsStartMarker: " // OpenAPI Generated Methods - START", - methodsEndMarker: " // OpenAPI Generated Methods - END", - propsStartMarker: " // OpenAPI Generated Props - START", - propsEndMarker: " // OpenAPI Generated Props - END", -}; - -// Mock Infobip app instance for the generator -const mockApp = { - $auth: { - api_key: "test-key", - base_url: "https://api.infobip.com", - }, - async axios(config) { - const { default: axios } = await import("axios"); - return axios(config); - }, -}; - -/** - * Read the current enhanced app file - */ -function readEnhancedAppFile() { - if (!fs.existsSync(CONFIG.enhancedAppFile)) { - // Create a minimal app shell if file does not exist - const initialContent = `export default { - type: "app", - app: "infobip", - propDefinitions: { - // OpenAPI Generated Props - START - // OpenAPI Generated Props - END - }, - methods: { - // OpenAPI Generated Methods - START - // OpenAPI Generated Methods - END - }, -}; -`; - fs.writeFileSync(CONFIG.enhancedAppFile, initialContent); - console.log(`🆕 Created blank enhanced app file at: ${CONFIG.enhancedAppFile}`); - } - return fs.readFileSync(CONFIG.enhancedAppFile, "utf8"); -} - -/** - * Generate appropriate options example based on method and path - */ -function generateOptionsExample(method, path) { - const examples = []; - - // For POST methods that send messages - if (method === "POST" && (path.includes("/messages") || path.includes("/sms"))) { - examples.push(`{ - * data: { - * messages: [{ - * from: "InfoSMS", - * to: "41793026727", - * text: "Hello world!" - * }] - * } - * }`); - } - // For GET methods with query parameters - else if (method === "GET") { - const queryParams = []; - if (path.includes("/reports") || path.includes("/logs")) { - queryParams.push("limit: 10"); - if (path.includes("/reports")) { - queryParams.push("bulkId: 'bulk-id-123'"); - } - } - if (path.includes("/bulks")) { - queryParams.push("bulkId: 'bulk-id-123'"); - } - if (queryParams.length > 0) { - examples.push(`{ - * params: { - * ${queryParams.join(",\n * ")} - * } - * }`); - } else { - examples.push(`{ - * params: { - * limit: 50 - * } - * }`); - } - } - // For PUT methods (updates) - else if (method === "PUT") { - if (path.includes("/bulks/status")) { - examples.push(`{ - * data: { - * status: "PAUSED" - * } - * }`); - } else if (path.includes("/bulks")) { - examples.push(`{ - * data: { - * sendAt: "2024-12-25T10:00:00.000+01:00" - * } - * }`); - } - } - // For DELETE or other methods - else { - examples.push(`{ - * // Request options here - * }`); - } - - return examples.length > 0 - ? examples[0] - : null; -} - -/** - * Generate method implementations following infobip.app.mjs patterns - */ -function generateMethodImplementations(methods) { - const methodImpls = []; - - // Skip methods that already exist in the enhanced app to avoid duplicates - const skipMethods = new Set([ - "sendSmsMessage", // Already exists as enhanced wrapper - "messageId", // Already exists in props - ]); - - for (const [ - methodName, - methodInfo, - ] of Object.entries(methods)) { - if (skipMethods.has(methodName)) { - console.log(`⏭️ Skipping existing method: ${methodName}`); - continue; - } - const { - path, method, operation, - } = methodInfo; - - // Parse path parameters first - const pathParams = []; - const pathPattern = path.replace(/{([^}]+)}/g, (_, paramName) => { - pathParams.push(paramName); - return `\${${paramName}}`; - }); - - // Generate JSDoc comment with parameter examples - const jsdoc = []; - if (operation.summary || operation.description) { - jsdoc.push(" /**"); - if (operation.summary) { - jsdoc.push(` * ${operation.summary}`); - } - if (operation.description && operation.description !== operation.summary) { - jsdoc.push(" *"); - // Split long descriptions and wrap them properly - const desc = operation.description.replace(/\n/g, " ").trim(); - const words = desc.split(" "); - let line = " * "; - for (const word of words) { - if (line.length + word.length > 80) { - jsdoc.push(line.trim()); - line = " * " + word + " "; - } else { - line += word + " "; - } - } - if (line.trim() !== " *") { - jsdoc.push(line.trim()); - } - } - if (operation.externalDocs?.url) { - jsdoc.push(" *"); - jsdoc.push(` * @see ${operation.externalDocs.url}`); - } - - // Add parameter documentation with examples - jsdoc.push(" * @param {Object} opts - Request options"); - - // Generate example based on method and path - const exampleOpts = generateOptionsExample(method, path); - if (exampleOpts) { - jsdoc.push(" * @example"); - jsdoc.push(" * // Example usage:"); - if (pathParams.length > 0) { - const paramExample = pathParams.map((param) => `${param}: "example-${param}"`).join(", "); - jsdoc.push(` * await infobip.${methodName}({ ${paramExample}, ...otherOptions });`); - } else { - jsdoc.push(` * await infobip.${methodName}(${exampleOpts});`); - } - } - - jsdoc.push(" * @returns {Promise} API response"); - jsdoc.push(" */"); - } - - // Generate method implementation following infobip.app.mjs style - let methodImpl; - if (pathParams.length > 0) { - // Method with path parameters - destructure them from opts - const paramList = pathParams.join(", "); - methodImpl = ` ${methodName}({ ${paramList}, ...opts } = {}) { - return this._makeRequest({ - method: "${method}", - path: \`${pathPattern}\`, - ...opts, - }); - }`; - } else { - // Method without path parameters - standard pattern - methodImpl = ` ${methodName}(opts = {}) { - return this._makeRequest({ - method: "${method}", - path: "${path}", - ...opts, - }); - }`; - } - - // Combine JSDoc and implementation - const fullMethod = jsdoc.length > 0 - ? jsdoc.join("\n") + "\n" + methodImpl - : methodImpl; - - methodImpls.push(fullMethod); - } - - return methodImpls.join(",\n\n"); -} - -/** - * Generate prop definitions following infobip.app.mjs patterns - */ -function generatePropDefinitions() { - const propDefs = []; - - // Skip props that already exist in the enhanced app - const skipProps = new Set([ - "messageId", // Already exists in original props - ]); - - // Generate common props from the OpenAPI spec - const commonProps = { - bulkId: { - type: "string", - label: "Bulk ID", - description: "The ID which uniquely identifies the request for which the delivery reports are returned.", - }, - limit: { - type: "integer", - label: "Limit", - description: "Maximum number of messages to retrieve. Default is 50.", - optional: true, - }, - sendAt: { - type: "string", - label: "Send At", - description: "Date and time when the message is to be sent. Used for scheduling messages.", - optional: true, - }, - validityPeriod: { - type: "integer", - label: "Validity Period", - description: "The message validity period in minutes. How long the delivery will be attempted.", - optional: true, - }, - deliveryTimeWindow: { - type: "object", - label: "Delivery Time Window", - description: "Sets specific delivery window for sending messages.", - optional: true, - }, - flash: { - type: "boolean", - label: "Flash Message", - description: "Allows you to send a flash SMS to the destination number.", - optional: true, - }, - transliteration: { - type: "string", - label: "Transliteration", - description: "Conversion of a message text from one script to another.", - optional: true, - options: [ - "TURKISH", - "GREEK", - "CYRILLIC", - "SERBIAN_CYRILLIC", - "CENTRAL_EUROPEAN", - "BALTIC", - ], - }, - }; - - for (const [ - propName, - propDef, - ] of Object.entries(commonProps)) { - if (skipProps.has(propName)) { - console.log(`⏭️ Skipping existing prop: ${propName}`); - continue; - } - - const propLines = [ - ` ${propName}: {`, - ]; - propLines.push(` type: "${propDef.type}",`); - propLines.push(` label: "${propDef.label}",`); - propLines.push(` description: "${propDef.description}",`); - - if (propDef.optional) { - propLines.push(" optional: true,"); - } - if (propDef.options) { - propLines.push(` options: ${JSON.stringify(propDef.options)},`); - } - - propLines.push(" },"); - propDefs.push(propLines.join("\n")); - } - - return propDefs.join("\n"); -} - -/** - * Update the enhanced app file with new methods and props - */ -function updateEnhancedAppFile(content, methods, generator) { - let updatedContent = content; - - // Generate new method implementations - const newMethods = generateMethodImplementations(methods); - const methodsSection = `${CONFIG.methodsStartMarker} -${newMethods} - ${CONFIG.methodsEndMarker}`; - - // Generate new prop definitions - const newProps = generatePropDefinitions(generator); - const propsSection = `${CONFIG.propsStartMarker} -${newProps} - ${CONFIG.propsEndMarker}`; - - // Replace or add methods section - const methodsStartIndex = updatedContent.indexOf(CONFIG.methodsStartMarker); - const methodsEndIndex = updatedContent.indexOf(CONFIG.methodsEndMarker); - - if (methodsStartIndex !== -1 && methodsEndIndex !== -1) { - // Replace existing methods section - const before = updatedContent.substring(0, methodsStartIndex); - const after = updatedContent.substring(methodsEndIndex + CONFIG.methodsEndMarker.length); - updatedContent = before + methodsSection + after; - console.log("🔄 Updated existing methods section"); - } else { - // Add methods section before the closing bracket of the methods object - const methodsObjectEnd = updatedContent.lastIndexOf(" },\n};"); - if (methodsObjectEnd !== -1) { - const before = updatedContent.substring(0, methodsObjectEnd); - const after = updatedContent.substring(methodsObjectEnd); - updatedContent = before + "\n" + methodsSection + ",\n" + after; - console.log("➕ Added new methods section"); - } else { - throw new Error("Could not find methods object end to insert new methods"); - } - } - - // Replace or add props section - const propsStartIndex = updatedContent.indexOf(CONFIG.propsStartMarker); - const propsEndIndex = updatedContent.indexOf(CONFIG.propsEndMarker); - - if (propsStartIndex !== -1 && propsEndIndex !== -1) { - // Replace existing props section - const before = updatedContent.substring(0, propsStartIndex); - const after = updatedContent.substring(propsEndIndex + CONFIG.propsEndMarker.length); - updatedContent = before + propsSection + after; - console.log("🔄 Updated existing props section"); - } else { - // Add props section after the existing props - const propDefinitionsEnd = updatedContent.indexOf(" },\n methods:"); - if (propDefinitionsEnd !== -1) { - const before = updatedContent.substring(0, propDefinitionsEnd); - const after = updatedContent.substring(propDefinitionsEnd); - updatedContent = before + ",\n" + propsSection + "\n " + after; - console.log("➕ Added new props section"); - } else { - console.log("⚠️ Could not find props section location, skipping props update"); - } - } - - return updatedContent; -} - -/** - * Main function - */ -async function main() { - try { - console.log("🚀 Starting Infobip Enhanced App Update...\n"); - - // Read current enhanced app file - console.log("📖 Reading current enhanced app file..."); - const currentContent = readEnhancedAppFile(); - - // Initialize generator and fetch methods - console.log("📡 Fetching OpenAPI specification..."); - const generator = new InfobipOpenAPIGenerator(mockApp); - const { methods } = await generator.generateMethods(); - - console.log(`✅ Generated ${Object.keys(methods).length} methods from OpenAPI spec\n`); - - // Update the enhanced app file - console.log("🔧 Updating enhanced app file..."); - const updatedContent = updateEnhancedAppFile(currentContent, methods, generator); - - // Write updated file - fs.writeFileSync(CONFIG.enhancedAppFile, updatedContent); - console.log(`💾 Updated ${CONFIG.enhancedAppFile}`); - - // Summary - console.log("\n📋 Update Summary:"); - console.log("=".repeat(50)); - - const methodNames = Object.keys(methods); - console.log(`📊 Total methods: ${methodNames.length}`); - console.log(`📁 Updated file: ${CONFIG.enhancedAppFile}`); - console.log(`💾 Backup created: ${CONFIG.enhancedAppFile}${CONFIG.backupSuffix}`); - - console.log("\n🔍 Sample Generated Methods:"); - console.log("-".repeat(30)); - methodNames.slice(0, 5).forEach((name, index) => { - const method = methods[name]; - console.log(`${index + 1}. ${name}`); - console.log(` ${method.method} ${method.path}`); - if (method.operation.summary) { - console.log(` → ${method.operation.summary}`); - } - }); - - if (methodNames.length > 5) { - console.log(` ... and ${methodNames.length - 5} more methods`); - } - - console.log("\n✅ Enhanced app update completed successfully!"); - console.log("\n💡 Next steps:"); - console.log(" 1. Review the updated infobip-enhanced.app.mjs file"); - console.log(" 2. Test the new methods with your Infobip credentials"); - console.log(" 3. Run any linting/type checking if needed"); - console.log(" 4. Commit the changes when satisfied"); - - } catch (error) { - console.error("❌ Error updating enhanced app:", error.message); - console.error(error.stack); - process.exit(1); - } -} - -// Run the script -main(); diff --git a/components/infobip/infobip-enhanced.app.mjs b/components/infobip/infobip-enhanced.app.mjs deleted file mode 100644 index cd654fcf1569b..0000000000000 --- a/components/infobip/infobip-enhanced.app.mjs +++ /dev/null @@ -1,190 +0,0 @@ -export default { - type: "app", - app: "infobip", - propDefinitions: { - // OpenAPI Generated Props - START - bulkId: { - type: "string", - label: "Bulk ID", - description: "The ID which uniquely identifies the request for which the delivery reports are returned.", - }, - limit: { - type: "integer", - label: "Limit", - description: "Maximum number of messages to retrieve. Default is 50.", - optional: true, - }, - sendAt: { - type: "string", - label: "Send At", - description: "Date and time when the message is to be sent. Used for scheduling messages.", - optional: true, - }, - validityPeriod: { - type: "integer", - label: "Validity Period", - description: "The message validity period in minutes. How long the delivery will be attempted.", - optional: true, - }, - deliveryTimeWindow: { - type: "object", - label: "Delivery Time Window", - description: "Sets specific delivery window for sending messages.", - optional: true, - }, - flash: { - type: "boolean", - label: "Flash Message", - description: "Allows you to send a flash SMS to the destination number.", - optional: true, - }, - transliteration: { - type: "string", - label: "Transliteration", - description: "Conversion of a message text from one script to another.", - optional: true, - options: [ - "TURKISH", - "GREEK", - "CYRILLIC", - "SERBIAN_CYRILLIC", - "CENTRAL_EUROPEAN", - "BALTIC", - ], - }, - // OpenAPI Generated Props - END - }, - methods: { - // OpenAPI Generated Methods - START - /** - * Send SMS message - * -* With this API method, you can do anything from sending a basic message to -* one person, all the way to sending customized messages to thousands of -* recipients in one go. It comes with a range of useful features like -* transliteration, scheduling, and tracking in a unified way. - * - * @see https://www.infobip.com/docs/sms - * @param {Object} opts - Request options - * @example - * // Example usage: - * await infobip.sendSmsMessages({ - * data: { - * messages: [{ - * from: "InfoSMS", - * to: "41793026727", - * text: "Hello world!" - * }] - * } - * }); - * @returns {Promise} API response - */ - sendSmsMessages(opts = {}) { - return this._makeRequest({ - method: "POST", - path: "/sms/3/messages", - ...opts, - }); - }, - - /** - * Get outbound SMS message delivery reports - * -* If you are for any reason unable to receive real-time delivery reports on -* your endpoint, you can use this API method to learn if and when the -* message has been delivered to the recipient. - * - * @see https://www.infobip.com/docs/sms - * @param {Object} opts - Request options - * @example - * // Example usage: - * await infobip.getOutboundSmsMessageDeliveryReports({ - * params: { - * limit: 10, - * bulkId: 'bulk-id-123' - * } - * }); - * @returns {Promise} API response - */ - getOutboundSmsMessageDeliveryReports(opts = {}) { - return this._makeRequest({ - method: "GET", - path: "/sms/1/reports", - ...opts, - }); - }, - - /** - * Reschedule SMS messages - * -* Change the date and time of already scheduled messages. To schedule a -* message, use the sendAt field when sending a message. - * - * @see https://www.infobip.com/docs/sms - * @param {Object} opts - Request options - * @example - * // Example usage: - * await infobip.rescheduleSmsMessages({ - * data: { - * sendAt: "2024-12-25T10:00:00.000+01:00" - * } - * }); - * @returns {Promise} API response - */ - rescheduleSmsMessages(opts = {}) { - return this._makeRequest({ - method: "PUT", - path: "/sms/1/bulks", - ...opts, - }); - }, - - /** - * Update scheduled SMS messages status - * -* Change the status or completely cancel sending of scheduled messages. To -* schedule a message, use the sendAt field when sending a message. - * - * @see https://www.infobip.com/docs/sms - * @param {Object} opts - Request options - * @example - * // Example usage: - * await infobip.updateScheduledSmsMessagesStatus({ - * data: { - * status: "PAUSED" - * } - * }); - * @returns {Promise} API response - */ - updateScheduledSmsMessagesStatus(opts = {}) { - return this._makeRequest({ - method: "PUT", - path: "/sms/1/bulks/status", - ...opts, - }); - }, - - /** - * Confirm conversion - * -* Use this endpoint to inform the Infobip platform about the successful -* conversion on your side. Infobip will use this information to monitor SMS -* performance and provide you with better service. - * @param {Object} opts - Request options - * @example - * // Example usage: - * await infobip.logEndTag({ messageId: "example-messageId", ...otherOptions }); - * @returns {Promise} API response - */ - logEndTag({ - messageId, ...opts - } = {}) { - return this._makeRequest({ - method: "POST", - path: `/ct/1/log/end/${messageId}`, - ...opts, - }); - }, - // OpenAPI Generated Methods - END - }, -}; diff --git a/components/infobip/infobip.app.mjs b/components/infobip/infobip.app.mjs index 39a35e784cad2..47b3eadb9fc80 100644 --- a/components/infobip/infobip.app.mjs +++ b/components/infobip/infobip.app.mjs @@ -162,5 +162,600 @@ export default { path: `/resource-management/1/inbound-message-configurations/${webhookId}`, }); }, + + + // Generated methods from Infobip SMS OpenAPI specification + // Total methods generated: 16 + // Generated on: 2025-09-18T14:28:48.395Z + + /** + * Send SMS message + * + * With this API method, you can do anything from sending a basic message to one person, + * all the way to sending customized messages to thousands of recipients in one go. It + * comes with a range of useful features like transliteration, scheduling, and tracking in + * a unified way.\ +If utilizing Message Delivery Reports webhook, please consult the + * documentation provided at [Receive outbound SMS message + * reports](#channels/sms/receive-outbound-sms-message-report-v3).\ +This endpoint is the + * successor of [Send SMS message](#channels/sms/send-sms-message) and [Send binary SMS + * message](#channels/sms/send-binary-sms-message). + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, required + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +sendSmsMessages(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/3/messages"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "POST", + path, + ...rest, + }); +}, + /** + * Send SMS message over query parameters + * + * All message parameters of the message can be defined in the query string. Use this + * method only if [Send SMS message](#channels/sms/send-sms-messages) is not an option for + * your use case!
**Note:** Make sure that special characters are properly encoded. Use + * a [URL encoding reference](https://www.w3schools.com/tags/ref_urlencode.asp) as a guide. + * This endpoint is the successor of [Send SMS message over query + * parameters](#channels/sms/send-sms-message-over-query-parameters). + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +sendSmsMessagesOverQueryParameters(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/3/text/query"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Send SMS message over query parameters + * + * All message parameters of the message can be defined in the query string. Use this + * method only if [Send SMS message](#channels/sms/send-sms-message) is not an option for + * your use case!
**Note:** Make sure that special characters and user credentials are + * properly encoded. Use a [URL encoding + * reference](https://www.w3schools.com/tags/ref_urlencode.asp) as a guide. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +sendSmsMessageOverQueryParameters(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/text/query"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Preview SMS message + * + * Avoid unpleasant surprises and check how different message configurations will affect + * your message text, number of characters and message parts. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, required + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +previewSmsMessage(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/preview"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "POST", + path, + ...rest, + }); +}, + /** + * Send SMS message + * + * Use this endpoint to send an SMS and set up a rich set of features, such as batch + * sending with a single API request, scheduling, URL tracking, language and + * transliteration configuration, etc. The API response will not contain the final delivery + * status, use [Delivery + * Reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/receive-outbound-sms-message-report) + * instead.\ +In light of improved features, this endpoint has been superseded. Please visit + * [Send SMS message](#channels/sms/send-sms-messages) for the next version. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, required + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +sendSmsMessage(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/2/text/advanced"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "POST", + path, + ...rest, + }); +}, + /** + * Send binary SMS message + * + * Send single or multiple binary messages to one or more destination address. The API + * response will not contain the final delivery status, use [Delivery + * Reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/receive-outbound-sms-message-report) + * instead.\ +In light of improved features, this endpoint has been superseded. Please visit + * [Send SMS message](#channels/sms/send-sms-messages) for the next version. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, required + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +sendBinarySmsMessage(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/2/binary/advanced"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "POST", + path, + ...rest, + }); +}, + /** + * Get scheduled SMS messages + * + * See all [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms) + * and their scheduled date and time. To schedule a message, use the `sendAt` field when + * [sending a + * message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getScheduledSmsMessages(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/bulks"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Reschedule SMS messages + * + * Change the date and time of already [scheduled + * messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a + * message, use the `sendAt` field when [sending a + * message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, required + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +rescheduleSmsMessages(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/bulks"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "PUT", + path, + ...rest, + }); +}, + /** + * Get scheduled SMS messages status + * + * See the status of [scheduled + * messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a + * message, use the `sendAt` field when [sending a + * message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getScheduledSmsMessagesStatus(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/bulks/status"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Update scheduled SMS messages status + * + * Change the status or completely cancel sending of [scheduled + * messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a + * message, use the `sendAt` field when [sending a + * message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, required + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +updateScheduledSmsMessagesStatus(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/bulks/status"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "PUT", + path, + ...rest, + }); +}, + /** + * Confirm conversion + * + * Use this endpoint to inform the Infobip platform about the successful conversion on your + * side. Infobip will use this information to monitor SMS performance and provide you with + * better service. To enable Conversion Tracking, set up the “tracking” object to “SMS” + * when [sending a + * message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms) over + * HTTP API. +For more information, see: [Tracking + * Conversion](https://www.infobip.com/docs/sms/api#track-conversion). + * + * @param {{ + * data?: object, // Request body, if applicable + * pathParams?: [{ + * name: string; + * value: string; + * }] // Path parameters: messageId, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +logEndTag(opts = {}) { + const { pathParams, pathQuery, ...rest } = opts; + // Example of paths: + // * /ct/1/log/end/{messageId} + // * /sms/3/messages + //* /whatsapp/{versionId}/message/template/{templateName} + let path = `/ct/1/log/end/{messageId}`; + pathParams.forEach(({ name, value }) => { + path = path.replace(`{${name}}`, value); + }); + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "POST", + path, + ...rest, + }); +}, + /** + * Get inbound SMS messages + * + * If you are unable to receive incoming SMS to the endpoint of your choice in real-time, + * you can use this API call to fetch messages. Each request will return a batch of + * received messages, only once. The API request will only return new messages that arrived + * since the last API request. To use this method, you’d need to:
  1. Buy + * a number capable of receiving SMS traffic.
  2. Specify a forwarding endpoint for + * the number and optionally configure other inbound + * settings.
+ * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getInboundSmsMessages(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/inbox/reports"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Get outbound SMS message delivery reports + * + * If you are unable to receive real-time message delivery reports towards your endpoint + * for various reasons, we offer you an API method to fetch batches of message reports to + * confirm whether specific messages have been delivered. Each request towards this + * endpoint will return batches of the latest message reports. Please note they will be + * returned only once. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getOutboundSmsMessageDeliveryReportsV3(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/3/reports"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Get outbound SMS message logs + * + * Use this method to obtain the logs associated with outbound messages. The available logs + * are limited to those generated in the last 48 hours, and you can retrieve a maximum of + * only 1000 logs per call. See [message delivery + * reports](#channels/sms/get-outbound-sms-message-delivery-reports-v3) if your use case is + * to verify message delivery. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getOutboundSmsMessageLogsV3(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/3/logs"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Get outbound SMS message delivery reports + * + * If you are for any reason unable to receive real-time delivery reports on your endpoint, + * you can use this API method to learn if and when the message has been delivered to the + * recipient. Each request will return a batch of delivery reports - only once. The + * following API request will return only new reports that arrived since the last API + * request in the last 48 hours. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getOutboundSmsMessageDeliveryReports(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/reports"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +}, + /** + * Get outbound SMS message logs + * + * Use this method for displaying logs for example in the user interface. Available are the + * logs for the last 48 hours and you can only retrieve maximum of 1000 logs per call. See + * [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) if + * your use case is to verify message delivery. + * + * @see {@link https://www.infobip.com/docs/sms|External Documentation} + * + * @param {{ + * data?: object, // Request body, if applicable + * pathQuery?: [{ + * name: string; + * value: string; + * }] // Query parameters, + * ...rest - Other optional parameters + * }, + * }} [opts] - Optional parameters for the request. + * @returns {Promise} - Promise resolving to the API response. + */ +getOutboundSmsMessageLogs(opts = {}) { + const { pathQuery, ...rest } = opts; + let path = "/sms/1/logs"; + + pathQuery?.forEach(({ name, value }) => { + const separator = path.includes("?") ? "&" : "?"; + path += `${separator}${name}=${encodeURIComponent(value)}`; + }); + + return this._makeRequest({ + method: "GET", + path, + ...rest, + }); +} + }, -}; +}; \ No newline at end of file diff --git a/components/infobip/openapi-spec.json b/components/infobip/openapi-spec.json new file mode 100644 index 0000000000000..28795ff1122b7 --- /dev/null +++ b/components/infobip/openapi-spec.json @@ -0,0 +1,7381 @@ +{ + "openapi":"3.1.0", + "info":{ + "title":"Infobip OpenAPI Specification", + "description":"OpenAPI Specification that contains all public endpoints and webhooks.", + "contact":{ + "name":"Infobip support", + "email":"support@infobip.com" + }, + "version":"3.43.0", + "x-generatedAt":"2025-09-12T12:06:58.8258199Z" + }, + "tags":[ + { + "name":"channels", + "description":"Create a perfect customer experience by using the channels your customer already use and love.\n", + "x-type":"category", + "x-displayName":"Channels" + }, + { + "name":"sms", + "description":"SMS (Short Message Service) is the most extensive messaging service available in terms of reach and coverage. \nA SMS can be sent to and from any mobile device in the world and does not necessarily require a data connection.\n\nInfobip SMS API allows you to send and receive text messages (SMS), fetch\nor receive delivery reports on your endpoint in real time, and see message\nlogs. You can send messages in different languages, schedule your messages, define\ndelivery time window, and much more.\n\nTo utilize SMS in combination with other channels, check out [Messages API](https://www.infobip.com/docs/api/platform/messages-api).\n", + "x-type":"product", + "x-displayName":"SMS" + }, + { + "name":"outbound-sms", + "description":"When you send an SMS to a phone number belonging to an end user's device you are \nsending an Outbound SMS. Historically, this was and still is referred to as a Mobile Terminated (MT) SMS, \nthough nowadays an SMS is not always sent to a mobile device.\nIn an Outbound SMS you can set the From or Sender field with whatever you have registered or \npurchased with Infobip, either a Long Number, Short Code, or text based Sender.\n", + "x-type":"module", + "x-displayName":"Outbound SMS" + }, + { + "name":"send-message", + "description":"", + "x-type":"section", + "x-displayName":"Send a message" + }, + { + "name":"manage-scheduled-sms-messages", + "description":"", + "x-type":"section", + "x-displayName":"Manage Scheduled SMS Messages" + }, + { + "name":"confirm-conversion", + "description":"", + "x-type":"section", + "x-displayName":"Confirm conversion" + }, + { + "name":"inbound-sms", + "description":"When an end user sends an SMS from their device to a Phone Number or Short Code they \nhave sent an Inbound SMS. The Inbound SMS is routed to the Infobip Platform and Infobip \nin turn routes the SMS to its Customer who has purchased that Phone Number or Short Code. \nInbound SMS, for historical reasons, are referred to as Mobile Originated (MO) SMS.\n", + "x-type":"module", + "x-displayName":"Inbound SMS" + }, + { + "name":"logs-and-status-reports", + "description":"Status Reports tell you what happened to the SMS you sent, whether it was successfully delivered or failed to be delivered.\nThey also provide timestamps, network information if available, and on SMS delivery failure, a status code indicating the reason. \nStatus Reports can be pushed in real-time to a Customer's webhook or can be retrieved by an API call. \nLogs provide similar information to Status Reports but are available to query for 48hrs.\n", + "x-type":"module", + "x-displayName":"Logs and Status Reports" + } + ], + "paths":{ + "/sms/3/messages":{ + "post":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "send-message" + ], + "summary":"Send SMS message", + "description":"With this API method, you can do anything from sending a basic message to one person, all the way to sending customized messages to thousands of recipients in one go. It comes with a range of useful features like transliteration, scheduling, and tracking in a unified way.\\\nIf utilizing Message Delivery Reports webhook, please consult the documentation provided at [Receive outbound SMS message reports](#channels/sms/receive-outbound-sms-message-report-v3).\\\nThis endpoint is the successor of [Send SMS message](#channels/sms/send-sms-message) and [Send binary SMS message](#channels/sms/send-binary-sms-message).", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"send-sms-messages", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsRequestEnvelope" + }, + "examples":{ + "Send basic textual message":{ + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "text":"This is a sample message" + } + } + ] + } + }, + "Send fully-featured textual message":{ + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727", + "messageId":"MESSAGE-ID-123-xyz" + }, + { + "to":"41793026834" + } + ], + "content":{ + "text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.", + "transliteration":"TURKISH", + "language":{ + "languageCode":"TR" + } + }, + "options":{ + "validityPeriod":{ + "amount":720, + "timeUnit":"HOURS" + }, + "campaignReferenceId":"summersale" + }, + "webhooks":{ + "delivery":{ + "url":"https://www.example.com/sms/advanced", + "intermediateReport":true + }, + "contentType":"application/json", + "callbackData":"DLR callback data" + } + }, + { + "sender":"41793026700", + "destinations":[ + { + "to":"41793026700" + } + ], + "content":{ + "text":"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire." + }, + "options":{ + "deliveryTimeWindow":{ + "days":[ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "from":{ + "hour":6, + "minute":0 + }, + "to":{ + "hour":15, + "minute":30 + } + } + } + } + ], + "options":{ + "schedule":{ + "bulkId":"BULK-ID-123-xyz", + "sendAt":"2021-08-24T15:00:00.000+0000" + }, + "tracking":{ + "shortenUrl":true, + "trackClicks":true, + "trackingUrl":"https://example.com/click-report", + "removeProtocol":true, + "customDomain":"example.com" + }, + "includeSmsCountInResponse":true, + "conversionTracking":{ + "useConversionTracking":true, + "conversionTrackingName":"MY_CAMPAIGN" + } + } + } + }, + "Send flash textual message":{ + "description":"Send a message that will pop-up on the user's phone", + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "text":"Toto, I've got a feeling we're not in Kansas anymore." + }, + "options":{ + "flash":true + } + } + ] + } + }, + "SMS language":{ + "description":"Crossing SMS language barriers with the National Language Identifier for Turkish, Spanish and Portuguese", + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.", + "language":{ + "languageCode":"TR" + } + } + } + ] + } + }, + "SMS transliteration":{ + "description":"Send full-size messages in original language alphabet using transliteration conversion", + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "text":"Ως Μεγαρικό ψήφισμα είνα…ι καθολικό εμπάργκο στα", + "transliteration":"GREEK" + } + } + ] + } + }, + "Platform features":{ + "description":"Parts of the SMS message, such as message sender, will be customized in accordance with provided application and entity ids. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "text":"Custom application and entity based rules will be applied to this message" + }, + "options":{ + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + } + } + } + ] + } + }, + "Send Basic India DLT message":{ + "description":"Send a message with India DLT parameters included", + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "text":"India DLT parameters will be applied in this message" + }, + "options":{ + "regional":{ + "indiaDlt":{ + "contentTemplateId":"1111111111111111111", + "principalEntityId":"1111111111111111112", + "telemarketerId":"111111111111" + } + } + } + } + ] + } + }, + "Send fully-featured binary SMS message":{ + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727", + "messageId":"MESSAGE-ID-123-xyz" + }, + { + "to":"41793026834" + } + ], + "content":{ + "dataCoding":0, + "esmClass":0, + "hex":"54 65 73 74 20 6d 65 73 73 61 67 65 2e" + }, + "options":{ + "validityPeriod":{ + "amount":720, + "timeUnit":"HOURS" + } + }, + "webhooks":{ + "delivery":{ + "url":"https://www.example.com/sms/advanced", + "intermediateReport":true + }, + "contentType":"application/json", + "callbackData":"DLR callback data" + } + }, + { + "sender":"41793026700", + "destinations":[ + { + "to":"41793026700" + } + ], + "content":{ + "dataCoding":0, + "esmClass":0, + "hex":"41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E" + }, + "options":{ + "deliveryTimeWindow":{ + "days":[ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "from":{ + "hour":6, + "minute":0 + }, + "to":{ + "hour":15, + "minute":30 + } + }, + "campaignReferenceId":"summersale" + } + } + ], + "options":{ + "schedule":{ + "bulkId":"BULK-ID-123-xyz", + "sendAt":"2021-08-23T14:00:00.000+0000" + } + } + } + }, + "Send Unicode flash binary SMS message":{ + "value":{ + "messages":[ + { + "sender":"InfoSMS", + "destinations":[ + { + "to":"41793026727" + } + ], + "content":{ + "dataCoding":8, + "esmClass":0, + "hex":"0048 0065 006c 006c 006f 0020 0077 006f 0072 006c 0064 002c 0020 039a 03b1 03bb 03b7 03bc 03ad 03c1 03b1 0020 03ba 03cc 03c3 03bc 03b5 002c 0020 30b3 30f3 30cb 30c1 30cf" + }, + "options":{ + "flash":true + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsRequestEnvelope" + }, + "examples":{ + "Send basic textual message":{ + "value":"\n \n \n InfoSMS\n \n This is a sample message\n \n \n \n 41793026727\n \n \n \n \n\n" + }, + "Send fully-featured textual message":{ + "value":"\n \n \n BULK-ID-123-xyz\n 2021-08-24T15:00:00.000+0000\n \n \n true\n true\n https://example.com/click-report\n true\n example.com\n \n true\n \n true\n MY_CAMPAIGN\n \n \n \n \n InfoSMS\n \n Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.\n TURKISH\n \n TR\n \n \n \n \n 720\n HOURS\n \n summersale\n \n \n \n https://www.example.com/sms/advanced\n true\n \n application/json\n DLR callback data\n \n \n \n 41793026727\n MESSAGE-ID-123-xyz\n \n \n 41793026834\n \n \n \n \n 41793026700\n \n A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\n \n \n \n \n MONDAY\n TUESDAY\n WEDNESDAY\n THURSDAY\n FRIDAY\n SATURDAY\n SUNDAY\n \n \n 6\n 0\n \n \n 15\n 30\n \n \n \n \n \n 41793026700\n \n \n \n \n\n" + }, + "Send flash textual message":{ + "description":"Send a message that will pop-up on the user's phone", + "value":"\n \n \n InfoSMS\n \n Toto, I've got a feeling we're not in Kansas anymore.\n \n \n true\n \n \n \n 41793026727\n \n \n \n \n\n" + }, + "SMS language":{ + "description":"Crossing SMS language barriers with the National Language Identifier for Turkish, Spanish and Portuguese", + "value":"\n \n \n InfoSMS\n \n Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.\n \n TR\n \n \n \n \n 41793026727\n \n \n \n \n\n" + }, + "SMS transliteration":{ + "description":"Send full-size messages in original language alphabet using transliteration conversion", + "value":"\n \n \n InfoSMS\n \n Ως Μεγαρικό ψήφισμα είνα…ι καθολικό εμπάργκο στα\n GREEK\n \n \n \n 41793026727\n \n \n \n \n\n" + }, + "Platform features":{ + "description":"Parts of the SMS message, such as message sender, will be customized in accordance with provided application and entity ids. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "value":"\n \n \n \n Custom application and entity based rules will be applied to this message\n \n \n \n promotional-traffic-entity\n marketing-automation-application\n \n \n \n \n 41793026727\n \n \n \n \n\n" + }, + "Send Basic India DLT message":{ + "description":"Send a message with India DLT parameters included", + "value":"\n \n \n InfoSMS\n \n India DLT parameters will be applied in this message\n \n \n \n \n 1111111111111111111\n 1111111111111111112\n 111111111111\n \n \n \n \n \n 41793026727\n \n \n \n \n\n" + }, + "Send fully-featured binary SMS message":{ + "value":"\n \n \n BULK-ID-123-xyz\n 2021-08-23T14:00:00.000+0000\n \n \n \n \n InfoSMS\n \n 0\n 0\n 54 65 73 74 20 6d 65 73 73 61 67 65 2e\n \n \n \n 720\n HOURS\n \n \n \n \n https://www.example.com/sms/advanced\n true\n \n application/json\n DLR callback data\n \n \n \n 41793026727\n MESSAGE-ID-123-xyz\n \n \n 41793026834\n \n \n \n \n 41793026700\n \n 0\n 0\n 41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E\n \n \n \n \n MONDAY\n TUESDAY\n WEDNESDAY\n THURSDAY\n FRIDAY\n SATURDAY\n SUNDAY\n \n \n 6\n 0\n \n \n 15\n 30\n \n \n summersale\n \n \n \n 41793026700\n \n \n \n \n\n" + }, + "Send Unicode flash binary SMS message":{ + "value":"\n \n \n InfoSMS\n \n 8\n 0\n 0048 0065 006c 006c 006f 0020 0077 006f 0072 006c 0064 002c 0020 039a 03b1 03bb 03b7 03bc 03ad 03c1 03b1 0020 03ba 03cc 03c3 03bc 03b5 002c 0020 30b3 30f3 30cb 30c1 30cf\n \n \n true\n \n \n \n 41793026727\n \n \n \n \n\n" + } + } + } + }, + "required":true + }, + "responses":{ + "200":{ + "description":"OK", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsResponseEnvelope" + }, + "examples":{ + "Response for request with one destination":{ + "value":{ + "bulkId":"2034072219640523072", + "messages":[ + { + "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2", + "status":{ + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED", + "description":"Message sent to next instance" + }, + "destination":"41793026727", + "details":{ + "messageCount":1 + } + } + ] + } + }, + "Response for request with multiple destinations":{ + "value":{ + "bulkId":"2034072219640523072", + "messages":[ + { + "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2", + "status":{ + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED", + "description":"Message sent to next instance" + }, + "destination":"41793026727", + "details":{ + "messageCount":1 + } + }, + { + "messageId":"3350be2d4219-3af1-23343-bbbb-1362af1edfd3", + "status":{ + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED", + "description":"Message sent to next instance" + }, + "destination":"41435675123", + "details":{ + "messageCount":1 + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsResponseEnvelope" + }, + "examples":{ + "Response for request with one destination":{ + "value":"\n 2034072219640523072\n \n \n 2250be2d4219-3af1-78856-aabe-1362af1edfd2\n \n 1\n PENDING\n 26\n PENDING_ACCEPTED\n Message sent to next instance\n \n 41793026727\n
\n 1\n
\n
\n
\n
\n" + }, + "Response for request with multiple destinations":{ + "value":"\n 2034072219640523072\n \n \n 2250be2d4219-3af1-78856-aabe-1362af1edfd2\n \n 1\n PENDING\n 26\n PENDING_ACCEPTED\n Message sent to next instance\n \n 41793026727\n
\n 1\n
\n
\n \n 3350be2d4219-3af1-23343-bbbb-1362af1edfd3\n \n 1\n PENDING\n 26\n PENDING_ACCEPTED\n Message sent to next instance\n \n 41435675123\n
\n 1\n
\n
\n
\n
\n" + } + } + } + } + }, + "400":{ + "description":"Bad Request", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "examples":{ + "Bad request":{ + "value":{ + "errorCode":"E400", + "description":"Request cannot be processed.", + "action":"Check the syntax, violations and adjust the request.", + "violations":[ + { + "property":"property.path", + "violation":"Violation message." + } + ], + "resources":[] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "examples":{ + "Bad request":{ + "value":"\n E400\n Request cannot be processed.\n Check the syntax, violations and adjust the request.\n \n \n property.path\n Violation message.\n \n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiError401" + }, + "403":{ + "$ref":"#/components/responses/ApiError403" + }, + "500":{ + "$ref":"#/components/responses/ApiError500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-additionalInfo":{ + "markdown":"### Related\n- [Activate Verified SMS - get look and feel of chat apps on SMS communication](https://www.infobip.com/docs/sms/verified-sms)\n- [Buy numbers for sending and receiving messages](#platform-&-connectivity/numbers)\n" + }, + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"send-sms-messages" + }, + { + "versionNumber":2, + "latest":false, + "operationId":"send-sms-message" + }, + { + "versionNumber":2, + "latest":false, + "operationId":"send-binary-sms-message" + } + ] + } + }, + "/sms/3/text/query":{ + "get":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "send-message" + ], + "summary":"Send SMS message over query parameters", + "description":"All message parameters of the message can be defined in the query string. Use this method only if [Send SMS message](#channels/sms/send-sms-messages) is not an option for your use case!
**Note:** Make sure that special characters are properly encoded. Use a [URL encoding reference](https://www.w3schools.com/tags/ref_urlencode.asp) as a guide. This endpoint is the successor of [Send SMS message over query parameters](#channels/sms/send-sms-message-over-query-parameters).", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"send-sms-messages-over-query-parameters", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "maxLength":100, + "minLength":0 + } + }, + { + "name":"from", + "in":"query", + "description":"The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"InfoSMS" + }, + { + "name":"to", + "in":"query", + "description":"List of message recipients.", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"41793026727,41793026834" + }, + { + "name":"text", + "in":"query", + "description":"Content of the message being sent.", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"Message text" + }, + { + "name":"flash", + "in":"query", + "description":"Sends a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) if set to true.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"boolean" + }, + "example":true + }, + { + "name":"transliteration", + "in":"query", + "description":"Conversion of a message text from one script to another.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"TURKISH" + }, + { + "name":"languageCode", + "in":"query", + "description":"Code for language character set of a message content.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"TR" + }, + { + "name":"intermediateReport", + "in":"query", + "description":"Use a [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report-v3) that will be sent on your callback server.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"boolean" + }, + "example":true + }, + { + "name":"notifyUrl", + "in":"query", + "description":"The URL on your call back server on to which a delivery report will be sent.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"https://www.example.com" + }, + { + "name":"notifyContentType", + "in":"query", + "description":"Preferred delivery report content type, `application/json` or `application/xml`.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"application/json" + }, + { + "name":"callbackData", + "in":"query", + "description":"Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports-v3). The maximum value is 4000 characters.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "maxLength":4000, + "minLength":0 + }, + "example":"callbackData" + }, + { + "name":"validityPeriod", + "in":"query", + "description":"The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + }, + "example":720 + }, + { + "name":"sendAt", + "in":"query", + "description":"Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. Must be sooner than 180 days from now.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "format":"date-time" + } + }, + { + "name":"includeSmsCountInResponse", + "in":"query", + "description":"Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. ", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"boolean" + } + }, + { + "name":"trackingUrl", + "in":"query", + "description":"The URL of your callback server on to which the Click report will be sent.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"trackingType", + "in":"query", + "description":"Sets a custom conversion type naming convention, e.g. ONE_TIME_PIN, SOCIAL_INVITES, etc.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"Custom tracking type" + }, + { + "name":"indiaDltContentTemplateId", + "in":"query", + "description":"The ID of your registered DLT (Distributed Ledger Technology) content template.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"1111111111111111111" + }, + { + "name":"indiaDltPrincipalEntityId", + "in":"query", + "description":"Your DLT (Distributed Ledger Technology) entity id.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"1111111111111111112" + }, + { + "name":"indiaDltTelemarketerId", + "in":"query", + "description":"Your assigned Telemarketer ID. (required for Aggregators)", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":111111111111 + }, + { + "name":"turkeyIysBrandCode", + "in":"query", + "description":"Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + } + }, + { + "name":"turkeyIysRecipientType", + "in":"query", + "description":"Recipient Type must be TACIR or BIREYSEL", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"southKoreaResellerCode", + "in":"query", + "description":"Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + } + }, + { + "name":"southKoreaTitle", + "in":"query", + "description":"Title of the message.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "description":"Title of the message.", + "maxLength":66, + "minLength":0 + } + } + ], + "responses":{ + "200":{ + "description":"Successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsResponseEnvelope" + }, + "examples":{ + "Response for request with one destination":{ + "value":{ + "bulkId":"2034072219640523072", + "messages":[ + { + "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2", + "status":{ + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED", + "description":"Message sent to next instance" + }, + "destination":"41793026727", + "details":{ + "messageCount":1 + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsResponseEnvelope" + }, + "examples":{ + "Response for request with one destination":{ + "value":"\n 2034072219640523072\n \n \n 2250be2d4219-3af1-78856-aabe-1362af1edfd2\n \n 1\n PENDING\n 26\n PENDING_ACCEPTED\n Message sent to next instance\n \n 41793026727\n
\n 1\n
\n
\n
\n
\n" + } + } + } + } + }, + "400":{ + "description":"Bad Request", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "examples":{ + "Bad request":{ + "value":{ + "errorCode":"E400", + "description":"Request cannot be processed.", + "action":"Check the syntax, violations and adjust the request.", + "violations":[ + { + "property":"property.path", + "violation":"Violation message." + } + ], + "resources":[] + } + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiError401" + }, + "403":{ + "$ref":"#/components/responses/ApiError403" + }, + "500":{ + "$ref":"#/components/responses/ApiError500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-additionalInfo":{ + "markdown":"### Related\n- [Activate Verified SMS - get look and feel of chat apps on SMS communication](https://www.infobip.com/docs/sms/verified-sms)\n- [Buy numbers for sending and receiving messages](#platform-&-connectivity/numbers)\n" + }, + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"send-sms-messages-over-query-parameters" + }, + { + "versionNumber":1, + "latest":false, + "operationId":"send-sms-message-over-query-parameters" + } + ] + } + }, + "/sms/1/text/query":{ + "get":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "send-message" + ], + "summary":"Send SMS message over query parameters", + "description":"All message parameters of the message can be defined in the query string. Use this method only if [Send SMS message](#channels/sms/send-sms-message) is not an option for your use case!
**Note:** Make sure that special characters and user credentials are properly encoded. Use a [URL encoding reference](https://www.w3schools.com/tags/ref_urlencode.asp) as a guide.", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"send-sms-message-over-query-parameters", + "parameters":[ + { + "name":"username", + "in":"query", + "description":"Username for authentication.", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"password", + "in":"query", + "description":"Password for authentication.", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"bulkId", + "in":"query", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Anything above 100 characters passed in the request will be clipped during processing and returned in response, reports and logs.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"from", + "in":"query", + "description":"The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"InfoSMS" + }, + { + "name":"to", + "in":"query", + "description":"List of message recipients.", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"41793026727,41793026834" + }, + { + "name":"text", + "in":"query", + "description":"Content of the message being sent.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"Message text" + }, + { + "name":"flash", + "in":"query", + "description":"Sends a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) if set to true.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"boolean" + }, + "example":true + }, + { + "name":"transliteration", + "in":"query", + "description":"Conversion of a message text from one script to another.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"TURKISH" + }, + { + "name":"languageCode", + "in":"query", + "description":"Code for language character set of a message content.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"TR" + }, + { + "name":"intermediateReport", + "in":"query", + "description":"Use a [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) that will be sent on your callback server.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"boolean" + }, + "example":true + }, + { + "name":"notifyUrl", + "in":"query", + "description":"The URL on your call back server on to which a delivery report will be sent.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"https://www.example.com" + }, + { + "name":"notifyContentType", + "in":"query", + "description":"Preferred delivery report content type, `application/json` or `application/xml`.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"application/json" + }, + { + "name":"callbackData", + "in":"query", + "description":"Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "maxLength":4000, + "minLength":0 + }, + "example":"callbackData" + }, + { + "name":"validityPeriod", + "in":"query", + "description":"The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int64" + }, + "example":720 + }, + { + "name":"sendAt", + "in":"query", + "description":"Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. Must be sooner than 180 days from now.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "format":"date-time" + } + }, + { + "name":"track", + "in":"query", + "description":"Sets the conversion element to be tracked. Possible values: `SMS` and `URL`. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"URL" + }, + { + "name":"processKey", + "in":"query", + "description":"The process key which uniquely identifies conversion tracking.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"trackingType", + "in":"query", + "description":"Sets a custom conversion type naming convention, e.g. ONE_TIME_PIN, SOCIAL_INVITES, etc.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"Custom tracking type" + }, + { + "name":"indiaDltContentTemplateId", + "in":"query", + "description":"The ID of your registered DLT (Distributed Ledger Technology) content template.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"1111111111111111111" + }, + { + "name":"indiaDltPrincipalEntityId", + "in":"query", + "description":"Your DLT (Distributed Ledger Technology) entity id.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"1111111111111111112" + }, + { + "name":"indiaDltTelemarketerId", + "in":"query", + "description":"Your assigned Telemarketer ID. (required for Aggregators)", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":111111111111 + }, + { + "name":"turkeyIysBrandCode", + "in":"query", + "description":"Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + } + }, + { + "name":"turkeyIysRecipientType", + "in":"query", + "description":"Recipient Type must be TACIR or BIREYSEL", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"southKoreaResellerCode", + "in":"query", + "description":"Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + } + } + ], + "responses":{ + "200":{ + "description":"Successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/cb1ef9a380a46bb9d49281818dd22b206a7f89260670bd103daadd3abc4386a3.QuerySmsResponse" + }, + "examples":{ + "Response for request with one destination":{ + "value":{ + "bulkId":"2034072219640523072", + "messages":[ + { + "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ENROUTE" + }, + "to":"41793026727", + "smsCount":1 + } + ] + } + }, + "Response for request with multiple destinations":{ + "value":{ + "bulkId":"2034072219640523073", + "messages":[ + { + "messageId":"2033247207850523791", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ENROUTE" + }, + "to":"41793026727", + "smsCount":1 + }, + { + "messageId":"2033247207850523792", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ENROUTE" + }, + "to":"41793026834", + "smsCount":1 + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/cb1ef9a380a46bb9d49281818dd22b206a7f89260670bd103daadd3abc4386a3.QuerySmsResponse" + }, + "examples":{ + "Response for request with one destination":{ + "value":"\n 2034072219640523072\n \n \n 2250be2d4219-3af1-78856-aabe-1362af1edfd2\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ENROUTE\n \n 41793026727\n 1\n \n \n\n" + }, + "Response for request with multiple destinations":{ + "value":"\n 2034072219640523073\n \n \n 2033247207850523791\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ENROUTE\n \n 41793026727\n 1\n \n \n 2033247207850523792\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ENROUTE\n \n 41793026834\n 1\n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "deprecated":true, + "security":[], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-deprecationInformation":{ + "deprecation":"2024-10-09T12:00:00.00+0000", + "successorOperationId":"send-sms-messages-over-query-parameters" + }, + "x-additionalInfo":{ + "markdown":"### Related\n- [Activate Verified SMS - get look and feel of chat apps on SMS communication](https://www.infobip.com/docs/sms/verified-sms)\n- [Buy numbers for sending and receiving messages](#platform-&-connectivity/numbers)\n" + }, + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"send-sms-messages-over-query-parameters" + }, + { + "versionNumber":1, + "latest":false, + "operationId":"send-sms-message-over-query-parameters" + } + ] + } + }, + "/sms/1/preview":{ + "post":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "send-message" + ], + "summary":"Preview SMS message", + "description":"Avoid unpleasant surprises and check how different message configurations will affect your message text, number of characters and message parts.", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"preview-sms-message", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/01e84c3b4dd6fb6c49761ac60f0bbc50e5117905a6beb7547645113e59aaeb46.PreviewRequest" + }, + "examples":{ + "Preview message count and remaining characters":{ + "description":"Use this method to check how many characters are left in your message and if it fits into one or more messages.", + "value":{ + "text":"Let's see how many characters remain unused in this message." + } + }, + "Preview with message language":{ + "description":"In this example we will request a message preview for Turkish language by introducing the languageCode parameter.", + "value":{ + "text":"Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.", + "languageCode":"TR" + } + }, + "Preview with transliteration":{ + "description":"Transliteration is a technique that replaces the original special characters", + "value":{ + "text":"Ως Μεγαρικό ψήφισμα είναι γνωστή η απόφαση της Εκκλησίας του δήμου των Αθηναίων (πιθανόν γύρω στο 433/2 π.Χ.) να επιβάλει αυστηρό και καθολικό εμπάργκο στα", + "transliteration":"GREEK" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/01e84c3b4dd6fb6c49761ac60f0bbc50e5117905a6beb7547645113e59aaeb46.PreviewRequest" + }, + "examples":{ + "Preview message count and remaining characters":{ + "description":"Use this method to check how many characters are left in your message and if it fits into one or more messages.", + "value":"\n Let's see how many characters remain unused in this message.\n\n" + }, + "Preview with message language":{ + "description":"In this example we will request a message preview for Turkish language by introducing the languageCode parameter.", + "value":"\n Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.\n TR\n\n" + }, + "Preview with transliteration":{ + "description":"Transliteration is a technique that replaces the original special characters", + "value":"\n Ως Μεγαρικό ψήφισμα είναι γνωστή η απόφαση της Εκκλησίας του δήμου των Αθηναίων (πιθανόν γύρω στο 433/2 π.Χ.) να επιβάλει αυστηρό και καθολικό εμπάργκο στα\n GREEK\n\n" + } + } + } + }, + "required":true + }, + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/b888d833f5e2077036527211f9d9a5502285e1c742cd8459a9d3ad85cb1fa1f5.PreviewResponse" + }, + "examples":{ + "Preview response":{ + "value":{ + "originalText":"Let's see how many characters remain unused in this message.", + "previews":[ + { + "textPreview":"Let's see how many characters remain unused in this message.", + "messageCount":1, + "charactersRemaining":100, + "configuration":{} + } + ] + } + }, + "Preview response for request with message language":{ + "value":{ + "originalText":"Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.", + "previews":[ + { + "textPreview":"Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.", + "messageCount":2, + "charactersRemaining":36, + "configuration":{} + }, + { + "textPreview":"Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.", + "messageCount":1, + "charactersRemaining":57, + "configuration":{ + "language":{ + "languageCode":"TR" + } + } + } + ] + } + }, + "Preview response for request with transliteration":{ + "value":{ + "originalText":"Ως Μεγαρικό ψήφισμα είναι γνωστή η απόφαση της Εκκλησίας του δήμου των Αθηναίων (πιθανόν γύρω στο 433/2 π.Χ.) να επιβάλει αυστηρό και καθολικό εμπάργκο στα.", + "previews":[ + { + "textPreview":"Ως Μεγαρικό ψήφισμα είναι γνωστή η απόφαση της Εκκλησίας του δήμου των Αθηναίων (πιθανόν γύρω στο 433/2 π.Χ.) να επιβάλει αυστηρό και καθολικό εμπάργκο στα", + "messageCount":3, + "charactersRemaining":46, + "configuration":{} + }, + { + "textPreview":"ΩΣ MEΓAPIKO ΨHΦIΣMA EINAI ΓNΩΣTH H AΠOΦAΣH THΣ EKKΛHΣIAΣ TOY ΔHMOY TΩN AΘHNAIΩN (ΠIΘANON ΓYPΩ ΣTO 433/2 Π.X.) NA EΠIBAΛEI AYΣTHPO KAI KAΘOΛIKO EMΠAPΓKO ΣTA", + "messageCount":1, + "charactersRemaining":5, + "configuration":{ + "transliteration":"GREEK" + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/b888d833f5e2077036527211f9d9a5502285e1c742cd8459a9d3ad85cb1fa1f5.PreviewResponse" + }, + "examples":{ + "Preview response":{ + "value":"\n Let's see how many characters remain unused in this message.\n \n \n Let's see how many characters remain unused in this message.\n 1\n 100\n \n \n \n\n" + }, + "Preview response for request with message language":{ + "value":"\n Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.\n \n \n Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.\n 2\n 36\n \n \n \n Mesaj gönderimi yapmadan önce önizleme seçeneğini kullanmanız doğru karar vermenize yardımcı olur.\n 1\n 57\n \n \n TR\n \n \n \n \n\n" + }, + "Preview response for request with transliteration":{ + "value":"\n Ως Μεγαρικό ψήφισμα είναι γνωστή η απόφαση της Εκκλησίας του δήμου των Αθηναίων (πιθανόν γύρω στο 433/2 π.Χ.) να επιβάλει αυστηρό και καθολικό εμπάργκο στα.\n \n \n Ως Μεγαρικό ψήφισμα είναι γνωστή η απόφαση της Εκκλησίας του δήμου των Αθηναίων (πιθανόν γύρω στο 433/2 π.Χ.) να επιβάλει αυστηρό και καθολικό εμπάργκο στα\n 3\n 46\n \n \n \n ΩΣ MEΓAPIKO ΨHΦIΣMA EINAI ΓNΩΣTH H AΠOΦAΣH THΣ EKKΛHΣIAΣ TOY ΔHMOY TΩN AΘHNAIΩN (ΠIΘANON ΓYPΩ ΣTO 433/2 Π.X.) NA EΠIBAΛEI AYΣTHPO KAI KAΘOΛIKO EMΠAPΓKO ΣTA\n 1\n 5\n \n GREEK\n \n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:manage" + ] + } + }, + "/sms/2/text/advanced":{ + "post":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "send-message" + ], + "summary":"Send SMS message", + "description":"Use this endpoint to send an SMS and set up a rich set of features, such as batch sending with a single API request, scheduling, URL tracking, language and transliteration configuration, etc. The API response will not contain the final delivery status, use [Delivery Reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/receive-outbound-sms-message-report) instead.\\\nIn light of improved features, this endpoint has been superseded. Please visit [Send SMS message](#channels/sms/send-sms-messages) for the next version.", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"send-sms-message", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/1612e6f124bb6c5b1f4f7b12ca64104d59fdfdf779c97454e478b219583b9d48.SMSAdvancedTextualRequest" + }, + "examples":{ + "Send basic textual messages":{ + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "from":"InfoSMS", + "text":"This is a sample message" + } + ] + } + }, + "Send fully-featured textual message":{ + "value":{ + "bulkId":"BULK-ID-123-xyz", + "messages":[ + { + "callbackData":"DLR callback data", + "destinations":[ + { + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727" + }, + { + "to":"41793026834" + } + ], + "flash":false, + "from":"InfoSMS", + "intermediateReport":true, + "language":{ + "languageCode":"TR" + }, + "notifyContentType":"application/json", + "notifyUrl":"https://www.example.com/sms/advanced", + "text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.", + "transliteration":"TURKISH", + "validityPeriod":720, + "campaignReferenceId":"summersale" + }, + { + "deliveryTimeWindow":{ + "days":[ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "from":{ + "hour":6, + "minute":0 + }, + "to":{ + "hour":15, + "minute":30 + } + }, + "destinations":[ + { + "to":"41793026700" + } + ], + "from":"41793026700", + "sendAt":"2021-08-25T16:00:00.000+0000", + "text":"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire." + } + ], + "tracking":{ + "track":"SMS", + "type":"MY_CAMPAIGN" + } + } + }, + "Send flash message":{ + "description":"Send a message that will pop-up on the user's phone", + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "flash":true, + "from":"InfoSMS", + "text":"Toto, I've got a feeling we're not in Kansas anymore." + } + ] + } + }, + "SMS language":{ + "description":"Crossing SMS language barriers with the National Language Identifier for Turkish, Spanish and Portuguese", + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "from":"InfoSMS", + "language":{ + "languageCode":"TR" + }, + "text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz." + } + ] + } + }, + "SMS transliteration":{ + "description":"Send full-size messages in original language alphabet using transliteration conversion", + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "from":"InfoSMS", + "text":"Ως Μεγαρικό ψήφισμα είνα…ι καθολικό εμπάργκο στα", + "transliteration":"GREEK" + } + ] + } + }, + "Platform features":{ + "description":"Parts of the SMS message, such as message sender, will be customized in accordance with provided application and entity ids. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "text":"Custom application and entity based rules will be applied to this message", + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + } + ] + } + }, + "Send Basic India DLT message":{ + "description":"Send a message with India DLT parameters included", + "value":{ + "messages":[ + { + "destinations":[ + { + "to":"41793026727" + } + ], + "from":"InfoSMS", + "regional":{ + "indiaDlt":{ + "contentTemplateId":"1111111111111111111", + "principalEntityId":"1111111111111111112", + "telemarketerId":"111111111111" + } + }, + "text":"India DLT parameters will be applied in this message" + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/1612e6f124bb6c5b1f4f7b12ca64104d59fdfdf779c97454e478b219583b9d48.SMSAdvancedTextualRequest" + }, + "examples":{ + "Send basic textual messages":{ + "value":"\n \n \n InfoSMS\n This is a sample message\n \n \n 41793026727\n \n \n \n \n\n" + }, + "Send fully-featured textual message":{ + "value":"\n BULK-ID-123-xyz\n \n SMS\n MY_CAMPAIGN\n \n \n \n DLR callback data\n false\n InfoSMS\n true\n \n TR\n \n application/json\n https://www.example.com/sms/advanced\n Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.\n TURKISH\n 720\n summersale\n \n \n MESSAGE-ID-123-xyz\n 41793026727\n \n \n 41793026834\n \n \n \n \n \n \n MONDAY\n TUESDAY\n WEDNESDAY\n THURSDAY\n FRIDAY\n SATURDAY\n SUNDAY\n \n \n 6\n 0\n \n \n 15\n 30\n \n \n 41793026700\n 2021-08-25T16:00:00.000+0000\n A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\n \n \n 41793026700\n \n \n \n \n\n" + }, + "Send flash message":{ + "description":"Send a message that will pop-up on the user's phone", + "value":"\n \n \n true\n InfoSMS\n Toto, I've got a feeling we're not in Kansas anymore.\n \n \n 41793026727\n \n \n \n \n\n" + }, + "SMS language":{ + "description":"Crossing SMS language barriers with the National Language Identifier for Turkish, Spanish and Portuguese", + "value":"\n \n \n InfoSMS\n \n TR\n \n Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.\n \n \n 41793026727\n \n \n \n \n\n" + }, + "SMS transliteration":{ + "description":"Send full-size messages in original language alphabet using transliteration conversion", + "value":"\n \n \n InfoSMS\n Ως Μεγαρικό ψήφισμα είνα…ι καθολικό εμπάργκο στα\n GREEK\n \n \n 41793026727\n \n \n \n \n\n" + }, + "Platform features":{ + "description":"Parts of the SMS message, such as message sender, will be customized in accordance with provided application and entity ids. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "value":"\n \n \n Custom application and entity based rules will be applied to this message\n promotional-traffic-entity\n marketing-automation-application\n \n \n 41793026727\n \n \n \n \n\n" + }, + "Send Basic India DLT message":{ + "description":"Send a message with India DLT parameters included", + "value":"\n \n \n InfoSMS\n \n \n 1111111111111111111\n 1111111111111111112\n 111111111111\n \n \n India DLT parameters will be applied in this message\n \n \n 41793026727\n \n \n \n \n\n" + } + } + } + }, + "required":true + }, + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/33e5f9b198702dad16ca1f81c1bb567a11b08d145013a25f78031b56a52d656b.SMSResponse" + }, + "examples":{ + "Response for request with one destination":{ + "value":{ + "bulkId":"2034072219640523072", + "messages":[ + { + "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED" + }, + "to":"41793026727" + } + ] + } + }, + "Response for request with multiple destinations":{ + "value":{ + "bulkId":"2034072219640523073", + "messages":[ + { + "messageId":"2033247207850523791", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED" + }, + "to":"41793026727" + }, + { + "messageId":"2033247207850523792", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED" + }, + "to":"41793026834" + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/33e5f9b198702dad16ca1f81c1bb567a11b08d145013a25f78031b56a52d656b.SMSResponse" + }, + "examples":{ + "Response for request with one destination":{ + "value":"\n 2034072219640523072\n \n \n 2250be2d4219-3af1-78856-aabe-1362af1edfd2\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ACCEPTED\n \n 41793026727\n \n \n\n" + }, + "Response for request with multiple destinations":{ + "value":"\n 2034072219640523073\n \n \n 2033247207850523791\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ACCEPTED\n \n 41793026727\n \n \n 2033247207850523792\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ACCEPTED\n \n 41793026834\n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-additionalInfo":{ + "markdown":"### Related\n- [Activate Verified SMS - get look and feel of chat apps on SMS communication](https://www.infobip.com/docs/sms/verified-sms)\n- [Buy numbers for sending and receiving messages](#platform-&-connectivity/numbers)\n" + }, + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"send-sms-messages" + }, + { + "versionNumber":2, + "latest":false, + "operationId":"send-sms-message" + }, + { + "versionNumber":2, + "latest":false, + "operationId":"send-binary-sms-message" + } + ] + } + }, + "/sms/2/binary/advanced":{ + "post":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "send-message" + ], + "summary":"Send binary SMS message", + "description":"Send single or multiple binary messages to one or more destination address. The API response will not contain the final delivery status, use [Delivery Reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/receive-outbound-sms-message-report) instead.\\\nIn light of improved features, this endpoint has been superseded. Please visit [Send SMS message](#channels/sms/send-sms-messages) for the next version.", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"send-binary-sms-message", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/7b23cc7ec456214e90b61e3d5abd3aaf7422ea4b20f1cdd2d4e9c44fbceaf035.SMSAdvancedBinaryRequest" + }, + "examples":{ + "Send fully-featured binary message":{ + "value":{ + "bulkId":"BULK-ID-123-xyz", + "messages":[ + { + "binary":{ + "dataCoding":0, + "esmClass":0, + "hex":"54 65 73 74 20 6d 65 73 73 61 67 65 2e" + }, + "callbackData":"DLR callback data", + "destinations":[ + { + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727" + }, + { + "to":"41793026834" + } + ], + "from":"InfoSMS", + "intermediateReport":true, + "notifyContentType":"application/json", + "notifyUrl":"https://www.example.com/sms/advanced", + "validityPeriod":720, + "campaignReferenceId":"summersale" + }, + { + "binary":{ + "dataCoding":0, + "esmClass":0, + "hex":"41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E" + }, + "deliveryTimeWindow":{ + "days":[ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "from":{ + "hour":6, + "minute":0 + }, + "to":{ + "hour":15, + "minute":30 + } + }, + "destinations":[ + { + "to":"41793026700" + } + ], + "from":"41793026700", + "sendAt":"2021-08-25T16:00:00.000+0000" + } + ] + } + }, + "Unicode flash binary SMS":{ + "description":"Send Unicode flash SMS m… over binary API method", + "value":{ + "messages":[ + { + "binary":{ + "dataCoding":8, + "esmClass":0, + "hex":"0048 0065 006c 006c 006f 0020 0077 006f 0072 006c 0064 002c 0020 039a 03b1 03bb 03b7 03bc 03ad 03c1 03b1 0020 03ba 03cc 03c3 03bc 03b5 002c 0020 30b3 30f3 30cb 30c1 30cf" + }, + "destinations":[ + { + "to":"41793026727" + } + ], + "flash":true, + "from":"InfoSMS" + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/7b23cc7ec456214e90b61e3d5abd3aaf7422ea4b20f1cdd2d4e9c44fbceaf035.SMSAdvancedBinaryRequest" + }, + "examples":{ + "Send fully-featured binary message":{ + "value":"\n BULK-ID-123-xyz\n \n \n \n 0\n 0\n 54 65 73 74 20 6d 65 73 73 61 67 65 2e\n \n DLR callback data\n InfoSMS\n true\n application/json\n https://www.example.com/sms/advanced\n 720\n summersale\n \n \n MESSAGE-ID-123-xyz\n 41793026727\n \n \n 41793026834\n \n \n \n \n \n 0\n 0\n 41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E\n \n \n \n MONDAY\n TUESDAY\n WEDNESDAY\n THURSDAY\n FRIDAY\n SATURDAY\n SUNDAY\n \n \n 6\n 0\n \n \n 15\n 30\n \n \n 41793026700\n 2021-08-25T16:00:00.000+0000\n \n \n 41793026700\n \n \n \n \n\n" + }, + "Unicode flash binary SMS":{ + "description":"Send Unicode flash SMS m… over binary API method", + "value":"\n \n \n \n 8\n 0\n 0048 0065 006c 006c 006f 0020 0077 006f 0072 006c 0064 002c 0020 039a 03b1 03bb 03b7 03bc 03ad 03c1 03b1 0020 03ba 03cc 03c3 03bc 03b5 002c 0020 30b3 30f3 30cb 30c1 30cf\n \n true\n InfoSMS\n \n \n 41793026727\n \n \n \n \n\n" + } + } + } + }, + "required":true + }, + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/33e5f9b198702dad16ca1f81c1bb567a11b08d145013a25f78031b56a52d656b.SMSResponse" + }, + "examples":{ + "Response for request with one destination":{ + "value":{ + "bulkId":"2034072219640523072", + "messages":[ + { + "messageId":"2250be2d4219-3af1-78856-aabe-1362af1edfd2", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED" + }, + "to":"41793026727" + } + ] + } + }, + "Response for request with multiple destinations":{ + "value":{ + "bulkId":"2034072219640523073", + "messages":[ + { + "messageId":"2033247207850523791", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED" + }, + "to":"41793026727" + }, + { + "messageId":"2033247207850523792", + "status":{ + "description":"Message sent to next instance", + "groupId":1, + "groupName":"PENDING", + "id":26, + "name":"PENDING_ACCEPTED" + }, + "to":"41793026834" + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/33e5f9b198702dad16ca1f81c1bb567a11b08d145013a25f78031b56a52d656b.SMSResponse" + }, + "examples":{ + "Response for request with one destination":{ + "value":"\n 2034072219640523072\n \n \n 2250be2d4219-3af1-78856-aabe-1362af1edfd2\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ACCEPTED\n \n 41793026727\n \n \n\n" + }, + "Response for request with multiple destinations":{ + "value":"\n 2034072219640523073\n \n \n 2033247207850523791\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ACCEPTED\n \n 41793026727\n \n \n 2033247207850523792\n \n Message sent to next instance\n 1\n PENDING\n 26\n PENDING_ACCEPTED\n \n 41793026834\n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"send-sms-messages" + }, + { + "versionNumber":2, + "latest":false, + "operationId":"send-sms-message" + }, + { + "versionNumber":2, + "latest":false, + "operationId":"send-binary-sms-message" + } + ] + } + }, + "/sms/1/bulks":{ + "get":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "manage-scheduled-sms-messages" + ], + "summary":"Get scheduled SMS messages", + "description":"See all [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms) and their scheduled date and time. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"get-scheduled-sms-messages", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "description":"", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + } + ], + "responses":{ + "default":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkResponse" + } + ] + }, + "examples":{ + "Get message schedule info ":{ + "value":{ + "bulkId":"BULK-ID-123-xyz", + "sendAt":"2021-08-25T16:00:00.000+0000" + } + } + } + }, + "application/xml":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkResponse" + } + ] + }, + "examples":{ + "Get message schedule info ":{ + "value":"\n BULK-ID-123-xyz\n 2021-08-25T16:00:00.000+0000\n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "4XX":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + } + } + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + }, + "5XX":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + } + } + } + }, + "security":[ + { + "Basic":[] + }, + { + "APIKeyHeader":[] + }, + { + "IBSSOTokenHeader":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:manage", + "sms:message:send" + ] + }, + "put":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "manage-scheduled-sms-messages" + ], + "summary":"Reschedule SMS messages", + "description":"Change the date and time of already [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"reschedule-sms-messages", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "description":"", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + } + ], + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkRequest" + } + ] + }, + "examples":{ + "Reschedule SMS":{ + "value":{ + "sendAt":"2021-08-25T16:00:00.000+0000" + } + } + } + }, + "application/xml":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkRequest" + } + ] + }, + "examples":{ + "Reschedule SMS":{ + "value":"\n 2021-08-25T16:00:00.000+0000\n\n" + } + } + } + } + }, + "responses":{ + "default":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkResponse" + } + ] + }, + "examples":{ + "Get message schedule info ":{ + "value":{ + "bulkId":"BULK-ID-123-xyz", + "sendAt":"2021-08-25T16:00:00.000+0000" + } + } + } + }, + "application/xml":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkResponse" + } + ] + }, + "examples":{ + "Get message schedule info ":{ + "value":"\n BULK-ID-123-xyz\n 2021-08-25T16:00:00.000+0000\n\n" + } + } + } + } + }, + "400":{ + "$ref":"#/components/responses/ApiException400" + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "4XX":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + } + } + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + }, + "5XX":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException" + } + } + } + } + }, + "security":[ + { + "Basic":[] + }, + { + "APIKeyHeader":[] + }, + { + "IBSSOTokenHeader":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:manage" + ] + } + }, + "/sms/1/bulks/status":{ + "get":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "manage-scheduled-sms-messages" + ], + "summary":"Get scheduled SMS messages status", + "description":"See the status of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"get-scheduled-sms-messages-status", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + } + ], + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/b28487c847ed2327e816f04e75efdaf507ffcf1d938d91963e2ce7298453183f.BulkStatusResponse" + }, + "examples":{ + "Get message status info":{ + "value":{ + "bulkId":"BULK-ID-123-xyz", + "status":"PAUSED" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/b28487c847ed2327e816f04e75efdaf507ffcf1d938d91963e2ce7298453183f.BulkStatusResponse" + }, + "examples":{ + "Get message status info":{ + "value":"\n BULK-ID-123-xyz\n PAUSED\n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "404":{ + "description":"Bulk not found responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bulk not found":{ + "description":"Bulk not found", + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"NOT_FOUND", + "text":"Bulk not found" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bulk not found":{ + "description":"Bulk not found", + "value":"\n \n \n \n \n \n NOT_FOUND\n \n Bulk not found\n \n \n \n \n \n\n" + } + } + } + } + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:message:send", + "sms:manage" + ] + }, + "put":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "manage-scheduled-sms-messages" + ], + "summary":"Update scheduled SMS messages status", + "description":"Change the status or completely cancel sending of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"update-scheduled-sms-messages-status", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "required":true, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + } + ], + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/c8006fe0d154740d4f3e0ed89b54c9c54d35edf85894782dbfe7d9ae0ea23725.UpdateStatusRequest" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/c8006fe0d154740d4f3e0ed89b54c9c54d35edf85894782dbfe7d9ae0ea23725.UpdateStatusRequest" + } + } + }, + "required":true + }, + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/b28487c847ed2327e816f04e75efdaf507ffcf1d938d91963e2ce7298453183f.BulkStatusResponse" + }, + "examples":{ + "Get message status info":{ + "value":{ + "bulkId":"BULK-ID-123-xyz", + "status":"PAUSED" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/b28487c847ed2327e816f04e75efdaf507ffcf1d938d91963e2ce7298453183f.BulkStatusResponse" + }, + "examples":{ + "Get message status info":{ + "value":"\n BULK-ID-123-xyz\n PAUSED\n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "404":{ + "description":"Bulk not found responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bulk not found":{ + "description":"Bulk not found", + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"NOT_FOUND", + "text":"Bulk not found" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bulk not found":{ + "description":"Bulk not found", + "value":"\n \n \n \n \n \n NOT_FOUND\n \n Bulk not found\n \n \n \n \n \n\n" + } + } + } + } + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:manage" + ] + } + }, + "/ct/1/log/end/{messageId}":{ + "post":{ + "tags":[ + "channels", + "sms", + "outbound-sms", + "confirm-conversion" + ], + "summary":"Confirm conversion", + "description":"Use this endpoint to inform the Infobip platform about the successful conversion on your side. Infobip will use this information to monitor SMS performance and provide you with better service. To enable Conversion Tracking, set up the “tracking” object to “SMS” when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms) over HTTP API.\nFor more information, see: [Tracking Conversion](https://www.infobip.com/docs/sms/api#track-conversion).", + "operationId":"log-end-tag", + "parameters":[ + { + "name":"messageId", + "in":"path", + "description":"ID of a converted message.", + "required":true, + "style":"simple", + "explode":false, + "schema":{ + "type":"string" + } + } + ], + "responses":{ + "default":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/5e0af18dea7a9fe7fc7475b275c0dd721ec8be9556c5d111334ce121ba3ef90a.EndTagResponse" + } + ] + }, + "examples":{ + "Reporting conversion response example":{ + "value":{ + "processKey":"A37D448C1ACCA02FABA745522558326C" + } + } + } + }, + "application/xml":{ + "schema":{ + "allOf":[ + { + "$ref":"#/components/schemas/5e0af18dea7a9fe7fc7475b275c0dd721ec8be9556c5d111334ce121ba3ef90a.EndTagResponse" + } + ] + }, + "examples":{ + "Reporting conversion response example":{ + "value":"\n A37D448C1ACCA02FABA745522558326C\n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "404":{ + "$ref":"#/components/responses/ApiException404" + }, + "4XX":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiException" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiException" + } + } + } + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + }, + "5XX":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiException" + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiException" + } + } + } + } + }, + "security":[ + { + "Basic":[] + }, + { + "APIKeyHeader":[] + }, + { + "IBSSOTokenHeader":[] + }, + { + "OAuth2":[] + } + ], + "x-is-early-access":true, + "x-scopes":[ + "sms:manage" + ] + } + }, + "/sms/1/inbox/reports":{ + "get":{ + "tags":[ + "channels", + "sms", + "inbound-sms" + ], + "summary":"Get inbound SMS messages", + "description":"If you are unable to receive incoming SMS to the endpoint of your choice in real-time, you can use this API call to fetch messages. Each request will return a batch of received messages, only once. The API request will only return new messages that arrived since the last API request. To use this method, you’d need to:
  1. Buy a number capable of receiving SMS traffic.
  2. Specify a forwarding endpoint for the number and optionally configure other inbound settings.
", + "operationId":"get-inbound-sms-messages", + "parameters":[ + { + "name":"limit", + "in":"query", + "description":"Maximum number of messages to be returned in a response. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access messages for the last 48h.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + }, + "example":2 + }, + { + "name":"applicationId", + "in":"query", + "description":"Application id that the message is linked to. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"marketing-automation-application" + }, + { + "name":"entityId", + "in":"query", + "description":"Entity id that the message is linked to. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"promotional-traffic-entity" + }, + { + "name":"campaignReferenceId", + "in":"query", + "description":"ID of a campaign that was sent in the message.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"summersale" + } + ], + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/cd5e571e477c0b81ca50ad592cf9f67cc32feded2012ec26d7fae09c0c2d5108.SmsMoReportResponse" + }, + "examples":{ + "Receive SMS":{ + "value":{ + "results":[ + { + "messageId":"817790313235066447", + "from":"385916242493", + "to":"385921004026", + "text":"QUIZ Correct answer is Paris", + "cleanText":"Correct answer is Paris", + "keyword":"QUIZ", + "receivedAt":"2019-11-09T16:00:00.000+0000", + "smsCount":1, + "price":{ + "pricePerMessage":0, + "currency":"EUR" + }, + "callbackData":"callbackData" + } + ], + "messageCount":1, + "pendingMessageCount":1 + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/cd5e571e477c0b81ca50ad592cf9f67cc32feded2012ec26d7fae09c0c2d5108.SmsMoReportResponse" + }, + "examples":{ + "Receive SMS":{ + "value":"\n 1\n 1\n \n \n 817790313235066447\n 385916242493\n 385921004026\n QUIZ Correct answer is Paris\n Correct answer is Paris\n QUIZ\n 2019-11-09T16:00:00.000+0000\n 1\n \n 0\n EUR\n \n callbackData\n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "inbound-message:read", + "sms:inbound-message:read", + "sms:manage" + ], + "x-additional-versioning-information":{ + "latest":false, + "versionNumber":1 + }, + "x-additionalInfo":{ + "markdown":"### Related\n- [Buy numbers for sending and receiving messages](#platform-&-connectivity/numbers)\n" + } + } + }, + "/sms/3/reports":{ + "get":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Get outbound SMS message delivery reports", + "description":"If you are unable to receive real-time message delivery reports towards your endpoint for various reasons, we offer you an API method to fetch batches of message reports to confirm whether specific messages have been delivered. Each request towards this endpoint will return batches of the latest message reports. Please note they will be returned only once.", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"get-outbound-sms-message-delivery-reports-v3", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "description":"The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"messageId", + "in":"query", + "description":"The ID that uniquely identifies the message sent.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"limit", + "in":"query", + "description":"Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access reports for the last 48h", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32", + "default":50, + "maximum":1000 + }, + "example":1 + }, + { + "name":"entityId", + "in":"query", + "description":"Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"promotional-traffic-entity" + }, + { + "name":"applicationId", + "in":"query", + "description":"Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"marketing-automation-application" + }, + { + "name":"campaignReferenceId", + "in":"query", + "description":"ID of a campaign that was sent in the message.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"summersale" + } + ], + "responses":{ + "200":{ + "description":"OK", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReports" + }, + "examples":{ + "Delivery report":{ + "value":{ + "results":[ + { + "bulkId":"BULK-ID-123-xyz", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"OK", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727", + "sender":"InfoSMS", + "sentAt":"2019-11-09T16:00:00.000+0100", + "doneAt":"2019-11-09T16:00:00.000+0100", + "messageCount":1, + "callbackData":"callbackData", + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + } + }, + { + "bulkId":"BULK-ID-123-xyz", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"OK", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5", + "to":"41793026834", + "sender":"InfoSMS", + "sentAt":"2019-11-09T17:00:00.000+0100", + "doneAt":"2019-11-09T17:00:00.000+0100", + "messageCount":1, + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReports" + }, + "examples":{ + "Delivery report":{ + "value":"\n \n \n BULK-ID-123-xyz\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n OK\n 0\n NO_ERROR\n No Error\n false\n \n MESSAGE-ID-123-xyz\n 41793026727\n InfoSMS\n 2019-11-09T16:00:00.000+0100\n 2019-11-09T16:00:00.000+0100\n 1\n callbackData\n \n promotional-traffic-entity\n marketing-automation-application\n \n \n \n BULK-ID-123-xyz\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n OK\n 0\n NO_ERROR\n No Error\n false\n \n 12db39c3-7822-4e72-a3ec-c87442c0ffc5\n 41793026834\n InfoSMS\n 2019-11-09T17:00:00.000+0100\n 2019-11-09T17:00:00.000+0100\n 1\n \n promotional-traffic-entity\n marketing-automation-application\n \n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiError401" + }, + "403":{ + "$ref":"#/components/responses/ApiError403" + }, + "500":{ + "$ref":"#/components/responses/ApiError500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"get-outbound-sms-message-delivery-reports-v3" + }, + { + "versionNumber":1, + "latest":false, + "operationId":"get-outbound-sms-message-delivery-reports" + } + ] + } + }, + "/sms/3/logs":{ + "get":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Get outbound SMS message logs", + "description":"Use this method to obtain the logs associated with outbound messages. The available logs are limited to those generated in the last 48 hours, and you can retrieve a maximum of only 1000 logs per call. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports-v3) if your use case is to verify message delivery.", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"get-outbound-sms-message-logs-v3", + "parameters":[ + { + "name":"mcc", + "in":"query", + "description":"Mobile Country Code.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "description":"Mobile Country Code." + } + }, + { + "name":"mnc", + "in":"query", + "description":"Mobile Network Code. Mobile Country Code is required if this property is used.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "description":"Mobile Network Code. Mobile Country Code is required if this property is used." + } + }, + { + "name":"sender", + "in":"query", + "description":"The sender ID which can be alphanumeric or numeric.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"destination", + "in":"query", + "description":"Message destination address.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"bulkId", + "in":"query", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. May contain multiple comma-separated values. Maximum length 2048 characters.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"BULK-ID-123-xyz" + }, + { + "name":"messageId", + "in":"query", + "description":"Unique message ID for which a log is requested. May contain multiple comma-separated values. Maximum length 2048 characters.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"MESSAGE-ID-123-xyz,MESSAGE-ID-124-xyz" + }, + { + "name":"generalStatus", + "in":"query", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageGeneralStatus" + } + }, + { + "name":"sentSince", + "in":"query", + "description":"The logs will only include messages sent after this date. Use it alongside sentUntil to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "format":"date-time" + }, + "example":"2020-02-22T17:42:05.390+01:00" + }, + { + "name":"sentUntil", + "in":"query", + "description":"The logs will only include messages sent before this date. Use it alongside sentSince to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "format":"date-time", + "description":"The logs will only include messages sent before this date. Use it alongside sentSince to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.", + "example":"2020-02-23T17:42:05.39+01:00" + }, + "example":"2020-02-23T17:42:05.390+01:00" + }, + { + "name":"limit", + "in":"query", + "description":"Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access logs for the last 48h.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32", + "default":50, + "maximum":1000 + } + }, + { + "name":"entityId", + "in":"query", + "description":"Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"promotional-traffic-entity" + }, + { + "name":"applicationId", + "in":"query", + "description":"Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"marketing-automation-application" + }, + { + "name":"campaignReferenceId", + "in":"query", + "description":"ID of a campaign that was sent in the message. May contain multiple comma-separated values.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"summersale" + }, + { + "name":"useCursor", + "in":"query", + "description":"Flag used to enable cursor-based pagination. When set to true, the system will use the cursor to fetch the next set of logs.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"boolean" + } + }, + { + "name":"cursor", + "in":"query", + "description":"Value which represents the current position in the data set. For the first request, this field shouldn't be defined. In subsequent requests, use the `nextCursor` value returned from the previous response to continue fetching data.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + } + ], + "responses":{ + "200":{ + "description":"OK", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogResponseSmsLogSmsMessageContent" + }, + "examples":{ + "Log":{ + "value":{ + "results":[ + { + "destination":"41793026727", + "bulkId":"BULK-ID-123-xyz", + "messageId":"MESSAGE-ID-123-xyz", + "sentAt":"2019-11-09T16:00:00.000+0100", + "doneAt":"2019-11-09T16:00:00.000+0100", + "messageCount":1, + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"OK", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + }, + "content":{ + "text":"This is a sample message" + }, + "mccMnc":"22801" + }, + { + "destination":"41793026834", + "bulkId":"BULK-ID-123-xyz", + "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5", + "sentAt":"2019-11-09T17:00:00.000+0100", + "doneAt":"2019-11-09T17:00:00.000+0100", + "messageCount":1, + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"OK", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + }, + "content":{ + "text":"This is a sample message" + }, + "mccMnc":"22801" + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogResponseSmsLogSmsMessageContent" + }, + "examples":{ + "Log":{ + "value":"\n \n \n 41793026727\n BULK-ID-123-xyz\n MESSAGE-ID-123-xyz\n 2019-11-09T16:00:00.000+0100\n 2019-11-09T16:00:00.000+0100\n 1\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n OK\n 0\n NO_ERROR\n No Error\n false\n \n \n promotional-traffic-entity\n marketing-automation-application\n \n \n This is a sample message\n \n 22801\n \n \n 41793026834\n BULK-ID-123-xyz\n 12db39c3-7822-4e72-a3ec-c87442c0ffc5\n 2019-11-09T17:00:00.000+0100\n 2019-11-09T17:00:00.000+0100\n 1\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n OK\n 0\n NO_ERROR\n No Error\n false\n \n \n promotional-traffic-entity\n marketing-automation-application\n \n \n This is a sample message\n \n 22801\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiError401" + }, + "403":{ + "$ref":"#/components/responses/ApiError403" + }, + "429":{ + "$ref":"#/components/responses/ApiError429" + }, + "500":{ + "$ref":"#/components/responses/ApiError500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:manage", + "sms:logs:read" + ], + "x-throttling-info":[ + { + "type":"time", + "numberOfRequests":120, + "numberOfTimeUnits":0, + "timeUnit":"m" + } + ], + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"get-outbound-sms-message-logs-v3" + }, + { + "versionNumber":1, + "latest":false, + "operationId":"get-outbound-sms-message-logs" + } + ] + } + }, + "/sms/1/reports":{ + "get":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Get outbound SMS message delivery reports", + "description":"If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has been delivered to the recipient. Each request will return a batch of delivery reports - only once. The following API request will return only new reports that arrived since the last API request in the last 48 hours.", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"get-outbound-sms-message-delivery-reports", + "parameters":[ + { + "name":"bulkId", + "in":"query", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"messageId", + "in":"query", + "description":"Unique message ID for which a report is requested.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"limit", + "in":"query", + "description":"Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access reports for the last 48h.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32", + "default":50, + "maximum":1000 + }, + "example":2 + }, + { + "name":"applicationId", + "in":"query", + "description":"Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"marketing-automation-application" + }, + { + "name":"entityId", + "in":"query", + "description":"Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"promotional-traffic-entity" + }, + { + "name":"campaignReferenceId", + "in":"query", + "description":"ID of a campaign that was sent in the message.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"summersale" + } + ], + "responses":{ + "200":{ + "description":"successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/1705572441d20bbbfe49765ca2bed87cd314f9c5c501048d5a9494385ff9f223.SMSReportResponse" + }, + "examples":{ + "Delivery reports":{ + "value":{ + "results":[ + { + "bulkId":"BULK-ID-123-xyz", + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727", + "sentAt":"2019-11-09T16:00:00.000+0000", + "doneAt":"2019-11-09T16:00:00.000+0000", + "smsCount":1, + "callbackData":"callbackData", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"Ok", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + }, + { + "bulkId":"BULK-ID-123-xyz", + "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5", + "to":"41793026834", + "sentAt":"2019-11-09T17:00:00.000+0000", + "doneAt":"2019-11-09T17:00:00.000+0000", + "smsCount":1, + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"Ok", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "applicationId":"default" + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/1705572441d20bbbfe49765ca2bed87cd314f9c5c501048d5a9494385ff9f223.SMSReportResponse" + }, + "examples":{ + "Delivery reports":{ + "value":"\n \n \n BULK-ID-123-xyz\n MESSAGE-ID-123-xyz\n 41793026727\n 2019-11-09T16:00:00.000+0000\n 2019-11-09T16:00:00.000+0000\n 1\n callbackData\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n Ok\n 0\n NO_ERROR\n No Error\n false\n \n promotional-traffic-entity\n marketing-automation-application\n \n \n BULK-ID-123-xyz\n 12db39c3-7822-4e72-a3ec-c87442c0ffc5\n 41793026834\n 2019-11-09T17:00:00.000+0000\n 2019-11-09T17:00:00.000+0000\n 1\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n Ok\n 0\n NO_ERROR\n No Error\n false\n \n default\n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "message:send", + "sms:message:send", + "sms:manage" + ], + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"get-outbound-sms-message-delivery-reports-v3" + }, + { + "versionNumber":1, + "latest":false, + "operationId":"get-outbound-sms-message-delivery-reports" + } + ] + } + }, + "/sms/1/logs":{ + "get":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Get outbound SMS message logs", + "description":"Use this method for displaying logs for example in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per call. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) if your use case is to verify message delivery.", + "externalDocs":{ + "description":"Learn more about SMS channel and use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"get-outbound-sms-message-logs", + "parameters":[ + { + "name":"from", + "in":"query", + "description":"The sender ID which can be alphanumeric or numeric.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"to", + "in":"query", + "description":"Message destination address.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"bulkId", + "in":"query", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. May contain multiple comma-separated values. Maximum length 2048 characters.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"BULK-ID-123-xyz" + }, + { + "name":"messageId", + "in":"query", + "description":"Unique message ID for which a log is requested. May contain multiple comma-separated values. Maximum length 2048 characters.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"MESSAGE-ID-123-xyz,MESSAGE-ID-124-xyz" + }, + { + "name":"generalStatus", + "in":"query", + "description":"Sent [message status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageGeneralStatus" + } + }, + { + "name":"sentSince", + "in":"query", + "description":"The logs will only include messages sent after this date. Use it alongside `sentUntil` to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "format":"date-time" + }, + "example":"2015-02-22T17:42:05.390+0100" + }, + { + "name":"sentUntil", + "in":"query", + "description":"The logs will only include messages sent before this date. Use it alongside `sentSince` to specify a time range for the logs, but only up to the maximum limit of 1000 logs per call. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string", + "format":"date-time" + }, + "example":"2015-02-22T19:42:05.390+0100" + }, + { + "name":"limit", + "in":"query", + "description":"Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access logs for the last 48h.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"integer", + "format":"int32" + } + }, + { + "name":"mcc", + "in":"query", + "description":"Mobile Country Code.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"mnc", + "in":"query", + "description":"Mobile Network Code. Mobile Country Code is required if this property is used. ", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + } + }, + { + "name":"applicationId", + "in":"query", + "description":"Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"marketing-automation-application" + }, + { + "name":"entityId", + "in":"query", + "description":"Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"string" + }, + "example":"promotional-traffic-entity" + }, + { + "name":"campaignReferenceId", + "in":"query", + "description":"ID of a campaign that was sent in the message. May contain multiple comma-separated values.", + "required":false, + "style":"form", + "explode":true, + "schema":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "example":"summersale" + } + ], + "responses":{ + "200":{ + "description":"Successful response", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/b41d7b140d24800c94ddcc7df92e32ab37fc7d5f310ce1050b04561c5e59a3b7.LogsResponse" + }, + "examples":{ + "SMS logs":{ + "value":{ + "results":[ + { + "bulkId":"BULK-ID-123-xyz", + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727", + "sentAt":"2019-11-09T16:00:00.000+0000", + "doneAt":"2019-11-09T16:00:00.000+0000", + "smsCount":1, + "mccMnc":"22801", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"Ok", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + } + }, + { + "bulkId":"BULK-ID-123-xyz", + "messageId":"MESSAGE-ID-ijkl-45", + "to":"41793026834", + "sentAt":"2019-11-09T17:00:00.000+0000", + "doneAt":"2019-11-09T17:00:00.000+0000", + "smsCount":1, + "mccMnc":"22801", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"Ok", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/b41d7b140d24800c94ddcc7df92e32ab37fc7d5f310ce1050b04561c5e59a3b7.LogsResponse" + }, + "examples":{ + "SMS logs":{ + "value":"\n \n \n BULK-ID-123-xyz\n MESSAGE-ID-123-xyz\n 41793026727\n 2019-11-09T16:00:00.000+0000\n 2019-11-09T16:00:00.000+0000\n 1\n 22801\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n Ok\n 0\n NO_ERROR\n No Error\n false\n \n \n \n BULK-ID-123-xyz\n MESSAGE-ID-ijkl-45\n 41793026834\n 2019-11-09T17:00:00.000+0000\n 2019-11-09T17:00:00.000+0000\n 1\n 22801\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n Ok\n 0\n NO_ERROR\n No Error\n false\n \n \n \n\n" + } + } + } + } + }, + "400":{ + "description":"Error responses", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException" + }, + "examples":{ + "Bad request":{ + "value":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + } + } + }, + "401":{ + "$ref":"#/components/responses/ApiException401" + }, + "403":{ + "$ref":"#/components/responses/ApiException403" + }, + "429":{ + "$ref":"#/components/responses/ApiException429" + }, + "500":{ + "$ref":"#/components/responses/ApiException500" + } + }, + "deprecated":true, + "security":[ + { + "IBSSOTokenHeader":[] + }, + { + "APIKeyHeader":[] + }, + { + "Basic":[] + }, + { + "OAuth2":[] + } + ], + "x-scopes":[ + "sms:logs:read", + "sms:manage" + ], + "x-deprecationInformation":{ + "deprecation":"2024-05-16T12:00:00.00+0000", + "successorOperationId":"get-outbound-sms-message-logs-v3" + }, + "x-throttling-info":[ + { + "type":"time", + "numberOfRequests":120, + "numberOfTimeUnits":0, + "timeUnit":"m" + } + ], + "x-versions":[ + { + "versionNumber":3, + "latest":true, + "operationId":"get-outbound-sms-message-logs-v3" + }, + { + "versionNumber":1, + "latest":false, + "operationId":"get-outbound-sms-message-logs" + } + ] + } + } + }, + "components":{ + "schemas":{ + "01e84c3b4dd6fb6c49761ac60f0bbc50e5117905a6beb7547645113e59aaeb46.PreviewRequest":{ + "type":"object", + "properties":{ + "text":{ + "type":"string", + "description":"Content of the message being sent." + }, + "languageCode":{ + "type":"string", + "description":"Language code for the correct character set. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese, or `AUTODETECT` to let platform select the character set based on message content.", + "pattern":"^(TR|ES|PT|AUTODETECT)$" + }, + "transliteration":{ + "type":"string", + "description":"The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, `NON_UNICDE`, `ALL` and `NONE`.", + "pattern":"^(TURKISH|GREEK|CYRILLIC|SERBIAN_CYRILLIC|BULGARIAN_CYRILLIC|CENTRAL_EUROPEAN|BALTIC|PORTUGUESE|COLOMBIAN|NON_UNICODE|NONE|ALL)$" + } + }, + "required":[ + "text" + ], + "title":"PreviewRequest" + }, + "1612e6f124bb6c5b1f4f7b12ca64104d59fdfdf779c97454e478b219583b9d48.SMSAdvancedTextualRequest":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). Anything above 100 characters passed in the request will be clipped during processing and returned in response, reports and logs." + }, + "messages":{ + "type":"array", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSTextualMessage" + } + }, + "sendingSpeedLimit":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.SendingSpeedLimit" + }, + "urlOptions":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.UrlOptions" + }, + "tracking":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.Tracking" + }, + "includeSmsCountInResponse":{ + "type":"boolean", + "default":false, + "description":"Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted." + } + }, + "required":[ + "messages" + ], + "title":"SMSTextualRequest" + }, + "1705572441d20bbbfe49765ca2bed87cd314f9c5c501048d5a9494385ff9f223.SMSReportResponse":{ + "type":"object", + "properties":{ + "results":{ + "type":"array", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsReport" + } + } + }, + "title":"SMSReportResponse" + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.BinaryContent":{ + "type":"object", + "properties":{ + "dataCoding":{ + "type":"integer", + "format":"int32", + "description":"Binary content data coding. The default value is (`0`) for GSM7. Example: (`8`) for Unicode data.", + "writeOnly":true + }, + "esmClass":{ + "type":"integer", + "format":"int32", + "description":"“Esm_class” parameter. Indicate special message attributes associated with the SMS. Default value is (`0`).", + "writeOnly":true + }, + "hex":{ + "type":"string", + "description":"Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: `0f c2 4a bf 34 13 ba`).", + "writeOnly":true + } + }, + "required":[ + "hex" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.BulkStatus":{ + "type":"string", + "description":"The status of the message(s).", + "enum":[ + "PENDING", + "PAUSED", + "PROCESSING", + "CANCELED", + "FINISHED", + "FAILED" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.CursorPageInfo":{ + "type":"object", + "description":"Cursor information.", + "properties":{ + "limit":{ + "type":"integer", + "format":"int32", + "description":"Requested limit." + }, + "nextCursor":{ + "type":"string", + "description":"The `cursor` value you will use in your next request to fetch the subsequent set of results." + } + }, + "readOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryDay":{ + "type":"string", + "description":"Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma.", + "enum":[ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "writeOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReport":{ + "type":"object", + "description":"Collection of reports, one per every message.", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request." + }, + "price":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessagePrice" + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageStatus" + }, + "error":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageError" + }, + "messageId":{ + "type":"string", + "description":"Unique message ID." + }, + "to":{ + "type":"string", + "description":"Message destination address." + }, + "sender":{ + "type":"string", + "description":"The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`)." + }, + "sentAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ." + }, + "doneAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ." + }, + "messageCount":{ + "type":"integer", + "format":"int32", + "description":"The number of sent messages." + }, + "mccMnc":{ + "type":"string", + "description":"Mobile country and network codes." + }, + "callbackData":{ + "type":"string", + "description":"Callback data sent through ‛callbackData‛ field when sending message." + }, + "platform":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Platform" + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID of a campaign that was sent in the message." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReports":{ + "type":"object", + "properties":{ + "results":{ + "type":"array", + "description":"Collection of reports, one per every message.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReport" + } + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTime":{ + "type":"object", + "description":"The exact time of the day. The time is expressed in the UTC time zone.", + "properties":{ + "hour":{ + "type":"integer", + "format":"int32", + "description":"Hour when the time window opens when used in the `from` property or closes when used in the `to` property.", + "maximum":23, + "minimum":0 + }, + "minute":{ + "type":"integer", + "format":"int32", + "description":"Minute when the time window opens when used in the `from` property or closes when used in the `to` property.", + "maximum":59, + "minimum":0 + } + }, + "required":[ + "hour", + "minute" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTimeFrom":{ + "type":"object", + "description":"The exact time of day to start sending messages. Time is expressed in the UTC time zone. If set, use it together with the `to` property with minimum 1 hour difference.", + "properties":{ + "hour":{ + "type":"integer", + "format":"int32", + "description":"Hour when the time window opens when used in the `from` property or closes when used in the `to` property.", + "maximum":23, + "minimum":0, + "writeOnly":true + }, + "minute":{ + "type":"integer", + "format":"int32", + "description":"Minute when the time window opens when used in the `from` property or closes when used in the `to` property.", + "maximum":59, + "minimum":0, + "writeOnly":true + } + }, + "required":[ + "hour", + "minute" + ], + "writeOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTimeTo":{ + "type":"object", + "description":"The exact time of day to end sending messages. Time is expressed in the UTC time zone. If set, use it together with the `from` property with minimum 1 hour difference.", + "properties":{ + "hour":{ + "type":"integer", + "format":"int32", + "description":"Hour when the time window opens when used in the `from` property or closes when used in the `to` property.", + "maximum":23, + "minimum":0, + "writeOnly":true + }, + "minute":{ + "type":"integer", + "format":"int32", + "description":"Minute when the time window opens when used in the `from` property or closes when used in the `to` property.", + "maximum":59, + "minimum":0, + "writeOnly":true + } + }, + "required":[ + "hour", + "minute" + ], + "writeOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTimeWindow":{ + "type":"object", + "description":"Sets specific message delivery window outside of which messages won't be delivered. Often, used when there are restrictions on when messages can be sent. The exact time of the day to start sending messages can be defined using the `from` property. The exact time of the day to end sending messages can be defined using the `to` property. Properties `from` and `to` should be both provided with the minimum 1 hour difference or omitted.", + "properties":{ + "days":{ + "type":"array", + "description":"Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryDay" + } + }, + "from":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTime" + }, + "to":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTime" + } + }, + "required":[ + "days" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Destination":{ + "type":"object", + "description":"An array of destination objects for where messages are being sent. A valid destination is required.", + "properties":{ + "messageId":{ + "type":"string", + "description":"The ID that uniquely identifies the message sent. Anything above 200 characters passed in the request will be clipped during processing and returned in response, reports and logs.", + "writeOnly":true + }, + "to":{ + "type":"string", + "description":"Message destination address. Addresses must be in international format (Example: `41793026727`).", + "maxLength":64, + "minLength":0, + "writeOnly":true + } + }, + "required":[ + "to" + ], + "writeOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Error":{ + "type":"object", + "description":"Indicates whether an error occurred during the query execution.", + "properties":{ + "groupId":{ + "type":"integer", + "format":"int32", + "description":"Error group ID." + }, + "groupName":{ + "type":"string", + "description":"Error group name." + }, + "id":{ + "type":"integer", + "format":"int32", + "description":"Error ID." + }, + "name":{ + "type":"string", + "description":"Error name." + }, + "description":{ + "type":"string", + "description":"Human-readable description of the error.." + }, + "permanent":{ + "type":"boolean", + "description":"Tells if the error is permanent." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.GeoLocationInfoWrapper":{ + "type":"object", + "description":"Geolocation data such as Country and City.", + "properties":{ + "countryName":{ + "type":"string", + "description":"Country where the user action is recorded." + }, + "city":{ + "type":"string", + "description":"City where the user action is recorded." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.IndiaDltOptions":{ + "type":"object", + "description":"Distributed Ledger Technology (DLT) specific parameters required for sending SMS to phone numbers registered in India.", + "properties":{ + "contentTemplateId":{ + "type":"string", + "description":"Registered DLT content template ID which matches message you are sending." + }, + "principalEntityId":{ + "type":"string", + "description":"Your assigned DLT principal entity ID." + }, + "telemarketerId":{ + "type":"string", + "description":"Your assigned Telemarketer ID. (required for Aggregators)" + } + }, + "required":[ + "principalEntityId" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.IysRecipientType":{ + "type":"string", + "description":"Recipient Type must be `TACIR` or `BIREYSEL`.", + "enum":[ + "BIREYSEL", + "TACIR" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Language":{ + "type":"object", + "properties":{ + "languageCode":{ + "type":"string", + "description":"Language code for the correct character set. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese, or `AUTODETECT` to let platform select the character set based on message content." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LanguageCode":{ + "type":"string", + "description":"Language code for the correct character set. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese, or `AUTODETECT` to let platform select the character set based on message content.", + "enum":[ + "NONE", + "TR", + "ES", + "PT", + "AUTODETECT" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LanguageConfiguration":{ + "type":"object", + "description":"Sets up additional configuration that changes the original message content you can preview with this call.", + "properties":{ + "language":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Language" + }, + "transliteration":{ + "type":"string", + "description":"Conversion of a message text from one script to another. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `NON_UNICODE` and `ALL`." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Log":{ + "type":"object", + "description":"Collection of logs.", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + "readOnly":true + }, + "messageId":{ + "type":"string", + "description":"Unique message ID.", + "readOnly":true + }, + "to":{ + "type":"string", + "description":"The destination address of the message.", + "readOnly":true + }, + "from":{ + "type":"string", + "description":"Sender ID that can be alphanumeric or numeric.", + "readOnly":true + }, + "text":{ + "type":"string", + "description":"Content of the message being sent.", + "readOnly":true + }, + "sentAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message was [scheduled](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.", + "readOnly":true + }, + "doneAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the Infobip services finished processing the message (i.e. delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.", + "readOnly":true + }, + "smsCount":{ + "type":"integer", + "format":"int32", + "description":"The number of parts the message content was split into.", + "readOnly":true + }, + "mccMnc":{ + "type":"string", + "description":"Mobile country and network codes.", + "readOnly":true + }, + "price":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogPrice" + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogStatus" + }, + "error":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogError" + }, + "applicationId":{ + "type":"string", + "description":"Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "entityId":{ + "type":"string", + "description":"Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID of a campaign that was sent in the message." + } + }, + "readOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogError":{ + "type":"object", + "properties":{ + "groupId":{ + "type":"integer", + "format":"int32", + "description":"Error group ID.", + "readOnly":true + }, + "groupName":{ + "type":"string", + "description":"Error group name.", + "readOnly":true + }, + "id":{ + "type":"integer", + "format":"int32", + "description":"Error ID.", + "readOnly":true + }, + "name":{ + "type":"string", + "description":"Error name.", + "readOnly":true + }, + "description":{ + "type":"string", + "description":"Human-readable description of the error..", + "readOnly":true + }, + "permanent":{ + "type":"boolean", + "description":"Tells if the error is permanent.", + "readOnly":true + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogPrice":{ + "type":"object", + "properties":{ + "pricePerMessage":{ + "type":"number", + "format":"double", + "description":"Price per one SMS.", + "readOnly":true + }, + "currency":{ + "type":"string", + "description":"The currency in which the price is expressed.", + "readOnly":true + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogResponseSmsLogSmsMessageContent":{ + "type":"object", + "properties":{ + "results":{ + "type":"array", + "description":"An array of message log results, one object per each message log entry.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsLogSmsMessageContent" + } + }, + "cursor":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.CursorPageInfo" + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LogStatus":{ + "type":"object", + "properties":{ + "groupId":{ + "type":"integer", + "format":"int32", + "description":"Status group ID.", + "readOnly":true + }, + "groupName":{ + "type":"string", + "description":"Status group name that describes which category the status code belongs to, e.g. PENDING, UNDELIVERABLE, DELIVERED, EXPIRED, REJECTED.", + "readOnly":true + }, + "id":{ + "type":"integer", + "format":"int32", + "description":"Status ID.", + "readOnly":true + }, + "name":{ + "type":"string", + "description":"[Status name](https://www.infobip.com/docs/essentials/response-status-and-error-codes).", + "readOnly":true + }, + "description":{ + "type":"string", + "description":"Human-readable description of the status.", + "readOnly":true + }, + "action":{ + "type":"string", + "description":"Action that should be taken to recover from the error.", + "readOnly":true + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageDeliveryReporting":{ + "type":"object", + "description":"Provides options for configuring the delivery report behavior.", + "properties":{ + "url":{ + "type":"string", + "description":"The URL on your call back server where a delivery report will be sent. If your URL becomes unavailable then the [retry cycle](https://www.infobip.com/docs/sms/sms-over-api#push-retry-cycle-notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`." + }, + "intermediateReport":{ + "type":"boolean", + "description":"The real-time intermediate delivery report containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`." + }, + "notify":{ + "type":"boolean", + "description":"Notify enables you to specify your preferences for receiving DLRs. If set to false, no DLR will be sent. Note: When no webhook is specified in the request and notify is set to 'true' or not defined, your Subscription settings will apply." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageError":{ + "type":"object", + "description":"Indicates whether an [error](https://www.infobip.com/docs/essentials/response-status-and-error-codes#error-codes) occurred during the query execution.", + "properties":{ + "groupId":{ + "type":"integer", + "format":"int32", + "description":"Error group ID." + }, + "groupName":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageErrorGroup" + }, + "id":{ + "type":"integer", + "format":"int32", + "description":"Error ID." + }, + "name":{ + "type":"string", + "description":"[Error name](https://www.infobip.com/docs/essentials/response-status-and-error-codes#error-codes)." + }, + "description":{ + "type":"string", + "description":"Human-readable description of the error." + }, + "permanent":{ + "type":"boolean", + "description":"Indicates whether the error is recoverable or not." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageErrorGroup":{ + "type":"string", + "description":"Error group name that describes which category the error code belongs to.", + "enum":[ + "OK", + "HANDSET_ERRORS", + "USER_ERRORS", + "OPERATOR_ERRORS" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageGeneralStatus":{ + "type":"string", + "description":"Status group name that describes which category the status code belongs to, i.e., [PENDING](https://www.infobip.com/docs/essentials/response-status-and-error-codes#pending-general-status-codes), [UNDELIVERABLE](https://www.infobip.com/docs/essentials/response-status-and-error-codes#undeliverable-general-status-codes), [DELIVERED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#delivered-general-status-codes), [EXPIRED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#expired-general-status-codes), [REJECTED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#rejected-general-status-codes).", + "enum":[ + "ACCEPTED", + "PENDING", + "UNDELIVERABLE", + "DELIVERED", + "EXPIRED", + "REJECTED" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessagePrice":{ + "type":"object", + "description":"Sent message price.", + "properties":{ + "pricePerMessage":{ + "type":"number", + "description":"Price per one message." + }, + "currency":{ + "type":"string", + "description":"The currency in which the price is expressed." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageResponseSmsMessageResponseDetails":{ + "type":"object", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "properties":{ + "messageId":{ + "type":"string", + "description":"Unique message ID. If not provided, it will be auto-generated and returned in the API response." + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageStatus" + }, + "destination":{ + "type":"string", + "description":"The destination address of the message, i.e., its recipient." + }, + "details":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageResponseDetails" + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageStatus":{ + "type":"object", + "description":"Indicates the [status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) of the message and how to recover from an error should there be any.", + "properties":{ + "groupId":{ + "type":"integer", + "format":"int32", + "description":"Status group ID." + }, + "groupName":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageGeneralStatus" + }, + "id":{ + "type":"integer", + "format":"int32", + "description":"Status code ID." + }, + "name":{ + "type":"string", + "description":"[Status code](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) name." + }, + "description":{ + "type":"string", + "description":"Human-readable description of the status." + }, + "action":{ + "type":"string", + "description":"Action to take to recover from the error." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MoPrice":{ + "type":"object", + "description":"A price object showing currency and a price per each message.", + "properties":{ + "pricePerMessage":{ + "type":"number", + "format":"double", + "description":"Price per one SMS." + }, + "currency":{ + "type":"string", + "description":"The currency in which the price is expressed." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Platform":{ + "type":"object", + "description":"Platform options. For more details, see [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "properties":{ + "entityId":{ + "type":"string", + "description":"Used when specifying an entity in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "maxLength":255, + "minLength":0 + }, + "applicationId":{ + "type":"string", + "description":"Used when specifying an application in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "maxLength":255, + "minLength":0 + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Preview":{ + "type":"object", + "description":"Allows for previewing the original message content once additional language configuration has been applied to it.", + "properties":{ + "textPreview":{ + "type":"string", + "description":"Preview of the message content as it should appear on the recipient’s device." + }, + "messageCount":{ + "type":"integer", + "format":"int32", + "description":"Number of SMS message parts required to deliver the message." + }, + "charactersRemaining":{ + "type":"integer", + "format":"int32", + "description":"Number of remaining characters in the last part of the SMS." + }, + "configuration":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LanguageConfiguration" + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Price":{ + "type":"object", + "description":"Sent SMS price.", + "properties":{ + "pricePerMessage":{ + "type":"number", + "format":"double", + "description":"Price per one SMS." + }, + "currency":{ + "type":"string", + "description":"The currency in which the price is expressed." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RecipientInfo":{ + "type":"object", + "description":"Recipient information such as device type, OS, device name.", + "properties":{ + "deviceType":{ + "type":"string", + "description":"The type of device used by the recipient to do the user action." + }, + "os":{ + "type":"string", + "description":"The type OS present in the device used by the recipient." + }, + "deviceName":{ + "type":"string", + "description":"Device name of the action originating device." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RecipientType":{ + "type":"string", + "description":"Recipient Type must be `TACIR` or `BIREYSEL`.", + "enum":[ + "BIREYSEL", + "TACIR" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RegionalOptions":{ + "type":"object", + "description":"Region-specific parameters, often imposed by local laws. Use this, if country or region that you are sending an SMS to requires additional information.", + "properties":{ + "indiaDlt":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.IndiaDltOptions" + }, + "turkeyIys":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.TurkeyIysOptions" + }, + "southKorea":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SouthKoreaOptions" + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RequestSchedulingSettings":{ + "type":"object", + "description":"Options for scheduling a message.", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response.", + "maxLength":100, + "minLength":0 + }, + "sendAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message is to be sent. Used for scheduled messages. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance." + }, + "sendingSpeedLimit":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SendingSpeedLimit" + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSBinaryMessage":{ + "type":"object", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "properties":{ + "binary":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.BinaryContent" + }, + "callbackData":{ + "type":"string", + "description":"Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters.", + "maxLength":4000, + "minLength":0, + "writeOnly":true + }, + "deliveryTimeWindow":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.DeliveryTimeWindow" + }, + "destinations":{ + "type":"array", + "description":"An array of destination objects for where messages are being sent. A valid destination is required.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Destination" + }, + "writeOnly":true + }, + "flash":{ + "type":"boolean", + "description":"Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS.", + "writeOnly":true + }, + "from":{ + "type":"string", + "description":"The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names).", + "writeOnly":true + }, + "intermediateReport":{ + "type":"boolean", + "description":"The [real-time intermediate delivery report](https://www.infobip.com/docs/api#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`.", + "writeOnly":true + }, + "notifyContentType":{ + "type":"string", + "description":"Preferred delivery report content type, `application/json` or `application/xml`.", + "writeOnly":true + }, + "notifyUrl":{ + "type":"string", + "description":"The URL on your call back server on which the Delivery report will be sent.", + "externalDocs":{ + "description":"Delivery report format", + "url":"#channels/sms/receive-outbound-sms-message-report" + }, + "writeOnly":true + }, + "regional":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.RegionalOptions" + }, + "sendAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message is to be sent. Used for [scheduled SMS](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance.", + "writeOnly":true + }, + "validityPeriod":{ + "type":"integer", + "format":"int64", + "description":"The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).", + "writeOnly":true + }, + "entityId":{ + "type":"string", + "description":"Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "maxLength":66, + "minLength":0, + "writeOnly":true + }, + "applicationId":{ + "type":"string", + "description":"Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "maxLength":66, + "minLength":0, + "writeOnly":true + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel.", + "maxLength":255, + "minLength":0 + } + }, + "required":[ + "destinations" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSResponseDetails":{ + "type":"object", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "properties":{ + "messageId":{ + "type":"string", + "description":"Unique message ID. If not passed, it will be automatically generated and returned in a response.", + "readOnly":true + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Status" + }, + "to":{ + "type":"string", + "description":"The destination address of the message.", + "readOnly":true + }, + "smsCount":{ + "type":"integer", + "format":"int32", + "description":"This is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted.", + "readOnly":true + } + }, + "readOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSTextualMessage":{ + "type":"object", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "properties":{ + "callbackData":{ + "type":"string", + "description":"Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters.", + "maxLength":4000, + "minLength":0, + "writeOnly":true + }, + "deliveryTimeWindow":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.DeliveryTimeWindow" + }, + "destinations":{ + "type":"array", + "description":"An array of destination objects for where messages are being sent. A valid destination is required.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Destination" + }, + "writeOnly":true + }, + "flash":{ + "type":"boolean", + "default":false, + "description":"Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS.", + "writeOnly":true + }, + "from":{ + "type":"string", + "description":"The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names).", + "writeOnly":true + }, + "intermediateReport":{ + "type":"boolean", + "description":"The [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`.", + "writeOnly":true + }, + "language":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Language" + }, + "notifyContentType":{ + "type":"string", + "description":"Preferred delivery report content type, `application/json` or `application/xml`.", + "writeOnly":true + }, + "notifyUrl":{ + "type":"string", + "description":"The URL on your call back server on to which a delivery report will be sent. The [retry cycle](https://www.infobip.com/docs/sms/sms-over-api#push-retry-cycle-notify-url) for when your URL becomes unavailable uses the following formula: `1min + (1min * retryNumber * retryNumber)`.", + "externalDocs":{ + "description":"Delivery report format", + "url":"#channels/sms/receive-sent-sms-report" + }, + "writeOnly":true + }, + "regional":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.RegionalOptions" + }, + "sendAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance.", + "writeOnly":true + }, + "text":{ + "type":"string", + "description":"Content of the message being sent.", + "writeOnly":true + }, + "transliteration":{ + "type":"string", + "description":"The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, `NON_UNICODE` and `ALL`.", + "writeOnly":true + }, + "validityPeriod":{ + "type":"integer", + "format":"int64", + "description":"The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`.", + "writeOnly":true + }, + "entityId":{ + "type":"string", + "description":"Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "maxLength":50, + "minLength":0, + "writeOnly":true + }, + "applicationId":{ + "type":"string", + "description":"Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).", + "maxLength":50, + "minLength":0, + "writeOnly":true + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel.", + "maxLength":255, + "minLength":0 + } + }, + "required":[ + "destinations" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SendingSpeedLimit":{ + "type":"object", + "description":"Limits the send speed when sending messages in bulk to deliver messages over a longer period of time. You may wish to use this to allow your systems or agents to handle large amounts of incoming traffic, e.g., if you are expecting recipients to follow through with a call-to-action option from a message you sent. Not setting a send speed limit can overwhelm your resources with incoming traffic.", + "properties":{ + "amount":{ + "type":"integer", + "format":"int32", + "description":"The number of messages to be sent per timeUnit. By default, the system sends messages as fast as the infrastructure allows. Use this parameter to adapt sending capacity to your needs. The system is only able to work against its maximum capacity for ambitious message batches." + }, + "timeUnit":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SpeedLimitTimeUnit" + } + }, + "required":[ + "amount" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsBinaryMessageContent":{ + "type":"object", + "allOf":[ + { + "type":"object", + "properties":{ + "dataCoding":{ + "type":"integer", + "format":"int32", + "default":0, + "description":"Binary content data coding. The default value is (`0`) for GSM7. Example: (`8`) for Unicode data.", + "example":8 + }, + "esmClass":{ + "type":"integer", + "format":"int32", + "default":0, + "description":"“Esm_class” parameter. Indicate special message attributes associated with the SMS. Default value is (`0`)." + }, + "hex":{ + "type":"string", + "description":"Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character.", + "example":"48 65 6c 6c 6f" + } + } + } + ], + "required":[ + "hex" + ], + "title":"binary content" + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsLanguage":{ + "type":"object", + "description":"Sets the language parameters for the message being sent.", + "properties":{ + "languageCode":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.LanguageCode" + }, + "singleShift":{ + "type":"boolean", + "default":false, + "description":"Uses a single shift table which enhances only the extension table of the GSM default alphabet. Allows you to selectively improve character support without altering the entire message." + }, + "lockingShift":{ + "type":"boolean", + "default":false, + "description":"Uses a locking shift table which allows you to represent characters beyond the standard GSM default alphabet. This flexibility enables better language support." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsLogSmsMessageContent":{ + "type":"object", + "description":"An array of message log results, one object per each message log entry.", + "properties":{ + "sender":{ + "type":"string", + "description":"The sender ID which can be alphanumeric or numeric." + }, + "destination":{ + "type":"string", + "description":"Message destination address." + }, + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + "example":"BULK-ID-123-xyz" + }, + "messageId":{ + "type":"string", + "description":"Unique message ID for which a log is requested." + }, + "sentAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ." + }, + "doneAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ." + }, + "messageCount":{ + "type":"integer", + "format":"int32", + "description":"The number of messages content was split to." + }, + "price":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessagePrice" + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageStatus" + }, + "error":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageError" + }, + "platform":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Platform" + }, + "content":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageContent" + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID of a campaign that was sent in the message." + }, + "mccMnc":{ + "type":"string", + "description":"Mobile country and network codes." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessage":{ + "type":"object", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "properties":{ + "sender":{ + "type":"string", + "description":"The sender ID. It can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names)." + }, + "destinations":{ + "type":"array", + "description":"An array of destination objects for where messages are being sent. A valid destination is required.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsToDestination" + } + }, + "content":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageContent" + }, + "options":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageOptions" + }, + "webhooks":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Webhooks" + } + }, + "required":[ + "content", + "destinations" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageContent":{ + "type":"object", + "description":"Message content.", + "oneOf":[ + { + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsTextMessageContent" + }, + { + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsBinaryMessageContent" + } + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageOptions":{ + "type":"object", + "description":"Message options.", + "properties":{ + "platform":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Platform" + }, + "validityPeriod":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.ValidityPeriod" + }, + "deliveryTimeWindow":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTimeWindow" + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel.", + "maxLength":255, + "minLength":0 + }, + "regional":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RegionalOptions" + }, + "flash":{ + "type":"boolean", + "description":"Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageRequestOptions":{ + "type":"object", + "description":"Options applicable to all messages in the request.", + "properties":{ + "schedule":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RequestSchedulingSettings" + }, + "tracking":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.UrlOptions" + }, + "includeSmsCountInResponse":{ + "type":"boolean", + "default":false, + "description":"Set to true to return `messageCount` in the response. The `messageCount` is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than the limit will be split into multiple SMS. Not compatible with `binary` message content type." + }, + "conversionTracking":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Tracking" + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageResponseDetails":{ + "type":"object", + "description":"Other details of the message.", + "properties":{ + "messageCount":{ + "type":"integer", + "format":"int32", + "description":"Number of SMS message parts required to deliver the message." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMoReport":{ + "type":"object", + "description":"An array of result objects.", + "properties":{ + "applicationId":{ + "type":"string", + "description":"Application id linked to the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "messageId":{ + "type":"string", + "description":"Unique message ID." + }, + "from":{ + "type":"string", + "description":"Sender ID that can be alphanumeric or numeric." + }, + "to":{ + "type":"string", + "description":"The destination address of the message." + }, + "text":{ + "type":"string", + "description":"Full content of the message." + }, + "cleanText":{ + "type":"string", + "description":"Content of the message without a keyword (if a keyword was sent)." + }, + "keyword":{ + "type":"string", + "description":"Keyword extracted from the message content." + }, + "receivedAt":{ + "type":"string", + "format":"date-time", + "description":"Indicates when the Infobip platform received the message. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`." + }, + "smsCount":{ + "type":"integer", + "format":"int32", + "description":"The number of parts the message content was split into." + }, + "price":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MoPrice" + }, + "callbackData":{ + "type":"string", + "description":"Custom callback data sent over the notifyUrl." + }, + "entityId":{ + "type":"string", + "description":"Entity id linked to the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsReport":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request." + }, + "messageId":{ + "type":"string", + "description":"Unique message ID." + }, + "to":{ + "type":"string", + "description":"Message destination address." + }, + "from":{ + "type":"string", + "description":"The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`)." + }, + "sentAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message was [scheduled](#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`." + }, + "doneAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`." + }, + "smsCount":{ + "type":"integer", + "format":"int32", + "description":"The number of parts the message content was split into." + }, + "mccMnc":{ + "type":"string", + "description":"Mobile country and network codes." + }, + "callbackData":{ + "type":"string", + "description":"Callback data sent through ‛callbackData‛ field when sending message." + }, + "price":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Price" + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Status" + }, + "error":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Error" + }, + "entityId":{ + "type":"string", + "description":"The entity used when sending the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "applicationId":{ + "type":"string", + "description":"The application used when sending the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "campaignReferenceId":{ + "type":"string", + "description":"ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsRequestEnvelope":{ + "type":"object", + "properties":{ + "messages":{ + "type":"array", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessage" + } + }, + "options":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMessageRequestOptions" + } + }, + "required":[ + "messages" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsResponseEnvelope":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically used for fetching delivery reports and message logs." + }, + "messages":{ + "type":"array", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageResponseSmsMessageResponseDetails" + } + } + }, + "required":[ + "messages" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsTextMessageContent":{ + "type":"object", + "allOf":[ + { + "type":"object", + "properties":{ + "text":{ + "type":"string", + "description":"Content of the message being sent." + }, + "transliteration":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.TransliterationCode" + }, + "language":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsLanguage" + } + } + } + ], + "required":[ + "text" + ], + "title":"text content" + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsToDestination":{ + "type":"object", + "description":"An array of destination objects for where messages are being sent. A valid destination is required.", + "properties":{ + "to":{ + "type":"string", + "description":"The destination address of the message.", + "maxLength":64, + "minLength":0 + }, + "messageId":{ + "type":"string", + "description":"The ID that uniquely identifies the message sent.", + "maxLength":200, + "minLength":0 + }, + "networkId":{ + "type":"integer", + "format":"int32", + "description":"Available in US and Canada only if networkId is known for Network Operator of the destination. Returned in [SMS message delivery reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports) and [Inbound SMS](https://www.infobip.com/docs/api/channels/sms/sms-messaging/inbound-sms); contact Infobip Support to enable." + } + }, + "required":[ + "to" + ], + "title":"Destination" + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SouthKoreaOptions":{ + "type":"object", + "description":"Use case dependent parameters for sending SMS to phone numbers registered in South Korea.", + "properties":{ + "title":{ + "type":"string", + "description":"Title of the message.", + "maxLength":66, + "minLength":0 + }, + "resellerCode":{ + "type":"integer", + "format":"int32", + "description":"Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SpeedLimitTimeUnit":{ + "type":"string", + "default":"MINUTE", + "description":"The time unit to define when setting a messaging speed limit. Defaults to `MINUTE`.", + "enum":[ + "MINUTE", + "HOUR", + "DAY" + ], + "writeOnly":true + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Status":{ + "type":"object", + "description":"Indicates the [status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) of the message and how to recover from an error should there be any.", + "properties":{ + "groupId":{ + "type":"integer", + "format":"int32", + "description":"Status group ID." + }, + "groupName":{ + "type":"string", + "description":"Status group name that describes which category the status code belongs to, e.g. PENDING, UNDELIVERABLE, DELIVERED, EXPIRED, REJECTED." + }, + "id":{ + "type":"integer", + "format":"int32", + "description":"Status ID." + }, + "name":{ + "type":"string", + "description":"[Status name](https://www.infobip.com/docs/essentials/response-status-and-error-codes)." + }, + "description":{ + "type":"string", + "description":"Human-readable description of the status." + }, + "action":{ + "type":"string", + "description":"Action that should be taken to recover from the error." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Tracking":{ + "type":"object", + "description":"Allows you to set up tracking parameters to track conversion metrics. For more details, see: [SMS with conversion tracking](https://www.infobip.com/docs/sms/sms-over-api#send-sms-with-conversion-tracking).", + "properties":{ + "useConversionTracking":{ + "type":"boolean", + "description":"Indicates if a message has to be tracked for conversion rates. Default \"false\"." + }, + "conversionTrackingName":{ + "type":"string", + "description":"Sets a custom conversion type naming convention, e.g. `ONE_TIME_PIN` or `SOCIAL_INVITES`." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.TransliterationCode":{ + "type":"string", + "description":"The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`,`NON_UNICODE` and `ALL`.", + "enum":[ + "NONE", + "TURKISH", + "GREEK", + "CYRILLIC", + "SERBIAN_CYRILLIC", + "CENTRAL_EUROPEAN", + "BALTIC", + "NON_UNICODE", + "PORTUGUESE", + "COLOMBIAN", + "BULGARIAN_CYRILLIC", + "ALL" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.TurkeyIysOptions":{ + "type":"object", + "description":"IYS regulations specific parameters required for sending promotional SMS to phone numbers registered in Turkey.", + "properties":{ + "brandCode":{ + "type":"integer", + "format":"int32", + "description":"Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account." + }, + "recipientType":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RecipientType" + } + }, + "required":[ + "recipientType" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.UrlOptions":{ + "type":"object", + "description":"Sets up [URL shortening](https://www.infobip.com/docs/url-shortening) and tracking feature.", + "properties":{ + "shortenUrl":{ + "type":"boolean", + "default":true, + "description":"Enable shortening of the URLs within a message. Set this to `true`, if you want to set up other URL options." + }, + "trackClicks":{ + "type":"boolean", + "default":true, + "description":"Enable tracking of short URL clicks within a message: which URL was clicked, how many times, and by whom." + }, + "trackingUrl":{ + "type":"string", + "description":"The URL of your callback server on to which the Click report will be sent." + }, + "removeProtocol":{ + "type":"boolean", + "default":false, + "description":"Remove a protocol, such as `https://`, from links to shorten a message. Note that some mobiles may not recognize such links as a URL." + }, + "customDomain":{ + "type":"string", + "description":"Select a predefined custom domain to use when generating a short URL." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.UrlTrackingWebhook":{ + "type":"object", + "properties":{ + "notificationType":{ + "type":"string", + "description":"Tells the type of user event that took place. Possible events: CLICKED" + }, + "recipient":{ + "type":"string", + "description":"Recipient of the message." + }, + "url":{ + "type":"string", + "description":"The link the recipient has clicked." + }, + "sendDateTime":{ + "type":"integer", + "format":"int64", + "description":"This is timestamp epoch millis when we received event for CLICK." + }, + "messageId":{ + "type":"string", + "description":"The ID that uniquely identifies the message sent to the recipient." + }, + "bulkId":{ + "type":"string", + "description":"The ID that uniquely identifies a list of messages. This is either defined by user in the request or auto generated." + }, + "callbackData":{ + "type":"string", + "description":"The callback data sent through the callbackData field in your fully featured message." + }, + "recipientInfo":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.RecipientInfo" + }, + "geoLocationInfo":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.GeoLocationInfoWrapper" + }, + "applicationId":{ + "type":"string", + "description":"Used when specifying an application in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + }, + "entityId":{ + "type":"string", + "description":"Used when specifying an entity in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management)." + } + } + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.ValidityPeriod":{ + "type":"object", + "description":"Message validity period. Once expired, the message won't be sent. Validity period longer than 48h is not supported. If exceeded, it will be automatically set to 48h.", + "properties":{ + "amount":{ + "type":"integer", + "format":"int32", + "description":"Message validity period's value. If `timeUnit` is not set, it will default to `MINUTES`." + }, + "timeUnit":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.ValidityPeriodTimeUnit" + } + }, + "required":[ + "amount" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.ValidityPeriodTimeUnit":{ + "type":"string", + "default":"MINUTES", + "description":"Message validity period time unit.", + "enum":[ + "SECONDS", + "MINUTES", + "HOURS" + ] + }, + "20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Webhooks":{ + "type":"object", + "description":"Provides options for configuring message webhooks.", + "properties":{ + "delivery":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.MessageDeliveryReporting" + }, + "contentType":{ + "type":"string", + "description":"Preferred delivery report content type, `application/json` or `application/xml`." + }, + "callbackData":{ + "type":"string", + "description":"Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message Delivery Report. The maximum value is 4000 characters.", + "maxLength":4000, + "minLength":0 + } + } + }, + "33e5f9b198702dad16ca1f81c1bb567a11b08d145013a25f78031b56a52d656b.SMSResponse":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs).", + "readOnly":true + }, + "messages":{ + "type":"array", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSResponseDetails" + }, + "readOnly":true + } + }, + "title":"SMSResponse" + }, + "578c889dd8f68587bd351066c5c6572a98ea0c15c65b5cacb8779be90fbfbb70.ApiException":{ + "type":"object", + "properties":{ + "requestError":{ + "$ref":"#/components/schemas/ApiRequestError" + } + }, + "title":"ApiException" + }, + "57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkRequest":{ + "type":"object", + "properties":{ + "sendAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message is to be sent. Used for scheduled SMS (see [Scheduled SMS endpoints](#channels/sms/get-scheduled-sms-messages) for more details). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance.", + "readOnly":false, + "writeOnly":false + } + }, + "required":[ + "sendAt" + ], + "title":"BulkRequest" + }, + "57f158537de21663cfc8ee15d25363b88564fe0d07c269faa4678bc22fd7bdbb.BulkResponse":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.", + "readOnly":true, + "writeOnly":false + }, + "sendAt":{ + "type":"string", + "format":"date-time", + "description":"Date and time when the message is to be sent. Used for scheduled SMS (see [Scheduled SMS endpoints](#channels/sms/get-scheduled-sms-messages) for more details). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance.", + "readOnly":true, + "writeOnly":false + } + }, + "title":"BulkResponse" + }, + "5e0af18dea7a9fe7fc7475b275c0dd721ec8be9556c5d111334ce121ba3ef90a.EndTagResponse":{ + "type":"object", + "properties":{ + "processKey":{ + "type":"string", + "description":"Process key assigned to account ID.", + "readOnly":false, + "writeOnly":false + } + }, + "title":"EndTagResponse" + }, + "7b23cc7ec456214e90b61e3d5abd3aaf7422ea4b20f1cdd2d4e9c44fbceaf035.SMSAdvancedBinaryRequest":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). Anything above 100 characters passed in the request will be clipped during processing and returned in response, reports and logs." + }, + "messages":{ + "type":"array", + "description":"An array of message objects of a single message or multiple messages sent under one bulk ID.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSBinaryMessage" + } + }, + "sendingSpeedLimit":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.SendingSpeedLimit" + } + }, + "required":[ + "messages" + ], + "title":"SMSAdvancedBinaryRequest" + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.DeliveryTimeWindow":{ + "type":"object", + "description":"Sets specific SMS delivery window outside of which messages won't be delivered. Often, used when there are restrictions on when messages can be sent.", + "properties":{ + "days":{ + "type":"array", + "description":"Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryDay" + }, + "writeOnly":true + }, + "from":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTimeFrom" + }, + "to":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryTimeTo" + } + }, + "required":[ + "days" + ], + "title":"DeliveryTimeWindow", + "writeOnly":true + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.IndiaDltOptions":{ + "type":"object", + "description":"Distributed Ledger Technology (DLT) specific parameters required for sending SMS to phone numbers registered in India.", + "properties":{ + "contentTemplateId":{ + "type":"string", + "description":"Registered DLT content template ID which matches message you are sending." + }, + "principalEntityId":{ + "type":"string", + "description":"Your assigned DLT principal entity ID." + }, + "telemarketerId":{ + "type":"string", + "description":"Your assigned Telemarketer ID. (required for Aggregators)" + } + }, + "required":[ + "principalEntityId" + ], + "title":"IndiaDltOptions" + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.RegionalOptions":{ + "type":"object", + "description":"Region-specific parameters, often imposed by local laws. Use this, if country or region that you are sending an SMS to requires additional information.", + "properties":{ + "indiaDlt":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.IndiaDltOptions" + }, + "turkeyIys":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.TurkeyIysOptions" + }, + "southKorea":{ + "$ref":"#/components/schemas/87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.SouthKoreaOptions" + } + }, + "title":"RegionalOptions" + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.SendingSpeedLimit":{ + "type":"object", + "description":"Limits the send speed when sending messages in bulk to deliver messages over a longer period of time. You may wish to use this to allow your systems or agents to handle large amounts of incoming traffic, e.g., if you are expecting recipients to follow through with a call-to-action option from a message you sent. Not setting a send speed limit can overwhelm your resources with incoming traffic.", + "properties":{ + "amount":{ + "type":"integer", + "format":"int32", + "description":"The number of messages to be sent per timeUnit. By default, the system sends messages as fast as the infrastructure allows. Use this parameter to adapt sending capacity to your needs. The system is only able to work against its maximum capacity for ambitious message batches.", + "writeOnly":true + }, + "timeUnit":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SpeedLimitTimeUnit" + } + }, + "required":[ + "amount" + ], + "title":"SendingSpeedLimit" + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.SouthKoreaOptions":{ + "type":"object", + "description":"Use case dependent parameters for sending SMS to phone numbers registered in South Korea.", + "properties":{ + "resellerCode":{ + "type":"integer", + "format":"int32", + "description":"Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending." + }, + "title":{ + "type":"string", + "description":"Set the title or subject of a message. South Korea only.", + "maxLength":66, + "minLength":0 + } + }, + "title":"SouthKoreaOptions" + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.Tracking":{ + "type":"object", + "description":"Sets up tracking parameters to track conversion metrics and type. This is a legacy feature not compatible with the `tracking` feature in latest [Send SMS message](#channels/sms/send-sms-messages) API.", + "properties":{ + "baseUrl":{ + "type":"string", + "description":"Custom base URL for shortened links in messages when tracking URL conversions. Legacy - use `urlOptions` instead.", + "writeOnly":true + }, + "processKey":{ + "type":"string", + "description":"The process key which uniquely identifies conversion tracking.", + "writeOnly":true + }, + "track":{ + "type":"string", + "description":"Indicates if a message has to be tracked for conversion rates. Values are: `SMS` and `URL`. `URL` is a legacy value. Use `urlOptions` instead. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion).", + "writeOnly":true + }, + "type":{ + "type":"string", + "description":"Sets a custom conversion type naming convention, e.g. `ONE_TIME_PIN` or `SOCIAL_INVITES`.", + "writeOnly":true + } + }, + "title":"Tracking" + }, + "87cf6d665490382407be009353007f071b1d6d4a375e96d31d3bf0b04b7fb3c7.TurkeyIysOptions":{ + "type":"object", + "description":"IYS regulations specific parameters required for sending promotional SMS to phone numbers registered in Turkey.", + "properties":{ + "brandCode":{ + "type":"integer", + "format":"int32", + "description":"Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account." + }, + "recipientType":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.IysRecipientType" + } + }, + "required":[ + "recipientType" + ], + "title":"TurkeyIysOptions" + }, + "ApiError":{ + "type":"object", + "properties":{ + "errorCode":{ + "type":"string", + "description":"An error code uniquely identifying the error case." + }, + "description":{ + "type":"string", + "description":"A detailed description of an error." + }, + "action":{ + "type":"string", + "description":"An action that should be taken to recover from the error." + }, + "violations":{ + "type":"array", + "description":"List of violations that caused the error.", + "items":{ + "$ref":"#/components/schemas/ApiErrorViolation" + } + }, + "resources":{ + "type":"array", + "description":"List of available resources to recover from the error.", + "items":{ + "$ref":"#/components/schemas/ApiErrorResource" + } + } + }, + "required":[ + "action", + "description", + "errorCode", + "resources", + "violations" + ] + }, + "ApiErrorResource":{ + "type":"object", + "description":"List of available resources to recover from the error.", + "properties":{ + "name":{ + "type":"string", + "description":"Resource name." + }, + "url":{ + "type":"string", + "description":"Resource URL." + } + } + }, + "ApiErrorViolation":{ + "type":"object", + "description":"List of violations that caused the error.", + "properties":{ + "property":{ + "type":"string", + "description":"Request property that caused the error." + }, + "violation":{ + "type":"string", + "description":"Detailed violation description." + } + } + }, + "ApiException":{ + "type":"object", + "properties":{ + "requestError":{ + "$ref":"#/components/schemas/ApiRequestError" + } + }, + "title":"ApiException" + }, + "ApiRequestError":{ + "type":"object", + "properties":{ + "serviceException":{ + "$ref":"#/components/schemas/ApiRequestErrorDetails" + } + } + }, + "ApiRequestErrorDetails":{ + "type":"object", + "properties":{ + "messageId":{ + "type":"string", + "description":"Identifier of the error." + }, + "text":{ + "type":"string", + "description":"Detailed error description." + }, + "validationErrors":{ + "type":"object", + "additionalProperties":{ + "type":"array", + "description":"Validation errors.", + "items":{ + "type":"string", + "description":"Validation errors." + } + }, + "description":"Validation errors." + } + } + }, + "a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiException":{ + "type":"object", + "properties":{ + "requestError":{ + "allOf":[ + {} + ] + } + }, + "title":"ApiException" + }, + "a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiRequestError":{ + "type":"object", + "properties":{ + "serviceException":{ + "allOf":[ + { + "$ref":"#/components/schemas/a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiRequestErrorDetails" + } + ] + } + }, + "title":"ApiRequestError" + }, + "a5804333494e3ff9efc892264ce4e5f88c9e76f51310d829d838569a118300dd.ApiRequestErrorDetails":{ + "type":"object", + "properties":{ + "messageId":{ + "type":"string", + "description":"Identifier of the error.", + "readOnly":false, + "writeOnly":false + }, + "text":{ + "type":"string", + "description":"Detailed error description.", + "readOnly":false, + "writeOnly":false + } + }, + "title":"ApiRequestErrorDetails" + }, + "afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiException":{ + "type":"object", + "properties":{ + "requestError":{ + "allOf":[ + { + "$ref":"#/components/schemas/afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiRequestError" + } + ] + } + }, + "title":"ApiException" + }, + "afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiRequestError":{ + "type":"object", + "properties":{ + "serviceException":{ + "allOf":[ + { + "$ref":"#/components/schemas/afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiRequestErrorDetails" + } + ] + } + }, + "title":"ApiRequestError" + }, + "afc47ed3ecce0d042db7648b2699b209de7fd712b3df90ffbf75e4058f683890.ApiRequestErrorDetails":{ + "type":"object", + "properties":{ + "messageId":{ + "type":"string", + "description":"Identifier of the error.", + "readOnly":false, + "writeOnly":false + }, + "text":{ + "type":"string", + "description":"Detailed error description.", + "readOnly":false, + "writeOnly":false + } + }, + "title":"ApiRequestErrorDetails" + }, + "b28487c847ed2327e816f04e75efdaf507ffcf1d938d91963e2ce7298453183f.BulkStatusResponse":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request." + }, + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.BulkStatus" + } + }, + "title":"BulkStatusResponse" + }, + "b41d7b140d24800c94ddcc7df92e32ab37fc7d5f310ce1050b04561c5e59a3b7.LogsResponse":{ + "type":"object", + "properties":{ + "results":{ + "type":"array", + "description":"Collection of logs.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Log" + }, + "readOnly":true + } + }, + "title":"LogsResponse" + }, + "b888d833f5e2077036527211f9d9a5502285e1c742cd8459a9d3ad85cb1fa1f5.PreviewResponse":{ + "type":"object", + "properties":{ + "originalText":{ + "type":"string", + "description":"Message content supplied in the request." + }, + "previews":{ + "type":"array", + "description":"Allows for previewing the original message content once additional language configuration has been applied to it.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.Preview" + } + } + }, + "title":"PreviewResponse" + }, + "c8006fe0d154740d4f3e0ed89b54c9c54d35edf85894782dbfe7d9ae0ea23725.UpdateStatusRequest":{ + "type":"object", + "properties":{ + "status":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.BulkStatus" + } + }, + "required":[ + "status" + ], + "title":"UpdateStatusRequest" + }, + "cb1ef9a380a46bb9d49281818dd22b206a7f89260670bd103daadd3abc4386a3.QuerySmsResponse":{ + "type":"object", + "properties":{ + "bulkId":{ + "type":"string", + "description":"The ID that uniquely identifies the request. Bulk ID will be received only when a message is sent to more than one destination address.", + "readOnly":true + }, + "messages":{ + "type":"array", + "description":"Array of sent message objects, one object per every message.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SMSResponseDetails" + }, + "readOnly":true + } + }, + "title":"QuerySmsResponse" + }, + "cd5e571e477c0b81ca50ad592cf9f67cc32feded2012ec26d7fae09c0c2d5108.SmsMoReportResponse":{ + "type":"object", + "properties":{ + "results":{ + "type":"array", + "description":"An array of result objects.", + "items":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.SmsMoReport" + } + }, + "messageCount":{ + "type":"integer", + "format":"int32", + "description":"The number of messages returned in the `results` array." + }, + "pendingMessageCount":{ + "type":"integer", + "format":"int32", + "description":"The number of messages that have not been pulled in." + } + }, + "title":"SmsMoReportResponse" + } + }, + "responses":{ + "ApiError401":{ + "description":"Unauthorized", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":{ + "errorCode":"E401", + "description":"The request lacks valid authentication credentials for the requested resource.", + "action":"Check the resources and adjust authentication credentials.", + "violations":[], + "resources":[ + { + "name":"API Authentication", + "url":"https://www.infobip.com/docs/essentials/api-authentication" + } + ] + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":"\n E401\n The request lacks valid authentication credentials for the requested resource.\n Check the resources and adjust authentication credentials.\n \n \n \n API Authentication\n https://www.infobip.com/docs/essentials/api-authentication\n \n \n\n" + } + } + }, + "ApiError403":{ + "description":"Forbidden", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":{ + "errorCode":"E403", + "description":"Insufficient permissions to access the requested resource.", + "action":"Repeat the request with new or different credentials.", + "violations":[], + "resources":[ + { + "name":"API Scopes", + "url":"https://www.infobip.com/docs/essentials/api-essentials/api-authorization#api-scopes" + } + ] + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":"\n E403\n Insufficient permissions to access the requested resource.\n Repeat the request with new or different credentials.\n \n \n \n API Scopes\n https://www.infobip.com/docs/essentials/api-essentials/api-authorization#api-scopes\n \n \n\n" + } + } + }, + "ApiError429":{ + "description":"Too Many Requests", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":{ + "errorCode":"E429", + "description":"Too many requests sent.", + "action":"Check request rate limit specified in the API endpoint documentation resource.", + "violations":[], + "resources":[ + { + "name":"Throttling handling errors", + "url":"https://www.infobip.com/docs/essentials/integration-best-practices#throttling-handling-errors" + } + ] + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":"\n E429\n Too many requests sent.\n Check request rate limit specified in the API endpoint documentation resource.\n \n \n \n Throttling handling errors\n https://www.infobip.com/docs/essentials/integration-best-practices#throttling-handling-errors\n \n \n\n" + } + } + }, + "ApiError500":{ + "description":"Internal Server Error", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":{ + "errorCode":"E500", + "description":"Something went wrong.", + "action":"Contact the support.", + "violations":[], + "resources":[] + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiError" + }, + "example":"\n E500\n Something went wrong.\n Contact the support.\n \n \n\n" + } + } + }, + "ApiException400":{ + "description":"Bad Request", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":{ + "requestError":{ + "serviceException":{ + "messageId":"BAD_REQUEST", + "text":"Bad request" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":"\n \n \n BAD_REQUEST\n Bad request\n \n \n\n" + } + } + }, + "ApiException401":{ + "description":"Unauthorized", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":{ + "requestError":{ + "serviceException":{ + "messageId":"UNAUTHORIZED", + "text":"Unauthorized" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":"\n \n \n UNAUTHORIZED\n Unauthorized\n \n \n\n" + } + } + }, + "ApiException403":{ + "description":"Forbidden", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":{ + "requestError":{ + "serviceException":{ + "messageId":"FORBIDDEN", + "text":"Forbidden" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":"\n \n \n FORBIDDEN\n Forbidden\n \n \n\n" + } + } + }, + "ApiException404":{ + "description":"Not Found", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":{ + "requestError":{ + "serviceException":{ + "messageId":"NOT_FOUND", + "text":"Not found" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":"\n \n \n NOT_FOUND\n Not found\n \n \n\n" + } + } + }, + "ApiException429":{ + "description":"Too Many Requests", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":{ + "requestError":{ + "serviceException":{ + "messageId":"TOO_MANY_REQUESTS", + "text":"Too many requests" + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":"\n \n \n TOO_MANY_REQUESTS\n Too many requests\n \n \n\n" + } + } + }, + "ApiException500":{ + "description":"Internal Server Error", + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":{ + "requestError":{ + "serviceException":{ + "messageId":"GENERAL_ERROR", + "text":"Something went wrong. Please contact support." + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/ApiException" + }, + "example":"\n \n \n GENERAL_ERROR\n Something went wrong. Please contact support.\n \n \n\n" + } + } + } + }, + "parameters":{}, + "examples":{}, + "requestBodies":{}, + "headers":{}, + "securitySchemes":{ + "APIKeyHeader":{ + "type":"apiKey", + "description":"This is the most secure authorization type and the one with the most flexibility.\n\nAPI keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can\nbe revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases.\nFinally, the loss of an API key is easily manageable.\n\nYou can manage your API keys from [GUI](https://portal.infobip.com/settings/accounts/api-keys), or programmatically\nwith [dedicated API](#platform-&-connectivity/settings).\n\nAPI key Authorization header example:\n\n```shell\nAuthorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9\n```\n", + "name":"Authorization", + "in":"header" + }, + "Basic":{ + "type":"http", + "description":"Basic authorization type can be used in situations when the API key is not available. For example, API methods for generating API keys should be authenticated\nwith the Basic type.\n\nIn this case, the credentials included in the Authorization header should be a Base64 encoded username and password combination. More formally, basic\nauthentication header can be constructed in three steps:\n\n* Username and password are concatenated using the colon `(:)` as a separator `username:password`.\n* The resulting string is encoded using the [RFC2045-MIME](https://www.ietf.org/rfc/rfc2045.txt) variant of Base64.\n* Encoded string is added as credentials after the `\"Basic \"` type.\n\nExample:\n\n```shell\nUsername: \"Aladdin\"\nPassword: \"openSesame\"\n\nConcatenated string: \"Aladdin:openSesame\"\n\nBase64 encoded string: \"QWxhZGRpbjpvcGVuU2VzYW1l\"\n\nAuthorization header: \"Basic QWxhZGRpbjpvcGVuU2VzYW1l\"\n```\n\n> **Implementation detail**: Base64 encoding is a standard and many available programming languages and frameworks provide convenient methods for encoding\n> strings.\n", + "scheme":"basic" + }, + "IBSSOTokenHeader":{ + "type":"apiKey", + "description":"This authorization type is suited for situations when you do not want to store Infobip credentials in your own app. Instead, your users will input their Infobip\ncredentials every time they access your application and the application will use those credentials to create a session. From then on, the session token can be\nused to authenticate subsequent API requests. Note that the session will expire automatically after a predefined period of inactivity, and can also be manually\nterminated by making an appropriate API call.\n\nYou can find more details on the creation and behavior of the session at\nthe [dedicated documentation page](#platform-connectivity/account-management/create-session).\n\nAfter obtaining the session token by calling the above-referenced API method you can include it in the Authorization header like this:\n\n```shell\nAuthorization: IBSSO 2f9b4d31-2d0d-49a8-85f0-9b862bdca394\n```\n", + "name":"Authorization", + "in":"header" + }, + "OAuth2":{ + "type":"oauth2", + "description":"Similarly to the IBSSO Token authentication you can use OAuth 2.0 bearer token with Infobip serving both as resource and authorization server. You can obtain\nthe access token using the client credentials grant from `auth/1/oauth2/token` endpoint. It will provide you with your access token, and its expiration period.\nYou can use the token to authorize your API calls until it expires. You can find out more about the process in\nthe [official specification](https://tools.ietf.org/html/rfc6749#section-4.4).\n\nYou can include your access token in the Authorization HTTP request header like this:\n\n```http\nAuthorization: Bearer \n```", + "flows":{ + "clientCredentials":{ + "tokenUrl":"https://api.infobip.com/auth/1/oauth2/token", + "scopes":{} + } + } + } + }, + "links":{}, + "callbacks":{} + }, + "webhooks":{ + "receive-inbound-sms-messages":{ + "post":{ + "tags":[ + "channels", + "sms", + "inbound-sms" + ], + "summary":"Receive inbound SMS messages", + "description":"Receive SMS messages from your subscribers and have them delivered to you in real-time. To use this method, you’d need to:
  1. Buy a number capable of receiving SMS traffic.
  2. Specify a forwarding endpoint for the number and optionally configure other inbound settings.
We will then send inbound messages to you as soon as they are delivered to us by a mobile network operator.
The name of a default format or renderer for the inbound SMS messages is `MO_JSON_2`, and is documented in this section.", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"receive-inbound-sms-messages", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/cd5e571e477c0b81ca50ad592cf9f67cc32feded2012ec26d7fae09c0c2d5108.SmsMoReportResponse" + }, + "examples":{ + "Successful response":{ + "description":"Received SMS", + "value":{ + "results":[ + { + "messageId":"817790313235066447", + "from":"385916242493", + "to":"385921004026", + "text":"QUIZ Correct answer is Paris", + "cleanText":"Correct answer is Paris", + "keyword":"QUIZ", + "receivedAt":"2019-11-09T16:00:00.000+0000", + "smsCount":1, + "price":{ + "pricePerMessage":0, + "currency":"EUR" + }, + "callbackData":"callbackData" + } + ], + "messageCount":1, + "pendingMessageCount":1 + } + } + } + } + } + }, + "responses":{ + "200":{ + "description":"Your server returns this code if it accepts the callback." + } + } + } + }, + "receive-outbound-sms-message-reports-v3":{ + "post":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Receive outbound SMS message reports", + "description":"For every message you send, we offer the option to receive a delivery report. To use this feature, you should set up an endpoint to receive these reports. You can specify the endpoint URL using the webhooks > delivery > url parameter. Alternatively, you can set the endpoint URL through the [Subscriptions management](https://www.infobip.com/docs/cpaas-x/subscriptions-management). If you need assistance with this process, please contact support@infobip.com. Please note that the default number of delivery reports in a single request is 100. You can customize this value by defining \"maxBucketSize\" using the [Subscription Management API](https://www.infobip.com/docs/api/platform/subscriptions-api/create-subscription).\\\nYou'll receive this type of payload for messages sent using [Send SMS message](#channels/sms/send-sms-messages).", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"receive-outbound-sms-message-report-v3", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReports" + }, + "examples":{ + "Delivery report":{ + "value":{ + "results":[ + { + "bulkId":"BULK-ID-123-xyz", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"OK", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727", + "sender":"InfoSMS", + "sentAt":"2019-11-09T16:00:00.000+0100", + "doneAt":"2019-11-09T16:00:00.000+0100", + "messageCount":1, + "callbackData":"callbackData", + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + } + }, + { + "bulkId":"BULK-ID-123-xyz", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"OK", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5", + "to":"41793026834", + "sender":"InfoSMS", + "sentAt":"2019-11-09T17:00:00.000+0100", + "doneAt":"2019-11-09T17:00:00.000+0100", + "messageCount":1, + "platform":{ + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + } + } + ] + } + } + } + }, + "application/xml":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.DeliveryReports" + }, + "examples":{ + "Delivery report":{ + "value":"\n \n \n BULK-ID-123-xyz\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n OK\n 0\n NO_ERROR\n No Error\n false\n \n MESSAGE-ID-123-xyz\n 41793026727\n InfoSMS\n 2019-11-09T16:00:00.000+0100\n 2019-11-09T16:00:00.000+0100\n 1\n callbackData\n \n promotional-traffic-entity\n marketing-automation-application\n \n \n \n BULK-ID-123-xyz\n \n 0.01\n EUR\n \n \n 3\n DELIVERED\n 5\n DELIVERED_TO_HANDSET\n Message delivered to handset\n \n \n 0\n OK\n 0\n NO_ERROR\n No Error\n false\n \n 12db39c3-7822-4e72-a3ec-c87442c0ffc5\n 41793026834\n InfoSMS\n 2019-11-09T17:00:00.000+0100\n 2019-11-09T17:00:00.000+0100\n 1\n \n promotional-traffic-entity\n marketing-automation-application\n \n \n \n\n" + } + } + } + } + }, + "responses":{ + "200":{ + "description":"Your server returns this code if it accepts the callback." + } + } + } + }, + "receive-sms-tracking-notification":{ + "post":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Receive SMS tracking notifications", + "description":"For every message you send, we offer the option to send you clicked events. To enable this feature, you need to specify your endpoint URL either in the [tracking](https://www.infobip.com/docs/api/channels/sms/outbound-sms/send-sms-messages) or [urlOptions](https://www.infobip.com/docs/api/channels/sms/outbound-sms/send-sms-message) parameters when sending the SMS, or alternatively, configure it through [Subscriptions management](https://www.infobip.com/docs/cpaas-x/subscriptions-management). If you need assistance with this process, please contact support@infobip.com.
Use this data to monitor user engagement, analyze campaign performance, and trigger automated workflows based on user interactions. For more details, visit our dedicated pages on [URL shortening](https://www.infobip.com/docs/url-shortening) and [tracking options](https://www.infobip.com/docs/url-shortening/tracking).", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"receive-sms-tracking-notification", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/20085a4036d67f66ebf204560d55d58a7c131c15d42c8ed9442747c488e08630.UrlTrackingWebhook" + }, + "examples":{ + "UrlTrackingWebhook":{ + "value":{ + "notificationType":"CLICKED", + "recipient":"41793026727", + "url":"https://www.google.com", + "sendDateTime":1704106800000, + "messageId":"a28dd97c-1ffb-4fcf-99f1-0b557ed381da", + "bulkId":"17575032561857950495083", + "callbackData":"Callback data", + "recipientInfo":{ + "deviceType":"Phone", + "os":"iOS 12", + "deviceName":"Apple" + }, + "geoLocationInfo":{ + "countryName":"United States", + "city":"Los Angeles" + }, + "applicationId":"traffic-application", + "entityId":"traffic-entity" + } + } + } + } + } + }, + "responses":{ + "200":{ + "description":"Your server returns this code if it accepts the callback." + } + } + } + }, + "receive-outbound-sms-message-reports":{ + "post":{ + "tags":[ + "channels", + "sms", + "logs-and-status-reports" + ], + "summary":"Receive outbound SMS message report", + "description":"For every message you send, we offer the option to receive a delivery report. To use this feature, you should set up an endpoint to receive these reports. You can specify the endpoint [when sending SMS](#programmable-communications/sms/send-sms-message). Alternatively, you can set the endpoint URL through the [Subscriptions management](https://www.infobip.com/docs/cpaas-x/subscriptions-management). If you need assistance with this process, please contact support@infobip.com. Please note that the default number of delivery reports in a single request is 100. You can customize this value by defining \"maxBucketSize\" using the [Subscription Management API](https://www.infobip.com/docs/api/platform/subscriptions-api/create-subscription).\\\nYou'll receive this type of payload for messages sent using [Send SMS message](#channels/sms/send-sms-message) and [Send binary SMS message](#channels/sms/send-binary-sms-message).", + "externalDocs":{ + "description":"Learn more about the SMS channel and its use cases", + "url":"https://www.infobip.com/docs/sms" + }, + "operationId":"receive-outbound-sms-message-report", + "requestBody":{ + "content":{ + "application/json":{ + "schema":{ + "$ref":"#/components/schemas/1705572441d20bbbfe49765ca2bed87cd314f9c5c501048d5a9494385ff9f223.SMSReportResponse" + }, + "examples":{ + "Delivery reports":{ + "value":{ + "results":[ + { + "bulkId":"BULK-ID-123-xyz", + "messageId":"MESSAGE-ID-123-xyz", + "to":"41793026727", + "sentAt":"2019-11-09T16:00:00.000+0000", + "doneAt":"2019-11-09T16:00:00.000+0000", + "smsCount":1, + "callbackData":"callbackData", + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"Ok", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "entityId":"promotional-traffic-entity", + "applicationId":"marketing-automation-application" + }, + { + "bulkId":"BULK-ID-123-xyz", + "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5", + "to":"41793026834", + "sentAt":"2019-11-09T17:00:00.000+0000", + "doneAt":"2019-11-09T17:00:00.000+0000", + "smsCount":1, + "price":{ + "pricePerMessage":0.01, + "currency":"EUR" + }, + "status":{ + "groupId":3, + "groupName":"DELIVERED", + "id":5, + "name":"DELIVERED_TO_HANDSET", + "description":"Message delivered to handset" + }, + "error":{ + "groupId":0, + "groupName":"Ok", + "id":0, + "name":"NO_ERROR", + "description":"No Error", + "permanent":false + }, + "applicationId":"default" + } + ] + } + } + } + } + } + }, + "responses":{ + "200":{ + "description":"Your server returns this code if it accepts the callback." + } + }, + "deprecated":true + } + } + } +} \ No newline at end of file diff --git a/components/infobip/package.json b/components/infobip/package.json index 5f6c98ec34b75..c76473852087f 100644 --- a/components/infobip/package.json +++ b/components/infobip/package.json @@ -13,8 +13,8 @@ "access": "public" }, "scripts": { - "generate-actions": "node generate-actions.mjs", - "generate-infobip-app": "node generate-infobip-app.mjs" + "generate-app": "node generate-app.mjs", + "generate-actions": "node generate-actions.mjs" }, "dependencies": { "@pipedream/platform": "^1.6.2"