{"id":2298,"date":"2022-05-03T01:35:53","date_gmt":"2022-05-03T01:35:53","guid":{"rendered":"https:\/\/blog.ultramsg.com\/%e0%a4%aa%e0%a5%8d%e0%a4%b0%e0%a4%be%e0%a4%aa%e0%a5%8d%e0%a4%a4-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%8f%e0%a4%aa%e0%a5%80%e0%a4%86%e0%a4%88\/"},"modified":"2022-05-03T01:35:56","modified_gmt":"2022-05-03T01:35:56","slug":"%e0%a4%aa%e0%a5%8d%e0%a4%b0%e0%a4%be%e0%a4%aa%e0%a5%8d%e0%a4%a4-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%8f%e0%a4%aa%e0%a5%80%e0%a4%86%e0%a4%88","status":"publish","type":"post","link":"https:\/\/blog.ultramsg.com\/hi\/%e0%a4%aa%e0%a5%8d%e0%a4%b0%e0%a4%be%e0%a4%aa%e0%a5%8d%e0%a4%a4-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%8f%e0%a4%aa%e0%a5%80%e0%a4%86%e0%a4%88\/","title":{"rendered":"Webhook \u0914\u0930 Node.js \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 WhatsApp \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0947\u0902"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction\">\u092a\u0930\u093f\u091a\u092f<\/h2>\n\n<p>\u0907\u0938 \u091f\u094d\u092f\u0942\u091f\u094b\u0930\u093f\u092f\u0932 \u092e\u0947\u0902, \u0939\u092e Node.js . \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 \u0906\u0928\u0947 \u0935\u093e\u0932\u0947 \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u0938\u0902\u0926\u0947\u0936 \u0935\u0947\u092c\u0939\u0941\u0915 \u0915\u094b \u0938\u0902\u092d\u093e\u0932\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u090f\u0915 \u092a\u0947\u091c \u092c\u0928\u093e\u090f\u0902\u0917\u0947<\/p>\n\n<h2 class=\"wp-block-heading\" id=\"dependencies\">\u0928\u093f\u0930\u094d\u092d\u0930\u0924\u093e<\/h2>\n\n<p>\u0938\u094d\u0925\u093e\u0928\u0940\u092f \u0935\u093f\u0915\u093e\u0938 \u0909\u0926\u094d\u0926\u0947\u0936\u094d\u092f\u094b\u0902 \u0915\u0947 \u0932\u093f\u090f, \u090f\u0915 \u0938\u0941\u0930\u0902\u0917 \u0938\u0947\u0935\u093e \u0915\u0940 \u0906\u0935\u0936\u094d\u092f\u0915\u0924\u093e \u0939\u0948\u0964 \u092f\u0939 \u0909\u0926\u093e\u0939\u0930\u0923 \u090f\u0928\u0917\u094d\u0930\u094b\u0915 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u093e \u0939\u0948, \u0906\u092a \u092f\u0939\u093e\u0902 \u090f\u0928\u0917\u094d\u0930\u094b\u0915 \u0921\u093e\u0909\u0928\u0932\u094b\u0921 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902: <a href=\"https:\/\/ngrok.com\/download\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ngrok.com\/download<\/a><\/p>\n\n<h2 class=\"wp-block-heading\" id=\"set-up-your-project\">\u0905\u092a\u0928\u093e \u092a\u094d\u0930\u094b\u091c\u0947\u0915\u094d\u091f \u0938\u0947\u091f \u0915\u0930\u0947\u0902<\/h2>\n\n<p>\u090f\u0915\u094d\u0938\u092a\u094d\u0930\u0947\u0938 \u0914\u0930 \u092c\u0949\u0921\u0940-\u092a\u093e\u0930\u094d\u0938\u0930 \u0938\u094d\u0925\u093e\u092a\u093f\u0924 \u0915\u0930\u0947\u0902:<\/p>\n\n<pre class=\"wp-block-code\"><code>npm install express body-parser<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"a-simple-example-of-receiving-whatsapp-messages-from-ultramsg\">Ultramsg \u0938\u0947 WhatsApp \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0928\u0947 \u0915\u093e \u090f\u0915 \u0938\u0930\u0932 \u0909\u0926\u093e\u0939\u0930\u0923 <\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">const express = require('express')\nconst bodyParser = require('body-parser')\nconst app = express()\nconst PORT = 3000\n\/\/ Setup a webhook route\napp.use(bodyParser.json())\napp.post('\/ultramsgwebhook', (req, res) =&gt; {\n  console.log(req.body) \/\/ print all response\n\n  \/\/messageFrom=req.body&#91;'data']&#91;'from'] \/\/ sender number\n  \/\/messageMsg=req.body&#91;'data']&#91;'body'] \/\/ Message text\n  res.status(200).end()\n})\n\napp.use(bodyParser.json())\napp.listen(PORT, () =&gt; console.log(`\ud83d\ude80 Server running on port ${PORT}\ud83d\ude80 `))<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"start-ngrok-node-js-project\">ngrok \u0914\u0930 Node.js \u092a\u094d\u0930\u094b\u091c\u0947\u0915\u094d\u091f \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0902 <\/h2>\n\n<p>\u0935\u093f\u0902\u0921\u094b\u091c \u0915\u0947 \u0932\u093f\u090f \u090f\u0928\u0917\u094d\u0930\u094b\u0915 \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0902:<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">ngrok http 3000<\/code><\/code><\/pre>\n\n<p>\u092e\u0948\u0915 \u0915\u0947 \u0932\u093f\u090f Ngrok \u092a\u094d\u0930\u093e\u0930\u0902\u092d \u0915\u0930\u0947\u0902:<\/p>\n\n<pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">.\/ngrok http 3000<\/code><\/pre>\n\n<p>Nodejs \u092a\u094d\u0930\u094b\u091c\u0947\u0915\u094d\u091f \u092a\u094d\u0930\u093e\u0930\u0902\u092d \u0915\u0930\u0947\u0902: <\/p>\n\n<pre class=\"wp-block-code\"><code>node index.js<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"set-webhook-url-to-your-instance-in-ultramsg\">Ultramsg \u092e\u0947\u0902 Webhook URL \u0915\u094b \u0905\u092a\u0928\u0947 \u0909\u0926\u093e\u0939\u0930\u0923 \u092a\u0930 \u0938\u0947\u091f \u0915\u0930\u0947\u0902<\/h2>\n\n<p>\u0939\u092e \u090f\u0915 \u0928\u092f\u093e \u0935\u0947\u092c\u0939\u0941\u0915 \u090f\u0902\u0921\u092a\u0949\u0907\u0902\u091f \u092c\u0928\u093e\u0924\u0947 \u0939\u0948\u0902: http:\/\/your-ngrok.io.com\/ultramsgwebhook \u0905\u0928\u0941\u0930\u094b\u0927 \u0915\u094b \u0938\u0902\u092d\u093e\u0932\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f, \u0905\u092c \u0935\u0947\u092c\u0939\u0941\u0915 \u092f\u0942\u0906\u0930\u090f\u0932 \u0915\u094b \u0905\u0932\u094d\u091f\u094d\u0930\u093e\u090f\u092e\u090f\u0938\u091c\u0940 \u092e\u0947\u0902 \u0907\u0902\u0938\u094d\u091f\u0947\u0902\u0938 \u092e\u0947\u0902 \u0930\u0916\u093e \u091c\u093e\u0928\u093e \u091a\u093e\u0939\u093f\u090f \u0914\u0930 \u0935\u0947\u092c\u0939\u0941\u0915 \u0911\u0928 \u0930\u093f\u0938\u0940\u0935\u094d\u0921 \u0935\u093f\u0915\u0932\u094d\u092a \u0915\u094b \u0938\u0915\u094d\u0937\u092e \u0915\u0930\u0928\u093e \u091a\u093e\u0939\u093f\u090f, \u091c\u0948\u0938\u093e \u0915\u093f \u0928\u093f\u092e\u094d\u0928 \u091b\u0935\u093f \u092e\u0947\u0902 \u0939\u0948: <\/p>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"570\" src=\"https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2022\/02\/image-1024x570.png\" alt=\"Webhook &#x914;&#x930; Node.js &#x915;&#x93E; &#x909;&#x92A;&#x92F;&#x94B;&#x917; &#x915;&#x930;&#x915;&#x947; WhatsApp &#x938;&#x902;&#x926;&#x947;&#x936; &#x92A;&#x94D;&#x930;&#x93E;&#x92A;&#x94D;&#x924; &#x915;&#x930;&#x947;&#x902; - WhatsApp API\" class=\"wp-image-2217\" title=\"\" srcset=\"https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2022\/02\/image-1024x570.png 1024w, https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2022\/02\/image-300x167.png 300w, https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2022\/02\/image-768x427.png 768w, https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2022\/02\/image.png 1334w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<h2 class=\"wp-block-heading\" id=\"example-json-response\">\u0909\u0926\u093e\u0939\u0930\u0923 JSON \u092a\u094d\u0930\u0924\u093f\u0915\u094d\u0930\u093f\u092f\u093e<\/h2>\n\n<pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"json\" class=\"EnlighterJSRAW\">{\n  event_type: 'message_received',\n  instanceId: '1150',\n  data: {\n    id: 'false_17692426345@c.us_3EB0FF54790702367270',\n    from: '17692426340@c.us',\n    to: '17692426345@c.us',\n    ack: '',\n    type: 'chat',\n    body: 'Hello, World!',\n    fromMe: false,\n    time: 1644957719\n  }\n}<\/code><\/pre>\n\n<p>\u092c\u0927\u093e\u0908 \u0939\u094b\u0964 \u0906\u092a\u0915\u094b \u0905\u092a\u0928\u093e \u092a\u0939\u0932\u093e \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0939\u0941\u0906 \u0939\u0948\u0964<\/p>\n\n<h2 class=\"wp-block-heading\" id=\"types-of-webhooks-to-use-with-whatsapp-api-ultramsg\">WhatsApp API \u0914\u0930 Ultramsg \u0915\u0947 \u0938\u093e\u0925 \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0935\u0947\u092c\u0939\u0941\u0915 \u0915\u0947 \u092a\u094d\u0930\u0915\u093e\u0930 <\/h2>\n\n<ul class=\"wp-block-list\"><li><strong>webhook_message_received<\/strong> : \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0939\u094b\u0928\u0947 \u092a\u0930 \u0935\u0947\u092c\u0939\u0941\u0915 \u092e\u0947\u0902 \u0938\u0942\u091a\u0928\u093e\u090f\u0902\u0964<\/li><li><strong>webhook_message_create<\/strong> : \u0938\u0902\u0926\u0947\u0936 \u092c\u0928\u093e\u0924\u0947 \u0938\u092e\u092f \u0935\u0947\u092c\u0939\u0941\u0915 \u092e\u0947\u0902 \u0938\u0942\u091a\u0928\u093e\u090f\u0902\u0964<\/li><li><strong>webhook_message_ack<\/strong> : ack (\u0938\u0902\u0926\u0947\u0936 \u0926\u093f\u092f\u093e \u0917\u092f\u093e \u0914\u0930 \u0938\u0902\u0926\u0947\u0936 \u0926\u0947\u0916\u093e \u0917\u092f\u093e) \u0935\u0947\u092c\u0939\u0941\u0915 \u092e\u0947\u0902 \u0938\u0942\u091a\u0928\u093e\u090f\u0902\u0964<\/li><\/ul>\n\n<ul class=\"wp-block-list\"><li>\u0905\u0902\u0924 \u092e\u0947\u0902, \u0906\u092a \u092a\u0942\u0930\u094d\u0923 <a href=\"https:\/\/docs.ultramsg.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u090f\u092a\u0940\u0906\u0908 \u0926\u0938\u094d\u0924\u093e\u0935\u0947\u091c\u093c\u0940\u0915\u0930\u0923<\/a> \u0914\u0930 <a href=\"https:\/\/blog.ultramsg.com\/whatsapp-api-by-ultramsg-faq\/\" data-type=\"URL\" data-id=\"https:\/\/blog.ultramsg.com\/whatsapp-api-by-ultramsg-faq\/\">\u0905\u0915\u094d\u0938\u0930 \u092a\u0942\u091b\u0947 \u091c\u093e\u0928\u0947 \u0935\u093e\u0932\u0947 \u092a\u094d\u0930\u0936\u094d\u0928<\/a> \u0926\u0947\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964<\/li><li><a href=\"https:\/\/blog.ultramsg.com\/hi\/whatsappapi-%e0%a4%b8%e0%a4%82%e0%a4%a6%e0%a5%87%e0%a4%b6-%e0%a4%95%e0%a5%87-%e0%a4%b8%e0%a4%be%e0%a4%a5-%e0%a4%a8%e0%a5%8b%e0%a4%a1-%e0%a4%9c%e0%a5%87%e0%a4%8f%e0%a4%b8-%e0%a4%94%e0%a4%b0-%e0%a4%85\/\" data-type=\"URL\" data-id=\"https:\/\/blog.ultramsg.com\/whatsappapi-message-with-node-js-and-ultramsg\/\">Node.js \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 \u0906\u0938\u093e\u0928\u0940 \u0938\u0947 WhatsApp API \u0926\u094d\u0935\u093e\u0930\u093e \u0938\u0902\u0926\u0947\u0936 \u0915\u0948\u0938\u0947 \u092d\u0947\u091c\u0947\u0902<\/a> \u0964<\/li><\/ul>\n\n<p>\u0906\u092a \u0907\u0938 \u0935\u0940\u0921\u093f\u092f\u094b \u092e\u0947\u0902 \u092a\u093f\u091b\u0932\u0947 \u091a\u0930\u0923 \u0926\u0947\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902:<\/p>\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Receive WhatsApp messages using Webhook and Node.js\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/c0_U_OcAPKw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u092a\u0930\u093f\u091a\u092f \u0907\u0938 \u091f\u094d\u092f\u0942\u091f\u094b\u0930\u093f\u092f\u0932 \u092e\u0947\u0902, \u0939\u092e Node.js . \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 \u0906\u0928\u0947 \u0935\u093e\u0932\u0947 \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u0938\u0902\u0926\u0947\u0936 \u0935\u0947\u092c\u0939\u0941\u0915 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Webhook \u0914\u0930 Node.js \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 WhatsApp \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0947\u0902\" class=\"read-more button\" href=\"https:\/\/blog.ultramsg.com\/hi\/%e0%a4%aa%e0%a5%8d%e0%a4%b0%e0%a4%be%e0%a4%aa%e0%a5%8d%e0%a4%a4-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%8f%e0%a4%aa%e0%a5%80%e0%a4%86%e0%a4%88\/#more-2298\" aria-label=\"Read more about Webhook \u0914\u0930 Node.js \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 WhatsApp \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0947\u0902\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":2218,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[186],"tags":[199,193,187],"class_list":["post-2298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-186","tag-node-js-hi","tag-webhook-hi","tag-187","infinite-scroll-item","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-25","no-featured-image-padding"],"_links":{"self":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts\/2298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/comments?post=2298"}],"version-history":[{"count":3,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts\/2298\/revisions"}],"predecessor-version":[{"id":2301,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts\/2298\/revisions\/2301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/media\/2218"}],"wp:attachment":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/media?parent=2298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/categories?post=2298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/tags?post=2298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}