{"id":170,"date":"2022-11-06T17:29:52","date_gmt":"2022-11-06T17:29:52","guid":{"rendered":"https:\/\/alvochat.com\/blog\/?p=170"},"modified":"2023-04-24T09:44:26","modified_gmt":"2023-04-24T09:44:26","slug":"how-to-send-whatsapp-api-with-curl","status":"publish","type":"post","link":"https:\/\/alvochat.com\/blog\/how-to-send-whatsapp-api-with-curl\/","title":{"rendered":"How to Send a WhatsApp API using cURL"},"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 CURL, 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<\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/template \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'name=hello_world' \\\n --data-urlencode 'language=en_us' \\\n --data-urlencode 'header=' \\\n --data-urlencode 'body=' \\\n --data-urlencode 'buttons=' \\\n --data-urlencode 'priority=' <\/code><\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Send text message using WhatsApp API<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/chat \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'body=WhatsApp API on alvochat.com works good' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'preview_url=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/image \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'image=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/image\/1.jpeg' \\\n --data-urlencode 'caption=image caption' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/audio \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'audio=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/audio\/1.mp3' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/video \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'video=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/video\/1.mp4' \\\n --data-urlencode 'caption=video caption' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/document \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'document=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/document\/1.pdf' \\\n --data-urlencode 'filename=' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/sticker \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'sticker=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/sticker\/1.webp' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/contact \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'contact=' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/location \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'lat=37.484296' \\\n --data-urlencode 'lng=-122.148703' \\\n --data-urlencode 'address=Menlo Park, California, United States' \\\n --data-urlencode 'name=Meta Headquarters' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/list \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'header=header' \\\n --data-urlencode 'body= please select one of the following options' \\\n --data-urlencode 'footer=footer' \\\n --data-urlencode 'button=options' \\\n --data-urlencode 'sections=option_1,option_2,option_3' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/button \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'header=header' \\\n --data-urlencode 'body= please select one of the following options' \\\n --data-urlencode 'footer=footer' \\\n --data-urlencode 'buttons=option_1,option_2,option_3' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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=\"powershell\" class=\"EnlighterJSRAW\">curl --request POST \\\n  --url https:\/\/api.alvochat.com\/instance1199\/messages\/product \\\n  --header 'content-type: application\/x-www-form-urlencoded' \\\n  --data-urlencode 'token=YourToken' \\\n --data-urlencode 'to=16315555555' \\\n --data-urlencode 'header=header' \\\n --data-urlencode 'body=Hi , check out our new products' \\\n --data-urlencode 'footer=footer' \\\n --data-urlencode 'catalog_id=' \\\n --data-urlencode 'product=' \\\n --data-urlencode 'priority=' \\\n --data-urlencode 'message_id=' <\/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 from <a href=\"https:\/\/alvochat.com\/docs\/\" data-type=\"URL\" data-id=\"https:\/\/alvochat.com\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>You can send any message and interact with the API by sending a simple curl request like mentioned above like any other WhatsApp <a href=\"https:\/\/ultramsg.com\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/ultramsg.com\/\" rel=\"noreferrer noopener\">API<\/a> service.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this code snippet, you learn how to send a WhatsApp API using CURL, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Send a WhatsApp API using cURL\" class=\"read-more button\" href=\"https:\/\/alvochat.com\/blog\/how-to-send-whatsapp-api-with-curl\/#more-170\" aria-label=\"Read more about How to Send a WhatsApp API using cURL\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":203,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"%title% | %currentyear%","rank_math_description":"In this chapter, we will send a WhatsApp API using CURL, to send a text message, WhatsApp Templates, media, buttons, lists, products \u2026 etc","rank_math_focus_keyword":"WhatsApp API,curl","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,5],"tags":[69,65],"class_list":["post-170","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-cURL.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts\/170","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=170"}],"version-history":[{"count":59,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":2665,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions\/2665"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/media\/203"}],"wp:attachment":[{"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}