|
212 | 212 | <p>Please be advised that clients should use the header field variant if at all possible.</p> |
213 | 213 | <p>If the key is missing or invalid, OctoPrint will treat the request as it would any unauthenticated anonymous request to the endpoint. |
214 | 214 | That means that any requests without or with an invalid API key targeting other API endpoints than <a class="reference internal" href="#sec-api-general-login"><span class="std std-ref">Login</span></a> |
215 | | -will be denied with a <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">403 Forbidden</a>.</p> |
| 215 | +will be denied with a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403">403 Forbidden</a>.</p> |
216 | 216 | <div class="admonition warning"> |
217 | 217 | <p class="admonition-title">Warning</p> |
218 | 218 | <p>If <a class="reference internal" href="../features/accesscontrol.html#sec-features-access-control"><span class="std std-ref">Access Control</span></a> is disabled, OctoPrint will treat any unauthenticated anonymous requests and thus also requests |
|
329 | 329 | <p>Can be used in one of two ways: to login a user via username and password and create a persistent session (usually |
330 | 330 | from a UI in the browser), or to retrieve information about the active user (from an existing session or an API key) |
331 | 331 | via the <code class="docutils literal notranslate"><span class="pre">passive</span></code> flag.</p> |
332 | | -<p>Will return a <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> with a <a class="reference internal" href="#sec-api-general-datamodel-login"><span class="std std-ref">login response</span></a> on successful |
333 | | -login, whether active or passive. The active (username/password) login may also return a <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">403 Forbidden</a> in |
| 332 | +<p>Will return a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200">200 OK</a> with a <a class="reference internal" href="#sec-api-general-datamodel-login"><span class="std std-ref">login response</span></a> on successful |
| 333 | +login, whether active or passive. The active (username/password) login may also return a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403">403 Forbidden</a> in |
334 | 334 | case of a username/password mismatch, unknown user or a deactivated account.</p> |
335 | 335 | <div class="admonition warning"> |
336 | 336 | <p class="admonition-title">Warning</p> |
337 | | -<p>Previous versions of this API endpoint did return a <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">401 Unauthorized</a> in case of a username/password |
| 337 | +<p>Previous versions of this API endpoint did return a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401">401 Unauthorized</a> in case of a username/password |
338 | 338 | mismatch or an unknown user. That was incompatible with basic authentication since it was a wrong use of |
339 | | -the <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">401 Unauthorized</a> code and got therefore changed as part of a bug fix.</p> |
| 339 | +the <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401">401 Unauthorized</a> code and got therefore changed as part of a bug fix.</p> |
340 | 340 | </div> |
341 | 341 | <div class="admonition note"> |
342 | 342 | <p class="admonition-title">Note</p> |
|
356 | 356 | </dd> |
357 | 357 | <dt class="field-even">Status Codes<span class="colon">:</span></dt> |
358 | 358 | <dd class="field-even"><ul class="simple"> |
359 | | -<li><p><span><a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a></span> – Successful login</p></li> |
360 | | -<li><p><span><a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">403 Forbidden</a></span> – Username/password mismatch, unknown user or deactivated account</p></li> |
| 359 | +<li><p><span><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200">200 OK</a></span> – Successful login</p></li> |
| 360 | +<li><p><span><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403">403 Forbidden</a></span> – Username/password mismatch, unknown user or deactivated account</p></li> |
361 | 361 | </ul> |
362 | 362 | </dd> |
363 | 363 | </dl> |
|
371 | 371 | <span class="sig-name descname"><span class="pre">POST</span> </span><span class="sig-name descname"><span class="pre">/api/logout</span></span><a class="headerlink" href="#post--api-logout" title="Link to this definition"></a></dt> |
372 | 372 | <dd><p>Ends the current login session of the current user.</p> |
373 | 373 | <p>Only makes sense in the context of browser based workflows.</p> |
374 | | -<p>Will return a <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">204 No Content</a>.</p> |
| 374 | +<p>Will return a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204">204 No Content</a>.</p> |
375 | 375 | <dl class="field-list simple"> |
376 | 376 | <dt class="field-odd">Status Codes<span class="colon">:</span></dt> |
377 | 377 | <dd class="field-odd"><ul class="simple"> |
378 | | -<li><p><span><a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">204 No Content</a></span> – No error</p></li> |
| 378 | +<li><p><span><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204">204 No Content</a></span> – No error</p></li> |
379 | 379 | </ul> |
380 | 380 | </dd> |
381 | 381 | </dl> |
|
388 | 388 | <dt class="sig sig-object http" id="get--api-currentuser"> |
389 | 389 | <span class="sig-name descname"><span class="pre">GET</span> </span><span class="sig-name descname"><span class="pre">/api/currentuser</span></span><a class="headerlink" href="#get--api-currentuser" title="Link to this definition"></a></dt> |
390 | 390 | <dd><p>Retrieves information about the current user.</p> |
391 | | -<p>Will return a <a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> with a <a class="reference internal" href="#sec-api-general-datamodel-currentuser"><span class="std std-ref">current user object</span></a> |
| 391 | +<p>Will return a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200">200 OK</a> with a <a class="reference internal" href="#sec-api-general-datamodel-currentuser"><span class="std std-ref">current user object</span></a> |
392 | 392 | as body.</p> |
393 | 393 | <dl class="field-list simple"> |
394 | 394 | <dt class="field-odd">Status Codes<span class="colon">:</span></dt> |
395 | 395 | <dd class="field-odd"><ul class="simple"> |
396 | | -<li><p><span><a class="reference external" href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a></span> – No error</p></li> |
| 396 | +<li><p><span><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200">200 OK</a></span> – No error</p></li> |
397 | 397 | </ul> |
398 | 398 | </dd> |
399 | 399 | </dl> |
|
505 | 505 | <div class="rst-other-versions"> |
506 | 506 | <dl> |
507 | 507 | <dt>Tags</dt> |
508 | | - <dd><a href="https://docs.octoprint.org/en/1.11.6/api/general.html">1.11.6</a></dd> |
| 508 | + <dd><a href="https://docs.octoprint.org/en/1.11.7/api/general.html">1.11.7</a></dd> |
509 | 509 | <dd><a href="https://docs.octoprint.org/en/1.10.3/api/general.html">1.10.3</a></dd> |
510 | 510 | </dl> |
511 | 511 | <dl> |
|
0 commit comments