{"id":6064,"date":"2022-12-31T11:30:19","date_gmt":"2022-12-31T08:00:19","guid":{"rendered":"https:\/\/en.geobox.ir\/developers\/?post_type=docs&#038;p=6064"},"modified":"2023-01-18T13:00:19","modified_gmt":"2023-01-18T09:30:19","slug":"quick-installation-3","status":"publish","type":"docs","link":"https:\/\/en.geobox.ir\/developers\/docs\/geobox-api-for-javascript\/quick-installation-3\/","title":{"rendered":"Quick installation"},"content":{"rendered":"<p>First, receive a token or API key for your project through the <a href=\"https:\/\/api.geobox.ir\">Geobox portal<\/a>. Read <a href=\"https:\/\/www.geobox.ir\/doc\/v1\/%d9%85%d8%af%db%8c%d8%b1%db%8c%d8%aa-%d8%ad%d8%b3%d8%a7%d8%a8%d9%87%d8%a7-%d9%88-%d8%aa%d9%88%da%a9%d9%86%d9%87%d8%a7%db%8c-%d8%af%d8%b3%d8%aa%d8%b1%d8%b3%db%8c\/%d8%aa%d9%86%d8%b8%db%8c%d9%85%d8%a7%d8%aa-%d8%ad%d8%b3%d8%a7%d8%a8-%da%a9%d8%a7%d8%b1%d8%a8%d8%b1%db%8c\/\">managing accounts and access tokens<\/a> for instructions on how to register and obtain token or api key.<\/p>\n<h3>Get from CDN<\/h3>\n<p>This library does not have a CSS file and you only need to add the JavaScript file. Add the JavaScript file to the beginning of the Body tag:<\/p>\n<pre class=\"EnlighterJSRAW\" dir=\"ltr\" data-enlighter-language=\"generic\">&lt;script type=\"text\/javascript\" src=\"https:\/\/api.geobox.ir\/libs\/geobox-js\/geobox.min.js\"&gt;&lt;\/script&gt;<\/pre>\n<h3 style=\"text-align: left;\">Get the JavaScript library<\/h3>\n<p>First, download the JavaScript library from the <a href=\"https:\/\/api.geobox.ir\/v1\/auth\/login\/\">download page<\/a>, and then follow the steps:<\/p>\n<p style=\"text-align: left;\">Add the JavaScript file to the beginning of the Body tag:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;script type=\"text\/javascript\" src=\".\/js\/geobox.min.js\"&gt;&lt;\/script&gt;<\/pre>\n<p>The structure of the example is as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" dir=\"ltr\" data-enlighter-language=\"generic\">root\r\n\u251c\u2500\u2500 js\r\n\u2502 \u251c\u2500\u2500 geobox.min.js\r\n\u2514\u2500\u2500 index.html<\/pre>\n<p>After creating the mentioned structure, you have access to the \u00abserver\u00bb object, which includes methods and properties.<\/p>\n<pre class=\"EnlighterJSRAW\" dir=\"ltr\" data-enlighter-language=\"html\" data-enlighter-group=\"HTML\" data-enlighter-title=\"HTML\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=\"utf-8\"&gt;\r\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script type=\"text\/javascript\" src=\"https:\/\/api.geobox.ir\/libs\/geobox-js\/geobox.min.js\"&gt;&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<pre class=\"EnlighterJSRAW\" dir=\"ltr\" data-enlighter-language=\"js\" data-enlighter-title=\"Java Script\" data-enlighter-theme=\"enlighter\">const server = new Geobox.Server({origin:'https:\/\/api.geobox.ir'}); \r\nserver.accessToken = \"&lt;your access token here&gt;\"; \/\/ or server.apikey= \"&lt;your apikey here&gt;\";<\/pre>\n<p>To know the difference between API key and access token, read <a href=\"https:\/\/www.geobox.ir\/doc\/v1\/%d9%85%d8%af%db%8c%d8%b1%db%8c%d8%aa-%d8%ad%d8%b3%d8%a7%d8%a8%d9%87%d8%a7-%d9%88-%d8%aa%d9%88%da%a9%d9%86%d9%87%d8%a7%db%8c-%d8%af%d8%b3%d8%aa%d8%b1%d8%b3%db%8c\/%d8%aa%d9%86%d8%b8%db%8c%d9%85%d8%a7%d8%aa-%d8%ad%d8%b3%d8%a7%d8%a8-%da%a9%d8%a7%d8%b1%d8%a8%d8%b1%db%8c\/\">managing accounts and access tokens<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, receive a token or API key for your project through the Geobox portal. Read managing accounts and access tokens for instructions on how to register and obtain token or api key. Get from CDN This library does not have a CSS file and you only need to add the JavaScript file. Add the JavaScript [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[34],"doc_tag":[],"class_list":["post-6064","docs","type-docs","status-publish","hentry","doc_category-geobox-api-for-javascript"],"_links":{"self":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/comments?post=6064"}],"version-history":[{"count":12,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6064\/revisions"}],"predecessor-version":[{"id":6794,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6064\/revisions\/6794"}],"wp:attachment":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/media?parent=6064"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_category?post=6064"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_tag?post=6064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}