{"id":987,"date":"2022-11-08T20:32:54","date_gmt":"2022-11-08T20:32:54","guid":{"rendered":"https:\/\/alvochat.com\/blog\/come-inviare-unapi-whatsapp-usando-jquery\/"},"modified":"2022-11-13T06:58:07","modified_gmt":"2022-11-13T06:58:07","slug":"come-inviare-whatsapp-api-usando-jquery","status":"publish","type":"post","link":"https:\/\/alvochat.com\/blog\/it\/come-inviare-whatsapp-api-usando-jquery\/","title":{"rendered":"Come inviare un&#8217;API WhatsApp usando jQuery"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduzione<\/h2>\n\n<p>In questo frammento di codice, imparerete come inviare un&#8217;API WhatsApp utilizzando jQuery, per inviare un messaggio di testo, modelli WhatsApp, media, pulsanti interattivi, elenchi, prodotti &#8230; ecc, \u00e8 necessario un account Alvochat per eseguire i seguenti codici. <a href=\"http:\/\/alvochat.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create un account<\/a> se non ne avete uno.<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\" id=\"first-whatsapp-message-using-curl\">Inviare un modello utilizzando l&#8217;API di WhatsApp con jQuery<\/h2>\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=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/template\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\n    \"token\": \"YourToken\",\n    \"to\": 16315555555,\n    \"name\": \"hello_world\",\n    \"language\": \"en_us\",\n    \"header\": \"\",\n    \"body\": \"\",\n    \"buttons\": \"\",\n    \"priority\": \"\"\n}\n}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n<\/div>\n<\/div>\n\n<h2 class=\"wp-block-heading\">Inviare un messaggio di testo utilizzando le API di WhatsApp con jQuery<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/chat\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Invia immagine<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/image\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Inviare l&#8217;audio<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/audio\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Invia il video<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/video\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Inviare il documento  <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/document\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Invia l&#8217;adesivo<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/sticker\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Inviare il contatto<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/contact\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\n    \"token\": \"YourToken\",\n    \"to\": 16315555555,\n    \"contact\": \"\",\n    \"priority\": \"\",\n    \"message_id\": \"\"\n}\n}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Invia posizione<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/location\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\n    \"token\": \"YourToken\",\n    \"to\": 16315555555,\n    \"lat\": 37.484296000000000503860064782202243804931640625,\n    \"lng\": -122.1487029999999975871105561964213848114013671875,\n    \"address\": \"Menlo Park, California, United States\",\n    \"name\": \"Meta Headquarters\",\n    \"priority\": \"\",\n    \"message_id\": \"\"\n}\n}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Inviare l&#8217;elenco  <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/list\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Pulsante di invio  <\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/button\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Inviare i prodotti  <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https:\/\/api.alvochat.com\/instance1199\/messages\/product\",\n  \"method\": \"POST\",\n  \"headers\": {},\n  \"data\": {\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}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n<p>\u00c8 possibile consultare la documentazione completa dell&#8217;API di Whatsapp <a href=\"https:\/\/alvochat.com\/docs\/\" data-type=\"URL\" data-id=\"https:\/\/alvochat.com\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">qui<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduzione In questo frammento di codice, imparerete come inviare un&#8217;API WhatsApp utilizzando jQuery, per inviare &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Come inviare un&#8217;API WhatsApp usando jQuery\" class=\"read-more button\" href=\"https:\/\/alvochat.com\/blog\/it\/come-inviare-whatsapp-api-usando-jquery\/#more-987\" aria-label=\"Per saperne di pi\u00f9 su Come inviare un&#8217;API WhatsApp usando jQuery\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":701,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"%title% | %currentyear%","rank_math_description":"In questo frammento di codice, si impara a inviare un API WhatsApp utilizzando jquery, per inviare un messaggio di testo, modelli, media, pulsanti, liste, prodotti\n","rank_math_focus_keyword":"jQuery, API WhatsApp","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[87,88],"tags":[89,90],"class_list":["post-987","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-it","category-whatsappapi-it","tag-api-whatsapp-it","tag-tutorial-it","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-jQuery.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/posts\/987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/comments?post=987"}],"version-history":[{"count":1,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/posts\/987\/revisions"}],"predecessor-version":[{"id":988,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/posts\/987\/revisions\/988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/media\/701"}],"wp:attachment":[{"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/media?parent=987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/categories?post=987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/it\/wp-json\/wp\/v2\/tags?post=987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}