taler-docs

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

patch-private-otp-devices-DEVICE_ID.rst (1462B)


      1 .. http:patch:: [/instances/$INSTANCE]/private/otp-devices/$DEVICE_ID
      2 
      3   This is used to update an OTP device. It is useful when we need to change information in the OTP device or when we have mistake some information.
      4 
      5   **Required permission:** ``otp-devices-write``
      6 
      7   **Request:**
      8 
      9   The request must be a `OtpDevicePatchDetails`.
     10 
     11   **Response:**
     12 
     13   :http:statuscode:`204 No content`:
     14     The template has successfully modified.
     15   :http:statuscode:`400 Bad Request`:
     16     The request body is malformed.
     17   :http:statuscode:`404 Not found`:
     18     The OTP device(ID) is unknown to the backend.
     19     Returned with ``TALER_EC_MERCHANT_GENERIC_OTP_DEVICE_UNKNOWN``.
     20   :http:statuscode:`500 Internal Server Error`:
     21     The server experienced an internal failure.
     22     Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED`` or
     23     ``TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE``.
     24 
     25   **Details:**
     26 
     27   .. ts:def:: OtpDevicePatchDetails
     28 
     29    interface OtpDevicePatchDetails {
     30 
     31      // Human-readable description for the device.
     32      otp_device_description: string;
     33 
     34      // A key encoded with RFC 3548 Base32.
     35      // IMPORTANT: This is not using the typical
     36      // Taler base32-crockford encoding.
     37      // Instead it uses the RFC 3548 encoding to
     38      // be compatible with the TOTP standard.
     39      otp_key?: string;
     40 
     41      // Algorithm for computing the POS confirmation.
     42      otp_algorithm: Integer;
     43 
     44      // Counter for counter-based OTP devices.
     45      otp_ctr?: Integer;
     46    }