{"id":2338,"date":"2023-08-15T18:00:16","date_gmt":"2023-08-15T18:00:16","guid":{"rendered":"https:\/\/www.infobip.com\/developers\/?p=2338"},"modified":"2023-09-11T14:27:27","modified_gmt":"2023-09-11T14:27:27","slug":"how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk","status":"publish","type":"post","link":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk","title":{"rendered":"How to send a WhatsApp text message with the Infobip Rust SDK"},"content":{"rendered":"\n<img decoding=\"async\" src=\"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue\" alt=\"Rust version\">\n\n\n\n<p class=\"wp-block-paragraph\">This guide will show you how to send a WhatsApp text message to your phone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can check the <a href=\"#the-complete-example\">complete code example<\/a> at the bottom of this guide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-whastapp-text-messages\">What are WhastApp text messages?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can only send text messages to your customer if they have contacted you first. This opens a 24-hour window for\ntwo-way communication. Otherwise, use a <a href=\"https:\/\/www.infobip.com\/docs\/api\/channels\/whatsapp\/whatsapp-outbound-messages\/send-whatsapp-template-message\">template message<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"difficulty-level\">Difficulty level<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide assumes basic knowledge of Rust and APIs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A running <a href=\"https:\/\/www.rust-lang.org\/learn\/get-started\">Rust project<\/a><\/li>\n\n\n\n<li>An <a href=\"https:\/\/www.infobip.com\/signup\">Infobip account<\/a><\/li>\n\n\n\n<li>A WhatsApp Business account (for testing purposes use the <a href=\"https:\/\/www.infobip.com\/docs\/api\/channels\/whatsapp\">Infobip test sender<\/a>)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"steps-summary\">Steps summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a summary of the steps you will follow:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a 24-hour window for text communication.<\/li>\n\n\n\n<li>Install the <a href=\"https:\/\/crates.io\/crates\/infobip_sdk\">Infobip Rust SDK<\/a>.<\/li>\n\n\n\n<li>Import the required structs.<\/li>\n\n\n\n<li>Create a main async function.<\/li>\n\n\n\n<li>Create a WhatsApp client instance.<\/li>\n\n\n\n<li>Configure a message payload.<\/li>\n\n\n\n<li>Send a message.<\/li>\n\n\n\n<li>Check a response (optional).<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"steps\">Steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Go through the following steps to send the text message.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"open-a-24-hour-window-for-text-communication\">Open a 24-hour window for text communication<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a WhatsApp Business account, proceed to send a message with any content to your account. This will open the\ncommunication window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t have a Whatsapp Business account, you can use the Infobip test sender. Please follow the &#8220;Activate Infobip\nTest\nSender&#8221; instructions on the <a href=\"https:\/\/portal.infobip.com\/apps\/whatsapp\">WhatsApp configuration page<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-the-infobip-rust-sdk\">Install the Infobip Rust SDK<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We first need to install the <a href=\"https:\/\/crates.io\/crates\/infobip_sdk\">Infobip Rust SDK<\/a> and add a couple of dependencies.<\/p>\n\n\n<div id=\"gist123239605\" 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-rust-install-sdk-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=\"rust-install-sdk.sh content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-install-sdk.sh\">\n        <tr class=\"line\">\n          <td id=\"file-rust-install-sdk-sh-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-rust-install-sdk-sh-LC1\" class=\"blob-code blob-code-inner js-file-line\">cargo add infobip_sdk<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-install-sdk-sh-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-rust-install-sdk-sh-LC2\" class=\"blob-code blob-code-inner js-file-line\">cargo add tokio<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-install-sdk-sh-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-rust-install-sdk-sh-LC3\" class=\"blob-code blob-code-inner js-file-line\">cargo add reqwest<\/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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-install-sdk.sh\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-install-sdk-sh\" class=\"Link--inTextBlock\">\n          rust-install-sdk.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<p class=\"wp-block-paragraph\">The above commands will install the actual SDK, the Tokio runtime, which allows you to run asynchronous code, and the\nReqwest HTTP client, which the SDK uses to make HTTP requests.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"import-the-required-structs\">Import the required structs<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following <code>use<\/code>s are needed to import the required structs.<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC1\" class=\"blob-code blob-code-inner js-file-line\">use infobip_sdk::api::whatsapp::WhatsappClient;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC2\" class=\"blob-code blob-code-inner js-file-line\">use infobip_sdk::configuration::Configuration;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC3\" class=\"blob-code blob-code-inner js-file-line\">use infobip_sdk::model::whatsapp::{SendTextRequestBody, TextContent};<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC4\" class=\"blob-code blob-code-inner js-file-line\">use reqwest::StatusCode;<\/td>\n        <\/tr>\n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<p class=\"wp-block-paragraph\">The <code>WhatsappClient<\/code> contains the main interface which you will use to call endpoints. The <code>Configuration<\/code> is used to\nset up credentials and the base URL. The <code>SendTextRequestBody<\/code> and <code>TextContent<\/code> contain the data you will send to the\nendpoint. StatusCode is a <em>reqwest<\/em> enum to represent the result HTTP status codes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-main-async-function\">Create a main async function<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Because the Rust SDK&#8217;s default behavior is asynchronous, you need to call it in an async context. To do this, use the Tokio runtime and create a <code>#[tokio::main]<\/code> main function.<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        \n        \n        \n        \n        \n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC6\" class=\"blob-code blob-code-inner js-file-line\">#[tokio::main]<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC7\" class=\"blob-code blob-code-inner js-file-line\">async fn main() {<\/td>\n        <\/tr>\n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<p class=\"wp-block-paragraph\">The <code>tokio::main<\/code> allows the main function to be async, so you can await your API calls.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-whatsapp-client-instance\">Create a WhatsApp client instance<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the function we&#8217;ve just created, add an instance of the WhatsApp client, which will give you access to all the endpoints as methods of the struct. Note that to build the <code>Configuration<\/code> instance, you must set up environment variables <code>IB_API_KEY<\/code> and <code>IB_BASE_URL<\/code> for the code to work as expected.<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        \n        \n        \n        \n        \n        \n        \n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC8\" class=\"blob-code blob-code-inner js-file-line\">    let client = WhatsappClient::with_configuration(Configuration::from_env_api_key().unwrap());<\/td>\n        <\/tr>\n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<p class=\"wp-block-paragraph\">Or, alternatively, you can write your key and URL in a separate configuration line directly in the code like this:<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-any-config-alternate-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-any-config-alternate.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-any-config-alternate.rs\">\n        <tr class=\"line\">\n          <td id=\"file-rust-any-config-alternate-rs-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-rust-any-config-alternate-rs-LC1\" class=\"blob-code blob-code-inner js-file-line\">    let config = Configuration::with_api_key(\"URL\".into(), ApiKey::new(\"key\".into()));<\/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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-any-config-alternate.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-any-config-alternate-rs\" class=\"Link--inTextBlock\">\n          rust-any-config-alternate.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>URL<\/code> and <code>key<\/code> with your specific base URL and API key values that you can find in\nyour <a href=\"https:\/\/portal.infobip.com\/login\">Infobip account<\/a> or on\nthe <a href=\"https:\/\/www.infobip.com\/docs\/api\">Infobip API reference<\/a> provided you&#8217;re logged in.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"configure-a-message-payload\">Configure a message payload<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we need to create a SendText request body that contains our <code>from<\/code> number, the <code>destination<\/code> number, and the desired text message.<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        \n        \n        \n        \n        \n        \n        \n        \n        \n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC10\" class=\"blob-code blob-code-inner js-file-line\">    let request_body = SendTextRequestBody::new(<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC11\" class=\"blob-code blob-code-inner js-file-line\">        \"44444444444\",<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC12\" class=\"blob-code blob-code-inner js-file-line\">        \"55555555555\",<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC13\" class=\"blob-code blob-code-inner js-file-line\">        TextContent::new(\"Hello, Rustacean!\")<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC14\" class=\"blob-code blob-code-inner js-file-line\">    );<\/td>\n        <\/tr>\n        \n        \n        \n        \n        \n        \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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<p class=\"wp-block-paragraph\">The request object supports many more fields! See WhatsApp\ntext <a href=\"https:\/\/www.infobip.com\/docs\/api\/channels\/whatsapp\/whatsapp-outbound-messages\/send-whatsapp-text-message\">endpoint reference<\/a>,\nfor more details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Key points:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the international number formatting when adding a number to the <code>to<\/code> field. For example, for British numbers the value will look like this: <code>44754322576<\/code>.<\/li>\n\n\n\n<li>For free trial accounts, the number used as a recipient must be the same number registered when signing up with Infobip.<\/li>\n\n\n\n<li>If you want to send multiple messages to multiple recipients in one request, use a <a href=\"https:\/\/www.infobip.com\/docs\/api\/channels\/whatsapp\/whatsapp-outbound-messages\/send-whatsapp-template-message\">WhatsApp template message<\/a>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"send-a-message\">Send a message<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Send a message and await a response.<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC16\" class=\"blob-code blob-code-inner js-file-line\">    let response = client.send_text(request_body).await.unwrap();<\/td>\n        <\/tr>\n        \n        \n        \n        \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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<p class=\"wp-block-paragraph\">The <code>send_text<\/code> method returns a <code>Result<\/code> object, which you can unwrap to get a response. The response contains the\nstatus code, and the body of the response. In case of an error, you can see what went wrong in the Error branch of the\n<code>Result<\/code> object, as a special <code>SdkError<\/code> instance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"check-a-response-optional\">Check a response (optional)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We are done! If you want, you can check whether the response status is OK and print it.<\/p>\n\n\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC18\" class=\"blob-code blob-code-inner js-file-line\">    assert_eq!(response.status, StatusCode::OK);<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC19\" class=\"blob-code blob-code-inner js-file-line\">    println!(\"Response: {:?}\", response);<\/td>\n        <\/tr>\n        \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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/body><\/html>\n\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-complete-example\">The complete example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All of the above is condensed into the following code snippet.<\/p>\n\n\n<div id=\"gist123239605\" 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-rust-wa-send-text-rs\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-rust  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"rust-wa-send-text.rs content, created by infobipdev on 05:54PM on June 28, 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\" data-component=\"Octicon\" 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\" data-component=\"Octicon\" 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=\"rust-wa-send-text.rs\">\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC1\" class=\"blob-code blob-code-inner js-file-line\">use infobip_sdk::api::whatsapp::WhatsappClient;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC2\" class=\"blob-code blob-code-inner js-file-line\">use infobip_sdk::configuration::Configuration;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC3\" class=\"blob-code blob-code-inner js-file-line\">use infobip_sdk::model::whatsapp::{SendTextRequestBody, TextContent};<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC4\" class=\"blob-code blob-code-inner js-file-line\">use reqwest::StatusCode;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC5\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC6\" class=\"blob-code blob-code-inner js-file-line\">#[tokio::main]<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC7\" class=\"blob-code blob-code-inner js-file-line\">async fn main() {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC8\" class=\"blob-code blob-code-inner js-file-line\">    let client = WhatsappClient::with_configuration(Configuration::from_env_api_key().unwrap());<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC9\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC10\" class=\"blob-code blob-code-inner js-file-line\">    let request_body = SendTextRequestBody::new(<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC11\" class=\"blob-code blob-code-inner js-file-line\">        \"44444444444\",<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC12\" class=\"blob-code blob-code-inner js-file-line\">        \"55555555555\",<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC13\" class=\"blob-code blob-code-inner js-file-line\">        TextContent::new(\"Hello, Rustacean!\")<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC14\" class=\"blob-code blob-code-inner js-file-line\">    );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC15\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC16\" class=\"blob-code blob-code-inner js-file-line\">    let response = client.send_text(request_body).await.unwrap();<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC17\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC18\" class=\"blob-code blob-code-inner js-file-line\">    assert_eq!(response.status, StatusCode::OK);<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC19\" class=\"blob-code blob-code-inner js-file-line\">    println!(\"Response: {:?}\", response);<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-rust-wa-send-text-rs-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n          <td id=\"file-rust-wa-send-text-rs-LC20\" 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\/52b2152823e63372f684ebbd6c1c05bd\/raw\/335dab4321400b7aaef6bf36ea927135736d2fa0\/rust-wa-send-text.rs\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/infobipdev\/52b2152823e63372f684ebbd6c1c05bd#file-rust-wa-send-text-rs\" class=\"Link--inTextBlock\">\n          rust-wa-send-text.rs\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\" id=\"take-a-look-at-the-official-documentation\">Take a look at the official documentation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can find this code example and many more in our WhatsApp documentation of the Rust SDK!\nTake a look at\nthe <a href=\"https:\/\/docs.rs\/infobip_sdk\/latest\/infobip_sdk\/api\/whatsapp\/struct.WhatsappClient.html\">WhatsApp client<\/a> methods to\ndiscover the possibilities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Thanks for reading!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide will show you how to send a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[12,243],"tags":[43,76],"coauthors":[156],"class_list":["post-2338","post","type-post","status-publish","format-standard","hentry","category-guide","category-rust","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 a WhatsApp text message with the Infobip Rust 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-a-whatsapp-text-message-with-the-infobip-rust-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 a WhatsApp text message with the Infobip Rust SDK - Infobip Developers Hub\" \/>\n<meta property=\"og:description\" content=\"This guide will show you how to send a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-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=\"2023-08-15T18:00:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-11T14:27:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue\" \/>\n<meta name=\"author\" content=\"Erick Corona\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:site\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erick Corona\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 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-a-whatsapp-text-message-with-the-infobip-rust-sdk#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk\"},\"author\":{\"name\":\"Erick Corona\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/9e52e4d22fb53cc9a87adc54825c5e5c\"},\"headline\":\"How to send a WhatsApp text message with the Infobip Rust SDK\",\"datePublished\":\"2023-08-15T18:00:16+00:00\",\"dateModified\":\"2023-09-11T14:27:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk\"},\"wordCount\":846,\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue\",\"keywords\":[\"API\",\"SDK\"],\"articleSection\":[\"Guide\",\"Rust\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk\",\"name\":\"How to send a WhatsApp text message with the Infobip Rust SDK - Infobip Developers Hub\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue\",\"datePublished\":\"2023-08-15T18:00:16+00:00\",\"dateModified\":\"2023-09-11T14:27:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage\",\"url\":\"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue\",\"contentUrl\":\"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.infobip.com\/developers\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to send a WhatsApp text message with the Infobip Rust 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\/9e52e4d22fb53cc9a87adc54825c5e5c\",\"name\":\"Erick Corona\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/1d096b53aac31da0002a2066ab28c0f1\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g\",\"caption\":\"Erick Corona\"},\"description\":\"Erick has been in the software industry for more than 10 years. Currently, he works as a Developer Experience Engineer at Infobip. He's interested in software development, writing, and racing car simulators in his free time.\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/author\/erick\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to send a WhatsApp text message with the Infobip Rust 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-a-whatsapp-text-message-with-the-infobip-rust-sdk","og_locale":"en_US","og_type":"article","og_title":"How to send a WhatsApp text message with the Infobip Rust SDK - Infobip Developers Hub","og_description":"This guide will show you how to send a [&hellip;]","og_url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk","og_site_name":"Infobip Developers Hub","article_publisher":"https:\/\/www.facebook.com\/infobip\/","article_published_time":"2023-08-15T18:00:16+00:00","article_modified_time":"2023-09-11T14:27:27+00:00","og_image":[{"url":"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue","type":"","width":"","height":""}],"author":"Erick Corona","twitter_card":"summary_large_image","twitter_creator":"@InfobipDev","twitter_site":"@InfobipDev","twitter_misc":{"Written by":"Erick Corona","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#article","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk"},"author":{"name":"Erick Corona","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/9e52e4d22fb53cc9a87adc54825c5e5c"},"headline":"How to send a WhatsApp text message with the Infobip Rust SDK","datePublished":"2023-08-15T18:00:16+00:00","dateModified":"2023-09-11T14:27:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk"},"wordCount":846,"publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue","keywords":["API","SDK"],"articleSection":["Guide","Rust"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk","url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk","name":"How to send a WhatsApp text message with the Infobip Rust SDK - Infobip Developers Hub","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue","datePublished":"2023-08-15T18:00:16+00:00","dateModified":"2023-09-11T14:27:27+00:00","breadcrumb":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#primaryimage","url":"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue","contentUrl":"https:\/\/img.shields.io\/badge\/Rust-%3E%3D1.63-blue"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-text-message-with-the-infobip-rust-sdk#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infobip.com\/developers\/"},{"@type":"ListItem","position":2,"name":"How to send a WhatsApp text message with the Infobip Rust 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\/9e52e4d22fb53cc9a87adc54825c5e5c","name":"Erick Corona","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/1d096b53aac31da0002a2066ab28c0f1","url":"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g","caption":"Erick Corona"},"description":"Erick has been in the software industry for more than 10 years. Currently, he works as a Developer Experience Engineer at Infobip. He's interested in software development, writing, and racing car simulators in his free time.","url":"https:\/\/www.infobip.com\/developers\/blog\/author\/erick"}]}},"_links":{"self":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/2338","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/comments?post=2338"}],"version-history":[{"count":14,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/2338\/revisions"}],"predecessor-version":[{"id":2459,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/2338\/revisions\/2459"}],"wp:attachment":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/media?parent=2338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/categories?post=2338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/tags?post=2338"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/coauthors?post=2338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}