Protocols/WebAPI/Auth/Client/getCaptcha: Difference between revisions

From NINA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 26: Line 26:


== Response Format ==
== Response Format ==
Response will be either image or audio content based on the requested format. Standard HTTP status codes will be used to indicate errors.
Response will be either image or audio content based on the requested format. Standard HTTP status codes will be used to indicate errors.
 
* HTTP Response Codes
'''HTTP Response Codes'''
* 200 - Success (OK)
* 200 - Success (Ok)
* 302 - Redirect to SSL
* 302 - Redirect to SSL
* 400 - Bad Request (invalid context)
* 400 - Bad Request (invalid context)

Revision as of 18:16, 25 March 2020

WebAPI Protocol
Basic
Introduction
Clients
Whimsicals
Host Interaction
Flow
Authentication
Client
WebApp
Other Services
Foodgroups

This page is about the getCaptcha method for WebAPI authentication.

This method can be used to obtain a Captcha Image or Audio file for a given authentication context. The Captcha Image or Audio files are generally required to challenge the user upon receiving a Captcha Challenge from "directLogin" method.

Initial Request

  • URL
  • HTTP Method
    • GET
  • Arguments
    • devId (required)
      • your developer id required to access NINA APIs
    • f (optional)
      • the required format of the response
      • Supported formats:
        • image (Content-Type: image/jpeg) (default)
        • audio (Content-Type: audio/mpeg)
    • language (optional)
      • the required language and locale of the error/status messages. This is always in "<lang>-<locale>" format. The lang is the 2 letter language code for I18N (default: en) and the locale is the 2 letter Locale code for I18N (default: us). If not passed in, the language will be extracted from HTTP header (Accept-Language) and if that is not available will default to "en-us".
    • context (required)
      • Authentication Context returned in previous directLogin request when additional challenges are required

Response Format

Response will be either image or audio content based on the requested format. Standard HTTP status codes will be used to indicate errors.

  • HTTP Response Codes
  • 200 - Success (OK)
  • 302 - Redirect to SSL
  • 400 - Bad Request (invalid context)
  • 415 - Unsupported Media Type
  • 500 - Internal Server Error
  • 503 - Service Unavailable