{"id":3023,"date":"2024-02-08T10:48:45","date_gmt":"2024-02-08T10:48:45","guid":{"rendered":"https:\/\/www.infobip.com\/developers\/?p=3023"},"modified":"2024-02-08T10:48:46","modified_gmt":"2024-02-08T10:48:46","slug":"how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk","status":"publish","type":"post","link":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk","title":{"rendered":"How to send an SMS with the Infobip API and Node.js SDK"},"content":{"rendered":"\n<img decoding=\"async\" src=\"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue\" alt=\"Node.js\">\n\n\n\n<p>As an outcome of this guide, you will learn how to send a simple text message to your handset with the Infobip SMS API and the <a href=\"https:\/\/github.com\/infobip-community\/infobip-api-node-sdk\">Infobip Node.js SDK<\/a>.<\/p>\n\n\n\n<p>To see the finished code, check the <a href=\"#Complete-code-example\">complete code example<\/a> at the bottom of this guide.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><p><a href=\"https:\/\/www.infobip.com\/signup\">Infobip account<\/a><\/p><\/li>\n\n\n\n<li><p>Working <a href=\"https:\/\/nodejs.org\/en\/download\/\">Node.js<\/a> environment or installed <a href=\"https:\/\/github.com\/nvm-sh\/nvm\">nvm<\/a><\/p>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Difficulty level<\/h2>\n\n\n\n<p>This guide assumes basic knowledge of Node.js and very basic familiarity with APIs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary of the steps<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install the <strong><a href=\"https:\/\/github.com\/infobip-community\/infobip-api-node-sdk\" target=\"_blank\" rel=\"noreferrer noopener\">Infobip API Node SDK<\/a><\/strong>.<\/li>\n\n\n\n<li>Import the <strong>Infobip<\/strong> and <strong>AuthType<\/strong> dependencies.<\/li>\n\n\n\n<li>Create an <strong>Infobip<\/strong> instance and add your base URL and the API key.<\/li>\n\n\n\n<li>Add the SMS payload to the <code>infobip.channel.sms.send<\/code> method.<\/li>\n\n\n\n<li>Log a response to track the status of your SMS message.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Install the Infobip API Node SDK<\/h2>\n\n\n<div id=\"gist120356653\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-node-install-sh\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-shell  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"node-install.sh content, created by infobipdev on 02:34PM on January 19, 2023.\">\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"node-install.sh\">\n        <tr class=\"line\">\n          <td id=\"file-node-install-sh-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-node-install-sh-LC1\" class=\"blob-code blob-code-inner js-file-line\">npm i -S @infobip-api\/sdk<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-install-sh-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-node-install-sh-LC2\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-install-sh-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-node-install-sh-LC3\" class=\"blob-code blob-code-inner js-file-line\">OR<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-install-sh-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-node-install-sh-LC4\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-install-sh-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-node-install-sh-LC5\" class=\"blob-code blob-code-inner js-file-line\">yarn add @infobip-api\/sdk<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/1ff944891a390ca0ab609c5e657ac04a\/raw\/828e6105613714afd7aa3c30033ea00fe26b5d7c\/node-install.sh\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/1ff944891a390ca0ab609c5e657ac04a#file-node-install-sh\" class=\"Link--inTextBlock\">\n          node-install.sh\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\">Import dependencies and create an Infobip client instance<\/h2>\n\n\n\n<p>You&#8217;ll use the client instance to authenticate against the Infobip API and access all its methods.<\/p>\n\n\n<div id=\"gist120413551\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-node-initialize-sdk-ts\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-typescript  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"node-initialize-sdk.ts content, created by infobipdev on 12:07PM on January 22, 2023.\">\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"node-initialize-sdk.ts\">\n        <tr class=\"line\">\n          <td id=\"file-node-initialize-sdk-ts-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-node-initialize-sdk-ts-LC1\" class=\"blob-code blob-code-inner js-file-line\">import { Infobip, AuthType } from '@infobip-api\/sdk';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-initialize-sdk-ts-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-node-initialize-sdk-ts-LC2\" class=\"blob-code blob-code-inner js-file-line\">const infobipClient = new Infobip({<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-initialize-sdk-ts-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-node-initialize-sdk-ts-LC3\" class=\"blob-code blob-code-inner js-file-line\">  baseUrl: process.env.INFOBIP_URL,<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-initialize-sdk-ts-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-node-initialize-sdk-ts-LC4\" class=\"blob-code blob-code-inner js-file-line\">  apiKey: process.env.INFOBIP_KEY,<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-initialize-sdk-ts-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-node-initialize-sdk-ts-LC5\" class=\"blob-code blob-code-inner js-file-line\">  authType: AuthType.ApiKey,<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-initialize-sdk-ts-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-node-initialize-sdk-ts-LC6\" class=\"blob-code blob-code-inner js-file-line\">});<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/8421b3b94b10f1df0476a1cf6546d0d7\/raw\/02a7748df72151f39b727765592ab88597b8cdd1\/node-initialize-sdk.ts\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/8421b3b94b10f1df0476a1cf6546d0d7#file-node-initialize-sdk-ts\" class=\"Link--inTextBlock\">\n          node-initialize-sdk.ts\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n\n\n\n<p><strong>Step 1.<\/strong> Import the <code>Infobip<\/code> and <code>AuthType<\/code> dependencies.<\/p>\n\n\n\n<p><strong>Step 2.<\/strong> Create an <code>Infobip<\/code> instance and add your <code>baseUrl<\/code> and <code>apiKey<\/code> that you can access either from your <a href=\"https:\/\/portal.infobip.com\/homepage\/\">Infobip account<\/a> or from the <a href=\"https:\/\/www.infobip.com\/docs\/api\">Infobip API landing page<\/a>, for those who logged in first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add the SMS payload<\/h2>\n\n\n\n<p>Use the <code>infobip.channel.sms.send<\/code> method to add the <a href=\"https:\/\/www.infobip.com\/docs\/api#channels\/sms\/send-sms-message\">SMS payload<\/a>.<\/p>\n\n\n<div id=\"gist120413588\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-node-sms-send-ts\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-typescript  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"node-sms-send.ts content, created by infobipdev on 12:08PM on January 22, 2023.\">\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"node-sms-send.ts\">\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC1\" class=\"blob-code blob-code-inner js-file-line\">try {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC2\" class=\"blob-code blob-code-inner js-file-line\">  const infobipResponse = await infobipClient.channels.sms.send({<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC3\" class=\"blob-code blob-code-inner js-file-line\">    type: 'text',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC4\" class=\"blob-code blob-code-inner js-file-line\">    messages: [{<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC5\" class=\"blob-code blob-code-inner js-file-line\">      destinations: [<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC6\" class=\"blob-code blob-code-inner js-file-line\">        {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC7\" class=\"blob-code blob-code-inner js-file-line\">          to: '447123456789',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC8\" class=\"blob-code blob-code-inner js-file-line\">        },<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC9\" class=\"blob-code blob-code-inner js-file-line\">      ],<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC10\" class=\"blob-code blob-code-inner js-file-line\">      from: 'Infosum SDK Test',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC11\" class=\"blob-code blob-code-inner js-file-line\">      text: 'Hello World',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC12\" class=\"blob-code blob-code-inner js-file-line\">    }],<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC13\" class=\"blob-code blob-code-inner js-file-line\">  });<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC14\" class=\"blob-code blob-code-inner js-file-line\">} catch (error) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC15\" class=\"blob-code blob-code-inner js-file-line\">  console.error(error);<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC16\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/ab723c179da71f77a690d27c74cdf7b2\/raw\/93649dd50ee3347951fc06685da7a7f9e92050be\/node-sms-send.ts\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/ab723c179da71f77a690d27c74cdf7b2#file-node-sms-send-ts\" class=\"Link--inTextBlock\">\n          node-sms-send.ts\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n\n\n\n<p>Key points:  <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The destination address in the <code>to<\/code> field must be in the international format, e.g. <code>447415774332<\/code>.<\/li>\n\n\n\n<li>If using a free Infobip trial account, the phone number you use must be the same phone number you&#8217;ve registered on signup for that account.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Add multiple recipients and multiple messages<\/h3>\n\n\n\n<p>Add multiple recipients by adding multiple <code>to<\/code> fields to the <code>destination<\/code> array. Similarly, create multiple objects within the <code>messages<\/code> array to send multiple messages with one request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Log a response to track the SMS status<\/h2>\n\n\n\n<p>Log the <code>data<\/code> object to view the response body. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const {data} = infobipResponse;\n  console.log(JSON.stringify(data));\n<\/code><\/pre>\n\n\n\n<p>The response contains a <code>messageId<\/code> that you can use for troubleshooting, analytics, scheduling, etc. In the case of multiple messages, your response will also contain an auto-generated <code>bulkId<\/code> that you can use similarly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"bulkId\": \"2034072219640523072\",\n  \"messages\": &#091;\n    {\n      \"messageId\": \"41793026727\",\n      \"status\": {\n        \"description\": \"Message sent to next instance\",\n        \"groupId\": 1,\n        \"groupName\": \"PENDING\",\n        \"id\": 26,\n        \"name\": \"MESSAGE_ACCEPTED\"\n      },\n      \"to\": \"2250be2d4219-3af1-78856-aabe-1362af1edfd2\"\n    }\n  ]\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Complete code example<\/h2>\n\n\n\n<p>All of the above is condensed into the following code snippet.<\/p>\n\n\n<div id=\"gist120413588\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-node-sms-send-ts\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-typescript  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"node-sms-send.ts content, created by infobipdev on 12:08PM on January 22, 2023.\">\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"node-sms-send.ts\">\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC1\" class=\"blob-code blob-code-inner js-file-line\">try {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC2\" class=\"blob-code blob-code-inner js-file-line\">  const infobipResponse = await infobipClient.channels.sms.send({<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC3\" class=\"blob-code blob-code-inner js-file-line\">    type: 'text',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC4\" class=\"blob-code blob-code-inner js-file-line\">    messages: [{<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC5\" class=\"blob-code blob-code-inner js-file-line\">      destinations: [<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC6\" class=\"blob-code blob-code-inner js-file-line\">        {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC7\" class=\"blob-code blob-code-inner js-file-line\">          to: '447123456789',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC8\" class=\"blob-code blob-code-inner js-file-line\">        },<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC9\" class=\"blob-code blob-code-inner js-file-line\">      ],<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC10\" class=\"blob-code blob-code-inner js-file-line\">      from: 'Infosum SDK Test',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC11\" class=\"blob-code blob-code-inner js-file-line\">      text: 'Hello World',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC12\" class=\"blob-code blob-code-inner js-file-line\">    }],<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC13\" class=\"blob-code blob-code-inner js-file-line\">  });<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC14\" class=\"blob-code blob-code-inner js-file-line\">} catch (error) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC15\" class=\"blob-code blob-code-inner js-file-line\">  console.error(error);<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-node-sms-send-ts-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-node-sms-send-ts-LC16\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/ab723c179da71f77a690d27c74cdf7b2\/raw\/93649dd50ee3347951fc06685da7a7f9e92050be\/node-sms-send.ts\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/ab723c179da71f77a690d27c74cdf7b2#file-node-sms-send-ts\" class=\"Link--inTextBlock\">\n          node-sms-send.ts\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>As an outcome of this guide, you will learn [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_import_markdown_pro_load_document_selector":20,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[12,255,244,264],"tags":[43,76],"coauthors":[134],"class_list":["post-3023","post","type-post","status-publish","format-standard","hentry","category-guide","category-infobip-products","category-javascript","category-sms","tag-api","tag-sdk"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to send an SMS with the Infobip API and Node.js SDK - Infobip Developers Hub<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to send an SMS with the Infobip API and Node.js SDK - Infobip Developers Hub\" \/>\n<meta property=\"og:description\" content=\"As an outcome of this guide, you will learn [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\" \/>\n<meta property=\"og:site_name\" content=\"Infobip Developers Hub\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/infobip\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-08T10:48:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-08T10:48:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue\" \/>\n<meta name=\"author\" content=\"Joanna Suau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JoannaSuau\" \/>\n<meta name=\"twitter:site\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joanna Suau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\"},\"author\":{\"name\":\"Joanna Suau\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/707842627f046bb5722c37a9fdc85d62\"},\"headline\":\"How to send an SMS with the Infobip API and Node.js SDK\",\"datePublished\":\"2024-02-08T10:48:45+00:00\",\"dateModified\":\"2024-02-08T10:48:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\"},\"wordCount\":400,\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue\",\"keywords\":[\"API\",\"SDK\"],\"articleSection\":[\"Guide\",\"Infobip Products\",\"JavaScript\",\"SMS\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\",\"name\":\"How to send an SMS with the Infobip API and Node.js SDK - Infobip Developers Hub\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue\",\"datePublished\":\"2024-02-08T10:48:45+00:00\",\"dateModified\":\"2024-02-08T10:48:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage\",\"url\":\"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue\",\"contentUrl\":\"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.infobip.com\/developers\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to send an SMS with the Infobip API and Node.js SDK\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\",\"url\":\"https:\/\/www.infobip.com\/developers\/\",\"name\":\"Infobip Developers Hub\",\"description\":\"Build meaningful customer relationships across any channel\",\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.infobip.com\/developers\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\",\"name\":\"Infobip Developers Hub\",\"url\":\"https:\/\/www.infobip.com\/developers\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png\",\"contentUrl\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png\",\"width\":696,\"height\":696,\"caption\":\"Infobip Developers Hub\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/infobip\/\",\"https:\/\/x.com\/InfobipDev\",\"https:\/\/www.youtube.com\/channel\/UCUPSTy53VecI5GIir3J3ZbQ\",\"https:\/\/github.com\/infobip-community\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/707842627f046bb5722c37a9fdc85d62\",\"name\":\"Joanna Suau\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/cccb05b0dfa8fde5d00a09f4047f929e\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b632afa61f1a27c1a0d823a9ec17eeb047cf476c570012dd90ba88a1bb9b1585?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b632afa61f1a27c1a0d823a9ec17eeb047cf476c570012dd90ba88a1bb9b1585?s=96&d=mm&r=g\",\"caption\":\"Joanna Suau\"},\"description\":\"Joanna is a Developer Educator at Infobip, working in the Developer Relations team.\",\"sameAs\":[\"https:\/\/medium.com\/@joanna.suau\",\"https:\/\/www.linkedin.com\/in\/joannasuau\/\",\"https:\/\/x.com\/JoannaSuau\"],\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/author\/joanna\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to send an SMS with the Infobip API and Node.js SDK - Infobip Developers Hub","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk","og_locale":"en_US","og_type":"article","og_title":"How to send an SMS with the Infobip API and Node.js SDK - Infobip Developers Hub","og_description":"As an outcome of this guide, you will learn [&hellip;]","og_url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk","og_site_name":"Infobip Developers Hub","article_publisher":"https:\/\/www.facebook.com\/infobip\/","article_published_time":"2024-02-08T10:48:45+00:00","article_modified_time":"2024-02-08T10:48:46+00:00","og_image":[{"url":"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue","type":"","width":"","height":""}],"author":"Joanna Suau","twitter_card":"summary_large_image","twitter_creator":"@JoannaSuau","twitter_site":"@InfobipDev","twitter_misc":{"Written by":"Joanna Suau","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#article","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk"},"author":{"name":"Joanna Suau","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/707842627f046bb5722c37a9fdc85d62"},"headline":"How to send an SMS with the Infobip API and Node.js SDK","datePublished":"2024-02-08T10:48:45+00:00","dateModified":"2024-02-08T10:48:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk"},"wordCount":400,"publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue","keywords":["API","SDK"],"articleSection":["Guide","Infobip Products","JavaScript","SMS"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk","url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk","name":"How to send an SMS with the Infobip API and Node.js SDK - Infobip Developers Hub","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue","datePublished":"2024-02-08T10:48:45+00:00","dateModified":"2024-02-08T10:48:46+00:00","breadcrumb":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#primaryimage","url":"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue","contentUrl":"https:\/\/img.shields.io\/badge\/Node.js-14%2B-blue"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-an-sms-with-the-infobip-api-and-node-js-sdk#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infobip.com\/developers\/"},{"@type":"ListItem","position":2,"name":"How to send an SMS with the Infobip API and Node.js SDK"}]},{"@type":"WebSite","@id":"https:\/\/www.infobip.com\/developers\/#website","url":"https:\/\/www.infobip.com\/developers\/","name":"Infobip Developers Hub","description":"Build meaningful customer relationships across any channel","publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.infobip.com\/developers\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.infobip.com\/developers\/#organization","name":"Infobip Developers Hub","url":"https:\/\/www.infobip.com\/developers\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/","url":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png","contentUrl":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png","width":696,"height":696,"caption":"Infobip Developers Hub"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/infobip\/","https:\/\/x.com\/InfobipDev","https:\/\/www.youtube.com\/channel\/UCUPSTy53VecI5GIir3J3ZbQ","https:\/\/github.com\/infobip-community"]},{"@type":"Person","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/707842627f046bb5722c37a9fdc85d62","name":"Joanna Suau","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/cccb05b0dfa8fde5d00a09f4047f929e","url":"https:\/\/secure.gravatar.com\/avatar\/b632afa61f1a27c1a0d823a9ec17eeb047cf476c570012dd90ba88a1bb9b1585?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b632afa61f1a27c1a0d823a9ec17eeb047cf476c570012dd90ba88a1bb9b1585?s=96&d=mm&r=g","caption":"Joanna Suau"},"description":"Joanna is a Developer Educator at Infobip, working in the Developer Relations team.","sameAs":["https:\/\/medium.com\/@joanna.suau","https:\/\/www.linkedin.com\/in\/joannasuau\/","https:\/\/x.com\/JoannaSuau"],"url":"https:\/\/www.infobip.com\/developers\/blog\/author\/joanna"}]}},"_links":{"self":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/3023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/comments?post=3023"}],"version-history":[{"count":12,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/3023\/revisions"}],"predecessor-version":[{"id":3042,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/3023\/revisions\/3042"}],"wp:attachment":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/media?parent=3023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/categories?post=3023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/tags?post=3023"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/coauthors?post=3023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}