{"id":4899,"date":"2023-02-16T21:16:34","date_gmt":"2023-02-16T21:16:34","guid":{"rendered":"https:\/\/blog.ultramsg.com\/%d8%aa%d8%ad%d9%85%d9%8a%d9%84-%d9%88%d8%b3%d8%a7%d8%a6%d8%b7-%d9%84%d8%a5%d8%b1%d8%b3%d8%a7%d9%84-%d8%a7%d9%84%d9%88%d8%a7%d8%aa%d8%b3-%d9%88%d8%ab%d8%a7%d8%a6%d9%82\/"},"modified":"2023-02-16T21:16:35","modified_gmt":"2023-02-16T21:16:35","slug":"%d8%aa%d8%ad%d9%85%d9%8a%d9%84-%d9%88%d8%b3%d8%a7%d8%a6%d8%b7-%d9%84%d8%a5%d8%b1%d8%b3%d8%a7%d9%84-%d8%a7%d9%84%d9%88%d8%a7%d8%aa%d8%b3-%d9%88%d8%ab%d8%a7%d8%a6%d9%82","status":"publish","type":"post","link":"https:\/\/blog.ultramsg.com\/ar\/%d8%aa%d8%ad%d9%85%d9%8a%d9%84-%d9%88%d8%b3%d8%a7%d8%a6%d8%b7-%d9%84%d8%a5%d8%b1%d8%b3%d8%a7%d9%84-%d8%a7%d9%84%d9%88%d8%a7%d8%aa%d8%b3-%d9%88%d8%ab%d8%a7%d8%a6%d9%82\/","title":{"rendered":"\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0648\u0633\u0627\u0626\u0637 \u0644\u0625\u0631\u0633\u0627\u0644 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0648\u0648\u0633\u0627\u0626\u0637 Whatsapp"},"content":{"rendered":"\n<p><\/p>\n\n<p>\u064a\u062f\u0639\u0645 Ultramsg \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0635\u0648\u0631 \u0648\u0645\u0642\u0627\u0637\u0639 \u0627\u0644\u0641\u064a\u062f\u064a\u0648 \u0648\u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0646 \u062e\u0644\u0627\u0644 \u0639\u0646\u0648\u0627\u0646 URL \u0645\u0628\u0627\u0634\u0631 \u060c \u0648\u0644\u0643\u0646 \u0625\u0630\u0627 \u0643\u0646\u062a \u0628\u062d\u0627\u062c\u0629 \u0625\u0644\u0649 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0646 \u062e\u0627\u062f\u0645 \u0645\u062d\u0644\u064a \u060c \u0641\u064a\u062c\u0628 \u0639\u0644\u064a\u0643 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0645\u0644\u0641\u0627\u062a \u0648\u062a\u062d\u0648\u064a\u0644\u0647\u0627 \u0625\u0644\u0649 \u062a\u0646\u0633\u064a\u0642 base64 \u062b\u0645 \u0625\u0631\u0633\u0627\u0644\u0647\u0627. \u0644\u0643\u0646 \u0639\u064a\u0628 <a href=\"https:\/\/blog.ultramsg.com\/ar\/%d8%a3%d8%b1%d8%b3%d9%84-%d9%88%d8%a7%d8%aa%d8%b3-%d8%a7%d8%a8-%d8%b5%d9%88%d8%b1-%d9%88%d8%ab%d8%a7%d8%a6%d9%82-%d8%a8%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85-base64\/\" data-type=\"URL\" data-id=\"https:\/\/blog.ultramsg.com\/send-whatsapp-images-documents-using-base64\/\" target=\"_blank\" rel=\"noreferrer noopener\">base64<\/a> \u0647\u0648 \u0623\u0646 \u0627\u0644\u062d\u062c\u0645 \u064a\u0642\u062a\u0635\u0631 \u0639\u0644\u0649 10 \u0645\u0644\u0627\u064a\u064a\u0646 \u062d\u0631\u0641 \u0643\u062d\u062f \u0623\u0642\u0635\u0649 \u060c \u0623\u064a \u062d\u0648\u0627\u0644\u064a 6.5M.<\/p>\n\n<p>\u0644\u0642\u062f \u0642\u062f\u0645\u0646\u0627 \u062d\u0644\u0627\u064b \u0628\u062f\u064a\u0644\u0627\u064b \u0648\u0623\u0641\u0636\u0644 \u0644\u0647\u0630\u0627 \u0639\u0646 \u0637\u0631\u064a\u0642 \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0644\u0641 \u0645\u0646 \u0627\u0644\u062e\u0627\u062f\u0645 \u0627\u0644\u0645\u062d\u0644\u064a \u0625\u0644\u0649 CDN \u0628\u062a\u0643\u0644\u0641\u0629 \u0645\u062c\u0627\u0646\u064a\u0629 \u0644\u0639\u0645\u0644\u0627\u0621 Ultramsg.<\/p>\n\n<p><code>Route path : [POST] <code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">\/media\/upload<\/code> <\/code><\/p>\n\n<p>\u0627\u0644\u0645\u0639\u0644\u0645\u0627\u062a \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629: <\/p>\n\n<ul class=\"wp-block-list\">\n<li>\u0627\u0644\u0645\u0644\u0641: \u0627\u0633\u0645 \u0627\u0644\u0645\u0644\u0641 \u0645\u062b\u0644 \/path\/example.pdf.<\/li>\n\n\n\n<li>\u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0645\u0645\u064a\u0632: \u0631\u0645\u0632 \u0627\u0644\u0645\u062b\u064a\u0644 \u0627\u0644\u062e\u0627\u0635 \u0628\u0643.<\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\">\u062c\u0645\u0639 \u0633\u0627\u0639\u064a \u0627\u0644\u0628\u0631\u064a\u062f \u0644\u0625\u062c\u0631\u0627\u0621 \u0627\u062e\u062a\u0628\u0627\u0631 \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0644\u0641\u0627\u062a<\/h2>\n\n<p>\u064a\u0645\u0643\u0646\u0643 \u0627\u0633\u062a\u064a\u0631\u0627\u062f \u0645\u062c\u0645\u0648\u0639\u0629 \u0633\u0627\u0639\u064a \u0627\u0644\u0628\u0631\u064a\u062f \u0645\u0646 <a href=\"https:\/\/file-example.s3.us-west-2.amazonaws.com\/postman\/Ultramsg+upload+media.postman_collection.json\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/file-example.s3.us-west-2.amazonaws.com\/postman\/Ultramsg+upload+media.postman_collection.json\" rel=\"noreferrer noopener\">\u0647\u0646\u0627<\/a> .<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"367\" src=\"https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2023\/02\/image-1024x367.png\" alt=\"\" class=\"wp-image-4810\" title=\"\" srcset=\"https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2023\/02\/image-1024x367.png 1024w, https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2023\/02\/image-300x107.png 300w, https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2023\/02\/image-768x275.png 768w, https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2023\/02\/image.png 1284w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0644\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 PHP<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;?php\n\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; 'https:\/\/api.ultramsg.com\/instance950\/media\/upload',\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; '',\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 0,\n  CURLOPT_FOLLOWLOCATION =&gt; true,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; 'POST',\n  CURLOPT_POSTFIELDS =&gt; array('file' =&gt; new CURLFILE('sample.pdf'), 'token' =&gt; 'Yourtoken'),\n));\n\n$response = curl_exec($curl);\ncurl_close($curl);\necho $response;<\/code><\/code><\/pre>\n\n<p>\u0628\u0639\u062f \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0637\u0644\u0628 \u0627\u0644\u0633\u0627\u0628\u0642 \u060c \u0633\u064a\u062a\u0645 \u0625\u0631\u062c\u0627\u0639 \u0631\u0627\u0628\u0637 \u0627\u0644\u0645\u0644\u0641 \u0625\u0644\u064a\u0643 \u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0647 \u0641\u064a \u0625\u0631\u0633\u0627\u0644 WhatsApp API.<\/p>\n\n<h2 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0639\u0644\u0649 \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 Python<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">import requests\n\nurl = \"https:\/\/api.ultramsg.com\/instance950\/media\/upload\"\n\npayload={'token': 'Yourtoken'}\nfiles=&#91;\n  ('file',('sample.pdf',open('\/folder\/sample.pdf','rb'),'application\/pdf'))\n]\nheaders = {}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload, files=files)\n\nprint(response.text)\n<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0644\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 c #<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"csharp\" class=\"EnlighterJSRAW\">using System.Net;\nusing System.Text;\n\nnamespace FileUploadExample\n{\n    class Program\n    {\n        static void Main(string&#91;] args)\n        {\n            var token = \"Yourtoken\";\n            var instance = \"instance950\";\n\n            var filePath = \"\/folder\/sample.pdf\";\n            var url = \"https:\/\/api.ultramsg.com\/\" + instance + \"\/media\/upload\/?token=\" + token;\n\n            var client = new WebClient();\n\n            var response = client.UploadFile(url, \"POST\", filePath);\n            string responseInString = Encoding.UTF8.GetString(response);\n            Console.WriteLine(responseInString);\n\n        }\n    }\n}<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0644\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 curl<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">curl --location --request POST 'https:\/\/api.ultramsg.com\/instance950\/media\/upload' \\\n--form 'file=@\"\/folder\/sample.pdf\"' \\\n--form 'token=\"Yourtoken\"'<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0644\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 NodeJs &#8211; \u0637\u0644\u0628 lib<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">var request = require('request');\nvar fs = require('fs');\nvar options = {\n  'method': 'POST',\n  'url': 'https:\/\/api.ultramsg.com\/instance950\/media\/upload',\n  'headers': {\n  },\n  formData: {\n    'file': {\n      'value': fs.createReadStream('\/folder\/sample.pdf'),\n      'options': {\n        'filename': 'sample.pdf',\n        'contentType': null\n      }\n    },\n    'token': 'Yourtoken'\n  }\n};\nrequest(options, function (error, response) {\n  if (error) throw new Error(error);\n  console.log(response.body);\n});\n<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0644\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 vb.net<\/h2>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"csharp\" class=\"EnlighterJSRAW\">\nImports System.Net\nImports System.Text\n\nModule Program\n    Sub Main(args As String())\n        Const token As String = \"Yourtoken\"\n        Const instance = \"instance950\"\n        Const filePath = \"test.jpg\"\n        const url = \"https:\/\/api.ultramsg.com\/\" &amp; instance &amp; \"\/media\/upload\/?token=\" &amp; token\n        Dim client = New WebClient()\n        Dim response = client.UploadFile(url, \"POST\", filePath)\n        Dim documentUrl As String = Encoding.UTF8.GetString(response)\n        Console.WriteLine(documentUrl)\n    End Sub\nEnd Module\n<\/code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u064a\u062f\u0639\u0645 Ultramsg \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0635\u0648\u0631 \u0648\u0645\u0642\u0627\u0637\u0639 \u0627\u0644\u0641\u064a\u062f\u064a\u0648 \u0648\u0627\u0644\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0646 \u062e\u0644\u0627\u0644 \u0639\u0646\u0648\u0627\u0646 URL \u0645\u0628\u0627\u0634\u0631 \u060c \u0648\u0644\u0643\u0646 \u0625\u0630\u0627 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0648\u0633\u0627\u0626\u0637 \u0644\u0625\u0631\u0633\u0627\u0644 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0648\u0648\u0633\u0627\u0626\u0637 Whatsapp\" class=\"read-more button\" href=\"https:\/\/blog.ultramsg.com\/ar\/%d8%aa%d8%ad%d9%85%d9%8a%d9%84-%d9%88%d8%b3%d8%a7%d8%a6%d8%b7-%d9%84%d8%a5%d8%b1%d8%b3%d8%a7%d9%84-%d8%a7%d9%84%d9%88%d8%a7%d8%aa%d8%b3-%d9%88%d8%ab%d8%a7%d8%a6%d9%82\/#more-4899\" aria-label=\"Read more about \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0648\u0633\u0627\u0626\u0637 \u0644\u0625\u0631\u0633\u0627\u0644 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0648\u0648\u0633\u0627\u0626\u0637 Whatsapp\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":4780,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[318,40,38],"class_list":["post-4899","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category---api","tag-318","tag-40","tag---api","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\/ar\/wp-json\/wp\/v2\/posts\/4899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/comments?post=4899"}],"version-history":[{"count":1,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/posts\/4899\/revisions"}],"predecessor-version":[{"id":4900,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/posts\/4899\/revisions\/4900"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/media\/4780"}],"wp:attachment":[{"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/media?parent=4899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/categories?post=4899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ultramsg.com\/ar\/wp-json\/wp\/v2\/tags?post=4899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}