{"id":217753,"date":"2014-03-31T22:19:02","date_gmt":"2014-03-31T18:19:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=217753"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=217753","title":{"rendered":"<span class=\"post_title\">\u041e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e StackExchange API<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c35\/32f\/d5c\/c3532fd5c505622e563305c3c197851d.png\"\/><br \/>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441 \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c. \u041c\u043d\u043e\u0433\u0438\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0432\u043e\u0435 API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0432\u043e\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API. \u041f\u043e\u0442\u043e\u043c\u0443 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 API \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Stack Exchange API.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h5>1. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 StackApps. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"http:\/\/stackapps.com\/apps\/oauth\/register\">stackapps.com\/apps\/oauth\/register<\/a> \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u043d\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0443\u043d\u043a\u0442\u043e\u043c <u>optional<\/u>. \u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b \u043f\u043e\u043b\u044f \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/81f\/0d0\/9c7\/81f0d09c7cb9bbdf98d797e4e9247b43.png\"\/><\/p>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432 \u00abEnable Client Side OAuth Flow\u00bb. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f OAuth \u2014 \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0439\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b\u0438, \u0436\u043c\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443, \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u0422\u0430\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u044e\u0447\u0435\u0439 (Client Id, Client Secret, Key). \u0418\u0437 \u043d\u0438\u0445 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e ClientId \u0438 Key. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0445 \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h5>2. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0447\u0438\u0441\u0442\u044b\u0439 HTML \u0444\u0430\u0439\u043b \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0432 \u043d\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442:  <\/p>\n<pre><code class=\"html\">&lt;script type='text\/javascript' src='https:\/\/api.stackexchange.com\/js\/2.0\/all.js'&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u043e\u043c\u0438\u043c\u043e key \u0438 clientId, \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:  <\/p>\n<pre><code class=\"javascript\">SE.init({ \tclientId: 1, \/\/ \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u0442\u0430\u0432\u0438\u043c \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c clientId \tkey: 'YoUrAweSomeKey', \/\/ \u0410 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e key \tchannelUrl: 'http:\/\/example.com\/', \/\/ \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u044e. \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \tcomplete: function (data) { alert(&quot;\u042f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f!&quot;); } \/\/ \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 }); <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0435\u0440\u043d\u043e, \u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u0442\u044c alert \ud83d\ude42 \u0418\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u2014 \u043d\u0435\u0442 \u043b\u0438 \u0442\u0430\u043c \u0447\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043d\u0430 <u>Uncaught channelUrl must be under the current domain <\/u>? \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u2014 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 channelUrl. \u0418\u043d\u0430\u0447\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<h5>3. \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h5>\n<p>  \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 auth(data) \u0438 \u0443\u043a\u0430\u0436\u0435\u043c \u0435\u0435 \u0432 SE.init \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"javascript\">function auth(data) {} ... SE.init({ \t... \tcomplete: auth }); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e. \u0417\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e:  <\/p>\n<pre><code class=\"javascript\">SE.authenticate({     success: function(data) { alert('\u042f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f!'); }, \/\/ \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     error: function(data) {  alert('\u042f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f :('); }, \/\/ \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f });  <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u044f \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b \u0432 \u0442\u0435\u043b\u043e <b>auth(data)<\/b>. \u0422\u0435\u043f\u0435\u0440\u044c, \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e. \u0412 \u043d\u0435\u043c \u0432\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u044b \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u2014 \u043d\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f13\/448\/709\/f13448709920a84c0913e44dbffdfd89.png\"\/><\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u043a\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0410 \u0432\u0435\u0434\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 \u043d\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0434\u0430\u043d\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u0445 \u0433\u0434\u0435-\u043d\u0438\u0431\u0443\u0434\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a \u2014 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b:  <\/p>\n<pre><code class=\"javascript\">var tokens = null; ... SE.authenticate({     success: function(data) { alert('\u042f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f!'); tokens = data; },      ... ... <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 API.<\/p>\n<h5>4. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u044f<\/h5>\n<p>  API \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c JS, \u043b\u0435\u0433\u043a\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043a\u0440\u043e\u0441\u0441-\u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435, \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c jQuery.<br \/>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c:  <\/p>\n<pre><code class=\"javascript\">https:\/\/api.stackexchange.com\/2.2\/me?site=[\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u0430] <\/code><\/pre>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u043a\u0438) \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u0441\u0435\u0442\u0438 Stack Exchange \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044c. \u0414\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0441 StackOverflow \u0438 \u0441 MathOverflow, \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041e\u043a\u0435\u0439. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e json&#8217;a:  <\/p>\n<pre><code class=\"javascript\">{&quot;error_id&quot;:401,&quot;error_message&quot;:&quot;This method requires an access_token&quot;,&quot;error_name&quot;:&quot;access_token_required&quot;} <\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0442\u0443\u0442: <a href=\"http:\/\/api.stackexchange.com\/docs\/error-handling\">api.stackexchange.com\/docs\/error-handling<\/a><\/p><\/blockquote>\n<p>  \u0410 \u0432\u0435\u0434\u044c \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430! \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0432\u044b\u0448\u0435 \u043c\u044b \u043f\u0440\u0438\u0446\u0435\u043f\u0438\u043c \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b:  <\/p>\n<pre><code class=\"javascript\">https:\/\/api.stackexchange.com\/2.2\/me?site=[\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u0430]&key=[\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f key]&access_token=[tokens.accessToken]&callback=[method] <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c tokens.accessToken \u043a\u0430\u043a \u0440\u0430\u0437 \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u044e\u0447 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 method \u2014 \u043a\u043e\u043b\u0431\u044d\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0432 \u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041e\u0442\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"javascript\">{     &quot;items&quot;: [         {             &quot;badge_counts&quot;: {                 &quot;bronze&quot;: 5,                 &quot;silver&quot;: 0,                 &quot;gold&quot;: 0             },             &quot;account_id&quot;: 2760756,             &quot;is_employee&quot;: false,             &quot;last_modified_date&quot;: 1396214504,             &quot;last_access_date&quot;: 1396268249,             &quot;reputation_change_year&quot;: 62,             &quot;reputation_change_quarter&quot;: 62,             &quot;reputation_change_month&quot;: 62,             &quot;reputation_change_week&quot;: 55,             &quot;reputation_change_day&quot;: 10,             &quot;reputation&quot;: 63,             &quot;creation_date&quot;: 1368447422,             &quot;user_type&quot;: &quot;registered&quot;,             &quot;user_id&quot;: 2377708,             &quot;age&quot;: 18,             &quot;location&quot;: &quot;Belarus&quot;,             &quot;link&quot;: &quot;http:\/\/stackoverflow.com\/users\/2377708\/alex-saskevich&quot;,             &quot;display_name&quot;: &quot;Alex Saskevich&quot;,             &quot;profile_image&quot;: &quot;http:\/\/i.stack.imgur.com\/0Vz5q.jpg?s=128&g=1&quot;         }     ],     &quot;has_more&quot;: false,     &quot;quota_max&quot;: 10000,     &quot;quota_remaining&quot;: 9905 } <\/code><\/pre>\n<p>  \u0421 \u0442\u0430\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u044f \u0441\u043e\u0437\u0434\u0430\u043c callback \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443:   <\/p>\n<pre><code class=\"javascript\">function renderProfileData(data) { \tvar items = data.items[0]; \t$(&quot;#reputation&quot;).text(items.reputation); \t$(&quot;#login&quot;).text(items.display_name); \t$(&quot;#bronze_badges&quot;).text(items.badge_counts.bronze); \t$(&quot;#silver_badges&quot;).text(items.badge_counts.silver); \t$(&quot;#gold_badges&quot;).text(items.badge_counts.gold); \t$(&quot;#profile_image&quot;).attr(&quot;src&quot;, items.profile_image); } <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u0447\u0435\u0440\u0435\u0437 GET \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\">$.get(&quot;https:\/\/api.stackexchange.com\/2.2\/me?site=stackoverflow&key=YoUrAwEsOmEKey&access_token=YoUrSecretToKEn&callback=profile&quot;); <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/687\/aa6\/b74\/687aa6b74036bf07e26f55bde783b56e.png\"\/><\/p>\n<h5>5. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0433\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0435\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u0445, \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u044d\u0442\u043e <u>read_inbox<\/u>. \u0421\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0431\u043b\u043e\u043a\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"javascript\">SE.authenticate({     scope: ['read_inbox'],     ... }); <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u0445 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u043e\u0442 \u0442\u0443\u0442:  <\/p>\n<pre><code class=\"javascript\">https:\/\/api.stackexchange.com\/\/2.2\/notifications?pagesize=[\u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439]&key=[\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f]&access_token=[\u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f]&callback=[callback-\u043c\u0435\u0442\u043e\u0434] <\/code><\/pre>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. \u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u043e\u0442\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"javascript\">{     &quot;items&quot;: [             &quot;site&quot;: {                 &quot;styling&quot;: {                     &quot;tag_background_color&quot;: &quot;#FFF&quot;,                     &quot;tag_foreground_color&quot;: &quot;#000&quot;,                     &quot;link_color&quot;: &quot;#0077CC&quot;                 },                 &quot;related_sites&quot;: [                     {                         &quot;relation&quot;: &quot;meta&quot;,                         &quot;api_site_parameter&quot;: &quot;meta.reverseengineering&quot;,                         &quot;site_url&quot;: &quot;http:\/\/meta.reverseengineering.stackexchange.com&quot;,                         &quot;name&quot;: &quot;Reverse Engineering Meta Stack Exchange&quot;                     },                     {                         &quot;relation&quot;: &quot;chat&quot;,                         &quot;site_url&quot;: &quot;http:\/\/chat.stackexchange.com&quot;,                         &quot;name&quot;: &quot;Chat Stack Exchange&quot;                     }                 ],                 &quot;open_beta_date&quot;: 1364774400,                 &quot;closed_beta_date&quot;: 1363651200,                 &quot;site_state&quot;: &quot;open_beta&quot;,                 &quot;twitter_account&quot;: &quot;StackReverseEng&quot;,                 &quot;favicon_url&quot;: &quot;http:\/\/cdn.sstatic.net\/reverseengineering\/img\/favicon.ico&quot;,                 &quot;icon_url&quot;: &quot;http:\/\/cdn.sstatic.net\/reverseengineering\/img\/apple-touch-icon.png&quot;,                 &quot;audience&quot;: &quot;researchers and developers who explore the principles of a system through analysis of its structure, function, and operation&quot;,                 &quot;site_url&quot;: &quot;http:\/\/reverseengineering.stackexchange.com&quot;,                 &quot;api_site_parameter&quot;: &quot;reverseengineering&quot;,                 &quot;logo_url&quot;: &quot;http:\/\/cdn.sstatic.net\/reverseengineering\/img\/logo.png&quot;,                 &quot;name&quot;: &quot;Reverse Engineering&quot;,                 &quot;site_type&quot;: &quot;main_site&quot;             },             &quot;is_unread&quot;: false,             &quot;creation_date&quot;: 1396197666,             &quot;notification_type&quot;: &quot;badge_earned&quot;,             &quot;body&quot;: &quot;You&#39;ve earned the &quot;Autobiographer&quot; badge.&quot;         }     ],     &quot;has_more&quot;: true,     &quot;quota_max&quot;: 10000,     &quot;quota_remaining&quot;: 9994 } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439. \u0418 \u0441 \u043d\u0438\u043c\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"javascript\">function renderNotifications(data) { \tvar items = data.items; \tvar html = &quot;&lt;center&gt;\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f&lt;\/center&gt;&lt;br\/&gt;&quot;; \tfor (var i = 0; i &lt; items.length; i ++) \t{ \t\tvar site = items[i].site.name; \t\tvar icon = items[i].site.icon_url; \t\tvar body = items[i].body; \t\tvar str = &quot;&lt;div class = 'item'&gt;&lt;img src = '&quot; + icon + &quot;' height = '14px' \/&gt;&nbsp;&quot; + site + &quot;:&nbsp;&quot; + body + &quot;&lt;\/div&gt;&quot;; \t\thtml += str; \t} \t$(&quot;#notifications&quot;).html(html); } <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 \u043c\u043e\u0435\u0433\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/fff\/f2a\/096\/ffff2a096c4e34e9d927f65f026284db.png\"\/><\/p>\n<h5>6. \u0418 \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c?<\/h5>\n<p>  API \u0441\u0435\u0442\u0438 Stack Exchange \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0442\u0435\u0433\u0438, \u043f\u0440\u0438\u0447\u0435\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 (\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438). \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438 \u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u2014 \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432. \u0418 \u0434\u0430, \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u0434\u0435\u0441\u044f\u0442\u044c\u044e \u0442\u044b\u0441\u044f\u0447\u0430\u043c\u0438. \u041e\u0441\u0442\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 JSON \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u0432 \u043f\u043e\u043b\u0435 <u>\u00abquota_remaining\u00bb<\/u>.<\/p>\n<p>  \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e StackExchange \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0434 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:  <\/p>\n<ul>\n<li>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f: <a href=\"https:\/\/api.stackexchange.com\/docs\">api.stackexchange.com\/docs<\/a><\/li>\n<li>\u041f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438: <a href=\"http:\/\/stackapps.com\/apps\/oauth\">stackapps.com\/apps\/oauth<\/a><\/li>\n<li>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438: <a href=\"http:\/\/jsfiddle.net\/asaskevich\/6F5kd\/embedded\/result\/\">jsfiddle.net\/asaskevich\/6F5kd\/embedded\/result\/<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/217753\/\"> http:\/\/habrahabr.ru\/post\/217753\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c35\/32f\/d5c\/c3532fd5c505622e563305c3c197851d.png\"\/><br \/>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441 \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c. \u041c\u043d\u043e\u0433\u0438\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0432\u043e\u0435 API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0432\u043e\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API. \u041f\u043e\u0442\u043e\u043c\u0443 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 API \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Stack Exchange API.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-217753","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/217753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=217753"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/217753\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}