|
207 | 207 | <p>Please be advised that clients should use the header field variant if at all possible.</p> |
208 | 208 | <p>If the key is missing or invalid, OctoPrint will treat the request as it would any unauthenticated anonymous request to the endpoint. |
209 | 209 | 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> |
210 | | -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> |
| 210 | +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> |
211 | 211 | <div class="admonition warning"> |
212 | 212 | <p class="admonition-title">Warning</p> |
213 | 213 | <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 |
|
324 | 324 | <p>Can be used in one of two ways: to login a user via username and password and create a persistent session (usually |
325 | 325 | from a UI in the browser), or to retrieve information about the active user (from an existing session or an API key) |
326 | 326 | via the <code class="docutils literal notranslate"><span class="pre">passive</span></code> flag.</p> |
327 | | -<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 |
328 | | -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 |
| 327 | +<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 |
| 328 | +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 |
329 | 329 | case of a username/password mismatch, unknown user or a deactivated account.</p> |
330 | 330 | <div class="admonition warning"> |
331 | 331 | <p class="admonition-title">Warning</p> |
332 | | -<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 |
| 332 | +<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 |
333 | 333 | mismatch or an unknown user. That was incompatible with basic authentication since it was a wrong use of |
334 | | -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> |
| 334 | +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> |
335 | 335 | </div> |
336 | 336 | <div class="admonition note"> |
337 | 337 | <p class="admonition-title">Note</p> |
|
351 | 351 | </dd> |
352 | 352 | <dt class="field-even">Status Codes<span class="colon">:</span></dt> |
353 | 353 | <dd class="field-even"><ul class="simple"> |
354 | | -<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> |
355 | | -<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> |
| 354 | +<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> |
| 355 | +<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> |
356 | 356 | </ul> |
357 | 357 | </dd> |
358 | 358 | </dl> |
|
366 | 366 | <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> |
367 | 367 | <dd><p>Ends the current login session of the current user.</p> |
368 | 368 | <p>Only makes sense in the context of browser based workflows.</p> |
369 | | -<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> |
| 369 | +<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> |
370 | 370 | <dl class="field-list simple"> |
371 | 371 | <dt class="field-odd">Status Codes<span class="colon">:</span></dt> |
372 | 372 | <dd class="field-odd"><ul class="simple"> |
373 | | -<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> |
| 373 | +<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> |
374 | 374 | </ul> |
375 | 375 | </dd> |
376 | 376 | </dl> |
|
383 | 383 | <dt class="sig sig-object http" id="get--api-currentuser"> |
384 | 384 | <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> |
385 | 385 | <dd><p>Retrieves information about the current user.</p> |
386 | | -<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> |
| 386 | +<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> |
387 | 387 | as body.</p> |
388 | 388 | <dl class="field-list simple"> |
389 | 389 | <dt class="field-odd">Status Codes<span class="colon">:</span></dt> |
390 | 390 | <dd class="field-odd"><ul class="simple"> |
391 | | -<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> |
| 391 | +<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> |
392 | 392 | </ul> |
393 | 393 | </dd> |
394 | 394 | </dl> |
|
0 commit comments