<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK:GLPI_API]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16607&amp;type=atom" />
	<updated>2021-09-23T11:08:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16607</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GLPI_API]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=149650#p149650" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong></p><p>Может необходимо добавить параметр &quot;App-Token&quot;, только не могу понять куда</p><p>разобрался, </p><div class="codebox"><pre><code>HTTP.SetRequestHeader(&quot;App-Token&quot;, token)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2021-09-23T11:08:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=149650#p149650</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GLPI_API]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=149645#p149645" />
			<content type="html"><![CDATA[<p>Вы предлагаете, чтобы пользователи форума устанавливали вебсервер с этой программой и тестировали, почему у вас не удается подключиться?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-09-23T10:52:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=149645#p149645</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:GLPI_API]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=149641#p149641" />
			<content type="html"><![CDATA[<p>Добрый день! Подскажите пож-та, не могу начать сессию.<br />https://github.com/glpi-project/glpi/blob/9.5/bugfixes/apirest.md - документация по API</p><div class="codebox"><pre><code>
$ curl -X GET \
-H &#039;Content-Type: application/json&#039; \
-H &quot;Authorization: Basic Z2xwaTpnbHBp&quot; \
-H &quot;App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7&quot; \
&#039;http://path/to/glpi/apirest.php/initSession&#039;

&lt; 200 OK
&lt; {
   &quot;session_token&quot;: &quot;83af7e620c83a50a18d3eac2f6ed05a3ca0bea62&quot;
}

$ curl -X GET \
-H &#039;Content-Type: application/json&#039; \
-H &quot;Authorization: user_token q56hqkniwot8wntb3z1qarka5atf365taaa2uyjrn&quot; \
-H &quot;App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7&quot; \
&#039;http://path/to/glpi/apirest.php/initSession?get_full_session=true&#039;

&lt; 200 OK
&lt; {
   &quot;session_token&quot;: &quot;83af7e620c83a50a18d3eac2f6ed05a3ca0bea62&quot;,
   &quot;session&quot;: {
      &#039;glpi_plugins&#039;: ...,
      &#039;glpicookietest&#039;: ...,
      &#039;glpicsrftokens&#039;: ...,
      ...
   }
}
</code></pre></div><br /><div class="codebox"><pre><code>
Api_key := &quot;EmXIgbOB37FvNwy12HBp3nUWiItSctLZKQq....&quot;

URL := &quot;http://10.224....&quot;

HTTP := ComObjCreate(&quot;WinHTTP.WinHttpRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, URL . &quot;/glpi/apirest.php/initSession&quot;, false)
HTTP.SetProxy(2, URL)
HTTP.SetRequestHeader(&quot;Content-Type&quot;, &quot;application/json; charset=UTF-8&quot;)
HTTP.SetRequestHeader(&quot;Authorization&quot;, &quot;user_token &quot; . Api_key) ;получаю ошибку 500

;HTTP.SetRequestHeader(&quot;Authorization&quot;, &quot;Basic c21pcm5vdmFhOkluc2V...&quot;) ;получаю ошибку 401, ( сгенерировал тут &quot;http://base64.ru&quot; как - логин:пароль

HTTP.SetRequestHeader(&quot;User-Agent&quot;, &quot;Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36&quot;)

HTTP.Send()
HTTP.WaitForResponse()

MsgBox % HTTP.Status
MsgBox % HTTP.ResponseText
ExitApp

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2021-09-23T09:57:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=149641#p149641</id>
		</entry>
</feed>
