taler-docs

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

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


      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     Returned with ``TALER_EC_MERCHANT_PRIVATE_POST_OTP_DEVICES_CONFLICT_OTP_DEVICE_EXISTS``.
     22   :http:statuscode:`413 Request entity too large`:
     23     The uploaded body is to long, it exceeds the size limit.
     24     Returned with an error code of
     25     ``TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT``.
     26   :http:statuscode:`500 Internal Server Error`:
     27     The server experienced an internal failure.
     28     Returned with ``TALER_EC_GENERIC_DB_START_FAILED``,
     29     ``TALER_EC_GENERIC_DB_FETCH_FAILED``,
     30     ``TALER_EC_GENERIC_DB_SOFT_FAILURE`` or
     31     ``TALER_EC_GENERIC_DB_COMMIT_FAILED``.
     32 
     33   **Details:**
     34 
     35   .. ts:def:: OtpDeviceAddDetails
     36 
     37     interface OtpDeviceAddDetails {
     38 
     39       // Device ID to use.
     40       otp_device_id: string;
     41 
     42       // Human-readable description for the device.
     43       otp_device_description: string;
     44 
     45       // A key encoded with RFC 3548 Base32.
     46       // IMPORTANT: This is not using the typical
     47       // Taler base32-crockford encoding.
     48       // Instead it uses the RFC 3548 encoding to
     49       // be compatible with the TOTP standard.
     50       otp_key: string;
     51 
     52       // Algorithm for computing the POS confirmation.
     53       // "NONE" or 0: No algorithm (no pos confirmation will be generated)
     54       // "TOTP_WITHOUT_PRICE" or 1: Without amounts (typical OTP device)
     55       // "TOTP_WITH_PRICE" or 2: With amounts (special-purpose OTP device)
     56       // The "string" variants are supported @since protocol **v7**.
     57       otp_algorithm: Integer | string;
     58 
     59       // Counter for counter-based OTP devices.
     60       otp_ctr?: Integer;
     61     }