{"id":1119,"date":"2022-11-08T20:54:34","date_gmt":"2022-11-08T20:54:34","guid":{"rendered":"https:\/\/alvochat.com\/blog\/%d9%83%d9%8a%d9%81%d9%8a%d8%a9-%d8%a5%d8%b1%d8%b3%d8%a7%d9%84-whatsapp-api-%d8%a8%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85-php\/"},"modified":"2022-11-13T07:14:14","modified_gmt":"2022-11-13T07:14:14","slug":"%d9%83%d9%8a%d9%81-%d8%aa%d8%b1%d8%b3%d9%84-whatsapp-api-%d8%a8%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85-php","status":"publish","type":"post","link":"https:\/\/alvochat.com\/blog\/ar\/%d9%83%d9%8a%d9%81-%d8%aa%d8%b1%d8%b3%d9%84-whatsapp-api-%d8%a8%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85-php\/","title":{"rendered":"\u0643\u064a\u0641\u064a\u0629 \u0625\u0631\u0633\u0627\u0644 WhatsApp API \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u0645\u0642\u062f\u0645\u0629<\/h2>\n\n<p>\u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0643\u0648\u062f \u060c \u062a\u062a\u0639\u0644\u0645 \u0643\u064a\u0641\u064a\u0629 \u0625\u0631\u0633\u0627\u0644 WhatsApp API \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP \u060c \u0644\u0625\u0631\u0633\u0627\u0644 \u0631\u0633\u0627\u0644\u0629 \u0646\u0635\u064a\u0629 \u060c \u0642\u0648\u0627\u0644\u0628 WhatsApp \u060c \u0648\u0633\u0627\u0626\u0637 \u060c \u0623\u0632\u0631\u0627\u0631 \u062a\u0641\u0627\u0639\u0644\u064a\u0629 \u060c \u0642\u0648\u0627\u0626\u0645 \u060c \u0645\u0646\u062a\u062c\u0627\u062a &#8230; \u0625\u0644\u062e \u060c \u062d\u0633\u0627\u0628 Alvochat \u0645\u0637\u0644\u0648\u0628 \u0644\u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u0631\u0645\u0648\u0632 \u0627\u0644\u062a\u0627\u0644\u064a\u0629. <a href=\"http:\/\/alvochat.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0642\u0645 \u0628\u0625\u0646\u0634\u0627\u0621 \u062d\u0633\u0627\u0628<\/a> \u0625\u0630\u0627 \u0644\u0645 \u064a\u0643\u0646 \u0644\u062f\u064a\u0643 \u062d\u0633\u0627\u0628.<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\" id=\"first-whatsapp-message-using-curl\">\u0623\u0631\u0633\u0644 \u0646\u0645\u0648\u0630\u062c\u064b\u0627 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 WhatsApp API \u0648 PHP <\/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=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'name' =&gt; 'hello_world',\n'language' =&gt; 'en_us',\n'header' =&gt; '',\n'body' =&gt; '',\n'buttons' =&gt; '',\n'priority' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/template\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n<\/div>\n<\/div>\n\n<h2 class=\"wp-block-heading\">\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u0646\u0635\u064a\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 WhatsApp API \u0648 PHP <\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'body' =&gt; 'WhatsApp API on alvochat.com works good',\n'priority' =&gt; '',\n'preview_url' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/chat\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0635\u0648\u0631\u0629<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'image' =&gt; 'https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/image\/1.jpeg',\n'caption' =&gt; 'image caption',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/image\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0635\u0648\u062a<\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'audio' =&gt; 'https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/audio\/1.mp3',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/audio\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0627\u0631\u0633\u0644 \u0645\u0642\u0637\u0639 \u0641\u064a\u062f\u064a\u0648<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'video' =&gt; 'https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/video\/1.mp4',\n'caption' =&gt; 'video caption',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/video\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'document' =&gt; 'https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/document\/1.pdf',\n'filename' =&gt; '',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/document\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0633\u062a\u064a\u0643\u0631<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'sticker' =&gt; 'https:\/\/alvochat-example.s3-accelerate.amazonaws.com\/sticker\/1.webp',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/sticker\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u062c\u0647\u0629 \u0627\u062a\u0635\u0627\u0644<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'contact' =&gt; '',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/contact\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0645\u0648\u0642\u0639<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'lat' =&gt; '37.484296',\n'lng' =&gt; '-122.148703',\n'address' =&gt; 'Menlo Park, California, United States',\n'name' =&gt; 'Meta Headquarters',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/location\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0642\u0648\u0627\u0626\u0645 <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'header' =&gt; 'header',\n'body' =&gt; ' please select one of the following options',\n'footer' =&gt; 'footer',\n'button' =&gt; 'options',\n'sections' =&gt; 'option_1,option_2,option_3',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/list\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0623\u0632\u0631\u0627\u0631 \u0627\u0644\u0648\u0627\u062a\u0633 \u0627\u0628 \u0627\u0644\u062a\u0641\u0627\u0639\u0644\u064a\u0647 <\/h2>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'header' =&gt; 'header',\n'body' =&gt; ' please select one of the following options',\n'footer' =&gt; 'footer',\n'buttons' =&gt; 'option_1,option_2,option_3',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/button\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0645\u0646\u062a\u062c\u0627\u062a <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'header' =&gt; 'header',\n'body' =&gt; 'Hi , check out our new products',\n'footer' =&gt; 'footer',\n'catalog_id' =&gt; '',\n'product' =&gt; '',\n'priority' =&gt; '',\n'message_id' =&gt; ''\n);\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; \"https:\/\/api.alvochat.com\/instance1199\/messages\/product\",\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; \"\",\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_SSL_VERIFYHOST =&gt; 0,\n  CURLOPT_SSL_VERIFYPEER =&gt; 0,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; \"POST\",\n  CURLOPT_POSTFIELDS =&gt; http_build_query($params),\n  CURLOPT_HTTPHEADER =&gt; array(\n    \"content-type: application\/x-www-form-urlencoded\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u0646\u0635\u064a\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 HTTP Request Lib<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\nrequire_once 'HTTP\/Request2.php';\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'body' =&gt; 'WhatsApp API on alvochat.com works good',\n'priority' =&gt; '',\n'preview_url' =&gt; '',\n'message_id' =&gt; ''\n);\n\n$request = new HTTP_Request2();\n\n$request-&gt;setUrl('https:\/\/api.alvochat.com\/instance1199\/messages\/chat');\n$request-&gt;setMethod(HTTP_Request2::METHOD_POST);\n$request-&gt;setConfig(array(\n  'follow_redirects' =&gt; TRUE\n));\n$request-&gt;setHeader(array(\n  'Content-Type' =&gt; 'application\/x-www-form-urlencoded'\n));\n$request-&gt;addPostParameter($params);\ntry {\n  $response = $request-&gt;send();\n  if ($response-&gt;getStatus() == 200) {\n    echo $response-&gt;getBody();\n  }\n  else {\n    echo 'Unexpected HTTP status: ' . $response-&gt;getStatus() . ' ' .\n    $response-&gt;getReasonPhrase();\n  }\n}\ncatch(HTTP_Request2_Exception $e) {\n  echo 'Error: ' . $e-&gt;getMessage();\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u0646\u0635\u064a\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 Guzzle Lib<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\nrequire 'vendor\/autoload.php';\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Request;\n\n$params=array(\n'token' =&gt; 'YourToken',\n'to' =&gt; '16315555555',\n'body' =&gt; 'WhatsApp API on alvochat.com works good',\n'priority' =&gt; '',\n'preview_url' =&gt; '',\n'message_id' =&gt; ''\n);\n\n$client = new Client();\n$headers = &#091;\n  'Content-Type' =&gt; 'application\/x-www-form-urlencoded'\n];\n$options = &#091;'form_params' =&gt;$params ];\n$request = new Request('POST', 'https:\/\/api.alvochat.com\/instance1199\/messages\/chat', $headers);\n$res = $client-&gt;sendAsync($request, $options)-&gt;wait();\necho $res-&gt;getBody();<\/code><\/code><\/pre>\n\n<p><\/p>\n\n<p>\u064a\u0645\u0643\u0646\u0643 \u0627\u0644\u0627\u0637\u0644\u0627\u0639 \u0639\u0644\u0649 \u0648\u062b\u0627\u0626\u0642 Whatsapp API \u0627\u0644\u0643\u0627\u0645\u0644\u0629 <a href=\"https:\/\/alvochat.com\/docs\/\" data-type=\"URL\" data-id=\"https:\/\/alvochat.com\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0647\u0646\u0627<\/a> .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0645\u0642\u062f\u0645\u0629 \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0643\u0648\u062f \u060c \u062a\u062a\u0639\u0644\u0645 \u0643\u064a\u0641\u064a\u0629 \u0625\u0631\u0633\u0627\u0644 WhatsApp API \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP \u060c \u0644\u0625\u0631\u0633\u0627\u0644 \u0631\u0633\u0627\u0644\u0629 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"\u0643\u064a\u0641\u064a\u0629 \u0625\u0631\u0633\u0627\u0644 WhatsApp API \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP\" class=\"read-more button\" href=\"https:\/\/alvochat.com\/blog\/ar\/%d9%83%d9%8a%d9%81-%d8%aa%d8%b1%d8%b3%d9%84-whatsapp-api-%d8%a8%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85-php\/#more-1119\" aria-label=\"Read more about \u0643\u064a\u0641\u064a\u0629 \u0625\u0631\u0633\u0627\u0644 WhatsApp API \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":789,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"%title% | %currentyear%","rank_math_description":"\u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0643\u0648\u062f \u060c \u062a\u062a\u0639\u0644\u0645 \u0643\u064a\u0641\u064a\u0629 \u0625\u0631\u0633\u0627\u0644 WhatsApp API \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 php \u060c \u0644\u0625\u0631\u0633\u0627\u0644 \u0631\u0633\u0627\u0644\u0629 \u0646\u0635\u064a\u0629 \u060c \u0642\u0648\u0627\u0644\u0628 \u060c \u0648\u0633\u0627\u0626\u0637 \u060c \u0623\u0632\u0631\u0627\u0631 \u060c \u0642\u0648\u0627\u0626\u0645 \u060c \u0645\u0646\u062a\u062c\u0627\u062a\n","rank_math_focus_keyword":"PHP \u0648 WhatsApp API","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[80,79],"tags":[81,182,82],"class_list":["post-1119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-whatsappapi-ar","category-79","tag-whatsapp-api-ar","tag-182","tag-82","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-PHP.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/posts\/1119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/comments?post=1119"}],"version-history":[{"count":14,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/posts\/1119\/revisions"}],"predecessor-version":[{"id":1333,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/posts\/1119\/revisions\/1333"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/media\/789"}],"wp:attachment":[{"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/media?parent=1119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/categories?post=1119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvochat.com\/blog\/ar\/wp-json\/wp\/v2\/tags?post=1119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}