{"id":550,"date":"2022-11-07T09:35:05","date_gmt":"2022-11-07T09:35:05","guid":{"rendered":"https:\/\/alvochat.com\/blog\/?p=550"},"modified":"2022-11-13T06:25:44","modified_gmt":"2022-11-13T06:25:44","slug":"send-whatsapp-api-using-clojure","status":"publish","type":"post","link":"https:\/\/alvochat.com\/blog\/send-whatsapp-api-using-clojure\/","title":{"rendered":"How to Send a WhatsApp API using Clojure"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>In this code snippet, you learn how to send a WhatsApp API using Clojure, to send a text message, WhatsApp Templates, media, interactive buttons, lists, products \u2026 etc, Alvochat account is required to run the following codes.&nbsp;<a href=\"http:\/\/alvochat.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create an Account<\/a>&nbsp;if you don\u2019t have one.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"first-whatsapp-message-using-curl\">Send template using WhatsApp API with Clojure<\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/template\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:name \"hello_world\"\n:language \"en_us\"\n:header \"\"\n:body \"\"\n:buttons \"\"\n:priority \"\"\n}\n})<\/code><\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Send a text message using WhatsApp API  with Clojure<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/chat\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:body \"WhatsApp API on alvochat.com works good\"\n:priority \"\"\n:preview_url \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send image<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/image\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:image \"https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/image\/1.jpeg\"\n:caption \"image caption\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send audio<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/audio\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:audio \"https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/audio\/1.mp3\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send video<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/video\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:video \"https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/video\/1.mp4\"\n:caption \"video caption\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send document <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/document\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:document \"https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/document\/1.pdf\"\n:filename \"\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send sticker<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/sticker\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:sticker \"https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/sticker\/1.webp\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send Contact<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/contact\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:contact \"\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send Location<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/location\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:lat \"37.484296\"\n:lng \"-122.148703\"\n:address \"Menlo Park, California, United States\"\n:name \"Meta Headquarters\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Send list <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/list\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:header \"header\"\n:body \" please select one of the following options\"\n:footer \"footer\"\n:button \"options\"\n:sections \"option_1,option_2,option_3\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Send button <\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/button\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:header \"header\"\n:body \" please select one of the following options\"\n:footer \"footer\"\n:buttons \"option_1,option_2,option_3\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Send products <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"scala\" class=\"EnlighterJSRAW\">(require '&#091;clj-http.client :as client])\n\n(client\/post \"https:\/\/api.alvochat.com\/instance1199\/messages\/product\" {:headers {:content-type \"application\/x-www-form-urlencoded\"}:form-params {\n:token \"YourToken\"\n:to \"16315555555\"\n:header \"header\"\n:body \"Hi , check out our new products\"\n:footer \"footer\"\n:catalog_id \"\"\n:product \"\"\n:priority \"\"\n:message_id \"\"\n}\n})<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<p>You can see the Full Whatsapp API Documentation <a href=\"https:\/\/alvochat.com\/docs\/\" data-type=\"URL\" data-id=\"https:\/\/alvochat.com\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this code snippet, you learn how to send a WhatsApp API using Clojure, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Send a WhatsApp API using Clojure\" class=\"read-more button\" href=\"https:\/\/alvochat.com\/blog\/send-whatsapp-api-using-clojure\/#more-550\" aria-label=\"Read more about How to Send a WhatsApp API using Clojure\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":552,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"%title% |  %currentyear%","rank_math_description":"In this code snippet, you learn how to send a WhatsApp API using clojure, to send a text message,Templates, media, buttons, lists, products\n","rank_math_focus_keyword":"Clojure,WhatsApp API","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,5],"tags":[69,65],"class_list":["post-550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-whatsapp-api-tutorials","category-whatsappapi","tag-tutorials","tag-whatsapp-api","infinite-scroll-item","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","no-featured-image-padding"],"jetpack_featured_media_url":"https:\/\/alvochat.com\/blog\/wp-content\/uploads\/2022\/11\/WhatsApp-API-Clojure.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":3,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":1236,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts\/550\/revisions\/1236"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/media\/552"}],"wp:attachment":[{"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}