{"id":82,"date":"2022-09-17T10:29:10","date_gmt":"2022-09-17T10:29:10","guid":{"rendered":"https:\/\/infobip.com\/developers\/?p=82"},"modified":"2023-09-11T14:35:40","modified_gmt":"2023-09-11T14:35:40","slug":"how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip","status":"publish","type":"post","link":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip","title":{"rendered":"How to send a WhatsApp message with interactive buttons with Python and Infobip"},"content":{"rendered":"\n<img decoding=\"async\" src=\"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk\" alt=\"Python\"\/>\n\n\n\n<p>As an outcome of this guide, you will be able to leverage Infobip WhatsApp API and send an interactive WhatsApp message delivered to your handset.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Scenario overview<\/h2>\n\n\n\n<p>A WhatsApp sender sends a message with an image and two interactive buttons a user can click. In this case, the message is a yes\/no question, and the two buttons represent two possible answers, yes and no. Once the user clicks a button, a message with the answer is sent back to the WhatsApp sender. That, in turn, can trigger an appropriate series of actions and responses, but this is out of scope for this guide. We will, however, discuss briefly how to intercept an incoming message with a webhook to see the user&#8217;s reply.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons.png\" alt=\"WhatsApp message with interactive buttons\" class=\"wp-image-86\" style=\"width:360px;height:740px\" width=\"360\" height=\"740\" srcset=\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons.png 1440w, https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons-146x300.png 146w, https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons-498x1024.png 498w, https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons-768x1579.png 768w, https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons-747x1536.png 747w, https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2022\/09\/wa-message-buttons-996x2048.png 996w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><figcaption class=\"wp-element-caption\">WhatsApp message with interactive buttons<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>\u2022 <a href=\"https:\/\/www.infobip.com\/signup\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a><\/p>\n\n\n\n<p>\u2022 Working <a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noopener\">Python 3<\/a> environment<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Difficulty level<\/h2>\n\n\n\n<p>This guide assumes basic knowledge of Python and basic familiarity with APIs. It is important, however, that you are familiar with webhook technology. For ease of replicating the scenario, we have used a free online webhook tool, <a href=\"https:\/\/www.hookrelay.dev\/\" target=\"_blank\" rel=\"noopener\">HookRelay<\/a>. You may replace HookRelay with your own hook server if you need to process your events programmatically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary of the steps<\/h2>\n\n\n\n<p>\u2022 Set up a webhook and add its URL to the WhatsApp sender number.<br>\u2022 Install the Infobip API Python SDK.<br>\u2022 Import <code>WhatsApp Channel<\/code> to create an instance.<br>\u2022 Add credentials, phone number, and WhatsApp payload to your instance.<br>\u2022 Send a WhatsApp message with two interactive buttons.<br>\u2022 Use the webhook to catch the user&#8217;s response.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set up a webhook<\/h2>\n\n\n\n<p>For the purpose of this guide, we will use a simple online webhook tool, <a href=\"https:\/\/www.hookrelay.dev\/\" target=\"_blank\" rel=\"noopener\">HookRelay<\/a>. This section will show you how to create an account and configure the webhook with HookRelay.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1. Sign in with git credentials<\/h3>\n\n\n\n<p>Sign in to <a href=\"https:\/\/www.hookrelay.dev\/\" target=\"_blank\" rel=\"noopener\">HookRelay<\/a> with your GitHub or GitLab credentials.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2. Create a webhook<\/h3>\n\n\n\n<p>To create an inbound webhook, from your dashboard, click the <strong>New Hook<\/strong> button on the top right. That will take you to the configuration screen where all you need to provide is a descriptive name for your webhook, e.g. <strong>Infobip WhatsApp Button Response<\/strong>.<\/p>\n\n\n\n<p>Once you click the <strong>Create hook<\/strong> button, you&#8217;ll be able to view and copy its URL that you will need to add to your WhatsApp sender.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add a webhook URL to a WhatsApp sender<\/h2>\n\n\n\n<p>Head back to your <a href=\"https:\/\/portal.infobip.com\/\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a> and access your WhatsApp sender configuration page (Channels and Numbers &gt; WhatsApp).<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select the <strong>Senders<\/strong> tab, click the kebab (three-dot) menu on the WhatsApp sender&#8217;s tile and select <strong>Edit configuration<\/strong>.<\/li>\n\n\n\n<li>Enable the <strong>Forwarding to URL<\/strong> toggle to expand more options.<\/li>\n\n\n\n<li>Add your webhook&#8217;s URL to the <strong>URL<\/strong> field.<\/li>\n\n\n\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p>Your webhook is now all set up. It&#8217;s time to create a WhatsApp message using our Python SDK.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install the Infobip API Python SDK<\/h2>\n\n\n\n<p>Use your terminal or command prompt to install the <a href=\"https:\/\/pypi.org\/project\/infobip-api-python-sdk\/\" target=\"_blank\" rel=\"noopener\">Infobip Python SDK<\/a>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>pip install infobip-api-python-sdk<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Create a WhatsApp Channel instance<\/h2>\n\n\n\n<p>The <code>WhatsAppChannel<\/code> instance allows you to add your credentials and access all its methods. In this case, we&#8217;ll use the <code>send_interactive_buttons_message<\/code> method and add the WhatsApp interactive buttons payload to it.<\/p>\n\n\n\n<p><strong>Step 1.<\/strong> Import the <code>WhatsAppChannel<\/code>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>from infobip_channels.whatsapp.channel import WhatsAppChannel<\/code><\/pre><\/div>\n\n\n\n<p><strong>Step 2.<\/strong> Create <code>WhatsAppChannel<\/code> and add your unique <code>base_url<\/code> and <code>api_key<\/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> once logged in.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>channel = WhatsAppChannel.from_auth_params({\n    &quot;base_url&quot;: &quot;&lt;your_base_url&gt;&quot;,\n    &quot;api_key&quot;: &quot;&lt;your_api_key&gt;&quot;\n})<\/code><\/pre><\/div>\n\n\n\n<p><strong>Step 3.<\/strong> Use the <code>send_interactive_buttons_message<\/code> method to add the <a href=\"https:\/\/www.infobip.com\/docs\/api\/channels\/whatsapp\/whatsapp-outbound-messages\/send-whatsapp-interactive-buttons-message\" target=\"_blank\" rel=\"noopener\">WhatsApp payload<\/a>. We are going to send a message with an image, a question, and <strong>YES<\/strong> and <strong>NO<\/strong> buttons.<\/p>\n\n\n\n<p><strong>Key points:<\/strong><\/p>\n\n\n\n<p>\u2022 The <code>to<\/code> field must include a number in the international format, e.g. <code>447415774332<\/code>.<br>\u2022 If using a free trial account, the phone number you use must be the same phone number you&#8217;ve registered on signup.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>button_message = channel.send_interactive_buttons_message({\n  &quot;from&quot;: &quot;447860099299&quot;,\n  &quot;to&quot;: &quot;447415774433&quot;,\n  &quot;content&quot;: {\n    &quot;body&quot;: {\n        &quot;text&quot;: &quot;Dear Developer, would you like to receive Infobip-branded hoodie?&quot;\n    },\n    &quot;action&quot;: {\n        &quot;buttons&quot;: [\n            {\n                &quot;type&quot;: &quot;REPLY&quot;,\n                &quot;id&quot;: &quot;yes&quot;,\n                &quot;title&quot;: &quot;YES&quot;\n            },\n            {\n                &quot;type&quot;: &quot;REPLY&quot;,\n                &quot;id&quot;: &quot;no&quot;,\n                &quot;title&quot;: &quot;NO&quot;\n            }\n        ]\n    },\n    &quot;header&quot;: {\n        &quot;type&quot;: &quot;IMAGE&quot;,\n        &quot;mediaUrl&quot;: &quot;https:\/\/seekvectorlogo.com\/wp-content\/uploads\/2019\/06\/infobip-vector-logo-small.png&quot;\n    }\n  }\n})<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Add multiple recipients and multiple messages<\/h3>\n\n\n\n<p>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\" target=\"_blank\" rel=\"noopener\">templated WhatsApp message<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Monitor the progress of your WhatsApp message<\/h2>\n\n\n\n<p>Print the response variable to see whether the message has successfully left the Infobip platform. If you wish to know whether it&#8217;s been delivered to the recipient, you&#8217;ll need to set up a <a href=\"https:\/\/www.infobip.com\/docs\/api#channels\/whatsapp\/receive-whatsapp-delivery-reports\" target=\"_blank\" rel=\"noopener\">Delivery Report<\/a>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>print(button_message)<\/code><\/pre><\/div>\n\n\n\n<p>Once you run the code, you should receive a WhatsApp message on your handset and see a <code>200 OK<\/code> response.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  &quot;to&quot;: &quot;441134960001&quot;,\n  &quot;messageCount&quot;: 1,\n  &quot;messageId&quot;: &quot;a28dd97c-1ffb-4fcf-99f1-0b557ed381da&quot;,\n  &quot;status&quot;: {\n    &quot;groupId&quot;: 1,\n    &quot;groupName&quot;: &quot;PENDING&quot;,\n    &quot;id&quot;: 7,\n    &quot;name&quot;: &quot;PENDING_ENROUTE&quot;,\n    &quot;description&quot;: &quot;Message sent to next instance&quot;\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<p>For troubleshooting and analytics, Use the auto-generated <code>messageId<\/code> to view the message and its details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Catch the answer<\/h2>\n\n\n\n<p>Once the user clicks one of the buttons, your webhook that&#8217;s listening to that event will catch the answer. The <code>message<\/code> object will tell you which button has been used as an answer.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  &quot;results&quot;: [\n    {\n      &quot;from&quot;: &quot;447415774433&quot;,\n      &quot;to&quot;: &quot;447860099299&quot;,\n      &quot;integrationType&quot;: &quot;WHATSAPP&quot;,\n      &quot;receivedAt&quot;: &quot;2022-08-08T12:23:17.335+0000&quot;,\n      &quot;messageId&quot;: &quot;ABEGRHQVd0QyAhCb5idTXGl7pDp9fP1opcVy&quot;,\n      &quot;pairedMessageId&quot;: &quot;2412acdb-d33c-4343-9499-7a886419e772&quot;,\n      &quot;callbackData&quot;: null,\n      &quot;message&quot;: {\n        &quot;id&quot;: &quot;yes&quot;,\n        &quot;title&quot;: &quot;YES&quot;,\n        &quot;context&quot;: {\n          &quot;from&quot;: &quot;447860099299&quot;,\n          &quot;id&quot;: &quot;2412acdb-d33c-4343-9499-7a886419e772&quot;\n        },\n        &quot;type&quot;: &quot;INTERACTIVE_BUTTON_REPLY&quot;\n      },\n      &quot;contact&quot;: {\n        &quot;name&quot;: &quot;Joanna Suau&quot;\n      },\n      &quot;price&quot;: {\n        &quot;pricePerMessage&quot;: 0.0,\n        &quot;currency&quot;: &quot;EUR&quot;\n      }\n    }\n  ],\n  &quot;messageCount&quot;: 1,\n  &quot;pendingMessageCount&quot;: 0\n}<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As an outcome of this guide, you will be [&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":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[12,255,13,265],"tags":[46,76],"coauthors":[134],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-guide","category-infobip-products","category-python","category-whatsapp","tag-developer-docs","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 message with interactive buttons with Python and Infobip - 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-message-with-interactive-buttons-with-python-and-infobip\" \/>\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 message with interactive buttons with Python and Infobip - Infobip Developers Hub\" \/>\n<meta property=\"og:description\" content=\"As an outcome of this guide, you will be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip\" \/>\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=\"2022-09-17T10:29:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-11T14:35:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk\" \/>\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=\"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-message-with-interactive-buttons-with-python-and-infobip#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip\"},\"author\":{\"name\":\"Joanna Suau\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/707842627f046bb5722c37a9fdc85d62\"},\"headline\":\"How to send a WhatsApp message with interactive buttons with Python and Infobip\",\"datePublished\":\"2022-09-17T10:29:10+00:00\",\"dateModified\":\"2023-09-11T14:35:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip\"},\"wordCount\":740,\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk\",\"keywords\":[\"developer docs\",\"SDK\"],\"articleSection\":[\"Guide\",\"Infobip Products\",\"Python\",\"WhatsApp\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip\",\"name\":\"How to send a WhatsApp message with interactive buttons with Python and Infobip - Infobip Developers Hub\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk\",\"datePublished\":\"2022-09-17T10:29:10+00:00\",\"dateModified\":\"2023-09-11T14:35:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage\",\"url\":\"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk\",\"contentUrl\":\"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.infobip.com\/developers\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to send a WhatsApp message with interactive buttons with Python and Infobip\"}]},{\"@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 a WhatsApp message with interactive buttons with Python and Infobip - 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-message-with-interactive-buttons-with-python-and-infobip","og_locale":"en_US","og_type":"article","og_title":"How to send a WhatsApp message with interactive buttons with Python and Infobip - Infobip Developers Hub","og_description":"As an outcome of this guide, you will be [&hellip;]","og_url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip","og_site_name":"Infobip Developers Hub","article_publisher":"https:\/\/www.facebook.com\/infobip\/","article_published_time":"2022-09-17T10:29:10+00:00","article_modified_time":"2023-09-11T14:35:40+00:00","og_image":[{"url":"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk","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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#article","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip"},"author":{"name":"Joanna Suau","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/707842627f046bb5722c37a9fdc85d62"},"headline":"How to send a WhatsApp message with interactive buttons with Python and Infobip","datePublished":"2022-09-17T10:29:10+00:00","dateModified":"2023-09-11T14:35:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip"},"wordCount":740,"publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk","keywords":["developer docs","SDK"],"articleSection":["Guide","Infobip Products","Python","WhatsApp"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip","url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip","name":"How to send a WhatsApp message with interactive buttons with Python and Infobip - Infobip Developers Hub","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk","datePublished":"2022-09-17T10:29:10+00:00","dateModified":"2023-09-11T14:35:40+00:00","breadcrumb":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#primaryimage","url":"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk","contentUrl":"https:\/\/img.shields.io\/pypi\/pyversions\/infobip-api-python-sdk"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-send-a-whatsapp-message-with-interactive-buttons-with-python-and-infobip#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infobip.com\/developers\/"},{"@type":"ListItem","position":2,"name":"How to send a WhatsApp message with interactive buttons with Python and Infobip"}]},{"@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\/82","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=82"}],"version-history":[{"count":12,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":2565,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/82\/revisions\/2565"}],"wp:attachment":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/tags?post=82"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/coauthors?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}