{"id":937,"date":"2022-11-08T20:25:34","date_gmt":"2022-11-08T20:25:34","guid":{"rendered":"https:\/\/alvochat.com\/blog\/como-enviar-una-api-de-whatsapp-utilizando-c\/"},"modified":"2022-11-13T07:01:14","modified_gmt":"2022-11-13T07:01:14","slug":"como-enviar-whatsapp-api-usando-c-lang","status":"publish","type":"post","link":"https:\/\/alvochat.com\/blog\/es\/como-enviar-whatsapp-api-usando-c-lang\/","title":{"rendered":"C\u00f3mo enviar una API de WhatsApp utilizando C"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introducci\u00f3n<\/h2>\n\n<p>En este fragmento de c\u00f3digo, se aprende c\u00f3mo enviar una API de WhatsApp utilizando el lenguaje C, para enviar un mensaje de texto, WhatsApp Plantillas, medios de comunicaci\u00f3n, botones interactivos, listas, productos &#8230; etc, Alvochat cuenta es necesaria para ejecutar los siguientes c\u00f3digos. <a href=\"http:\/\/alvochat.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Crea una cuenta<\/a> si no la tienes.<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\" id=\"first-whatsapp-message-using-curl\">Env\u00ede la plantilla utilizando la API de WhatsApp y el lenguaje C<\/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=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/template\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;name=hello_world&amp;language=en_us&amp;header=&amp;body=&amp;buttons=&amp;priority=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n<\/div>\n<\/div>\n\n<h2 class=\"wp-block-heading\">Enviar un mensaje de texto utilizando la API de WhatsApp y el lenguaje C<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/chat\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;body=WhatsApp API on alvochat.com works good&amp;priority=&amp;preview_url=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar imagen<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/image\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;image=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/image\/1.jpeg&amp;caption=image caption&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar audio<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/audio\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;audio=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/audio\/1.mp3&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar v\u00eddeo<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/video\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;video=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/video\/1.mp4&amp;caption=video caption&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar documento  <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/document\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;document=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/document\/1.pdf&amp;filename=&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar pegatina<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/sticker\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;sticker=https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/sticker\/1.webp&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar contacto<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/contact\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;contact=&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar ubicaci\u00f3n<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/location\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;lat=37.484296&amp;lng=-122.148703&amp;address=Menlo Park, California, United States&amp;name=Meta Headquarters&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Enviar lista  <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/list\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;header=header&amp;body= please select one of the following options&amp;footer=footer&amp;button=options\u00a7ions=option_1,option_2,option_3&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Bot\u00f3n de env\u00edo  <\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/button\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;header=header&amp;body= please select one of the following options&amp;footer=footer&amp;buttons=option_1,option_2,option_3&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Enviar productos  <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">#include &lt;curl\/curl.h&gt;\n\nCURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https:\/\/api.alvochat.com\/instance1199\/messages\/product\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"content-type: application\/x-www-form-urlencoded\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"token=YourToken&amp;to=16315555555&amp;header=header&amp;body=Hi , check out our new products&amp;footer=footer&amp;catalog_id=&amp;product=&amp;priority=&amp;message_id=\");\n\nCURLcode ret = curl_easy_perform(hnd);<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n<p>Puede ver la documentaci\u00f3n completa de la API de Whatsapp <a href=\"https:\/\/alvochat.com\/docs\/\" data-type=\"URL\" data-id=\"https:\/\/alvochat.com\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">aqu\u00ed<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introducci\u00f3n En este fragmento de c\u00f3digo, se aprende c\u00f3mo enviar una API de WhatsApp utilizando &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"C\u00f3mo enviar una API de WhatsApp utilizando C\" class=\"read-more button\" href=\"https:\/\/alvochat.com\/blog\/es\/como-enviar-whatsapp-api-usando-c-lang\/#more-937\" aria-label=\"Leer m\u00e1s sobre C\u00f3mo enviar una API de WhatsApp utilizando C\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":573,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"%title% | %currentyear%","rank_math_description":"En este fragmento de c\u00f3digo, aprender\u00e1 a enviar una API de WhatsApp utilizando el lenguaje C, para enviar un mensaje de texto,Plantillas, medios de comunicaci\u00f3n, botones, listas, productos\n","rank_math_focus_keyword":"c,WhatsApp API","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[62,63],"tags":[107,108],"class_list":["post-937","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriales","category-whatsappapi-es","tag-api-de-whatsapp","tag-tutoriales","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-using-C.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":2,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"predecessor-version":[{"id":1289,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/posts\/937\/revisions\/1289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/media\/573"}],"wp:attachment":[{"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/es\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}