taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

post-private-otp-devices.rst (1726B)


      1 .. http:post:: [/instances/$INSTANCE]/private/otp-devices
      2 
      3   This is used to associate an OTP device with an instance.
      4 
      5   **Required permission:** ``otp-devices-write``
      6 
      7   **Request:**
      8 
      9   The request must be a `OtpDeviceAddDetails`.
     10 
     11   **Response:**
     12 
     13   :http:statuscode:`204 No content`:
     14     The creation of the template is successful.
     15   :http:statuscode:`400 Bad Request`:
     16     The request body is malformed.
     17   :http:statuscode:`404 Not found`:
     18     The merchant instance is unknown or it is not in our data.
     19   :http:statuscode:`409 Conflict`:
     20     An OTP device with this ID already exists with different details.
     21   :http:statuscode:`500 Internal Server Error`:
     22     The server experienced an internal failure.
     23     Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED``.
     24 
     25   **Details:**
     26 
     27   .. ts:def:: OtpDeviceAddDetails
     28 
     29     interface OtpDeviceAddDetails {
     30 
     31       // Device ID to use.
     32       otp_device_id: string;
     33 
     34       // Human-readable description for the device.
     35       otp_device_description: string;
     36 
     37       // A key encoded with RFC 3548 Base32.
     38       // IMPORTANT: This is not using the typical
     39       // Taler base32-crockford encoding.
     40       // Instead it uses the RFC 3548 encoding to
     41       // be compatible with the TOTP standard.
     42       otp_key: string;
     43 
     44       // Algorithm for computing the POS confirmation.
     45       // "NONE" or 0: No algorithm (no pos confirmation will be generated)
     46       // "TOTP_WITHOUT_PRICE" or 1: Without amounts (typical OTP device)
     47       // "TOTP_WITH_PRICE" or 2: With amounts (special-purpose OTP device)
     48       // The "string" variants are supported @since protocol **v7**.
     49       otp_algorithm: Integer | string;
     50 
     51       // Counter for counter-based OTP devices.
     52       otp_ctr?: Integer;
     53     }