Skip to content

Capture Signature

METHOD NAME captureSignature

This method is Cancelable.

Requires state IDLE and during process moves to PROMPT

Description

Prompt the user to sign on the screen. This request responds once the user finishes signing, cancels the operation, or the specified timeout expires. On completion, the captured signature is returned encoded in the requested mimeType.

Parameters

object

  • commandId string REQUIRED
    Id that is used as a reference to cancel the command

  • mimeType string REQUIRED
    The image format the captured signature is returned in. Supported values: image/png, image/svg+xml.

  • title string
    The title at the top of the screen is displayed to the user

  • body string
    The message body on the screen displayed to the user

  • timeout int
    Time in seconds until a response with a TIMEOUT result is returned.
    Default: 60 seconds. The value must be greater than zero

  • cancelable boolean
    A flag indicates if the user can cancel the operation from the signature screen. Default true

Result

object on when a request is valid and the signature screen prompted on the device.

  • commandId string
    Echo back the id from the request

  • result Result
    Possible results are: OK, CANCELED, TIMEOUT, GENERAL_ERROR
    (1) Show values

    1. Result

      Result of new request. Each command has possible values in the field.

      • OK Request is ok
      • GENERAL_ERROR An error occurred
      • CANCELED Command was canceled either by the user (on-screen) or through cancel command.
      • TIMEOUT Operation was timed out.
      • NETWORK_ERROR No internet connection is available.
      • HOST_ERROR Host returned an error regarding the request.
      • SMART_READER_ERROR An error occurred with the smart-reader
      • SMART_CARD_ERROR An error occurred with the smart card, or the reader couldn't communicate with the card.
      • NONE_CREDIT_CARD Industrial card was detected when performing a transaction.
      • CARD_NOT_ALLOWED When the detected card is not allowed to be processed
  • mimeType string
    The image format of the returned signature. This value is populated if the result is OK.

  • encoding string
    The encoding used for the signature field. Currently always base64. This value is populated if the result is OK.

  • signature string
    The captured signature image, encoded as base64 in the requested mimeType. This value is populated if the result is OK.

Errors

  • MissingParams
  • InvalidParams
  • IllegalState

Example

example
example
Signature Output

Request

{
    "jsonrpc": "2.0",
    "method": "captureSignature",
    "id": "01234",
    "params": {
        "commandId": "abcdef",
        "mimeType": "image/png",
        "title": "Please Sign Below",
        "body": "Agree to the terms and conditions",
        "cancelable": false,
        "timeout": 30
    }
}

Response

{
    "jsonrpc": "2.0",
    "id": "01234",
    "result": {
        "commandId": "abcdef",
        "encoding": "base64",
        "mimeType": "image/png",
        "result": "OK",
        "signature": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAEsCAYAAAAb/mBaAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAQjSURBVHic7dwxa1NRGAbgt3XpZl26tuBe3LWzIggu7gr2R7i5dRDEX+GuIDg46CwUUTdFJ4fqUqmolbZxSIRa28ST3Nybe/s8cJbkfOQ9Q/g4uScnAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgJq0nOUjSOzT2B68DAFOwmb8b79Gx2Vw0AOim9Qxvvn+GnTDMqLmmAwBj6RXM9T2HGTTfdAAAOI00YABogAYMzdnIvyeYe4PXh7k95VwA0FlbGX54amtI7Z0RtUcHMIPsgKF+G0mWRsxZSnL/hPe+FXzWi4K5ANBpk+xeV5PsFtSvTG8ZANAuJQ34xqG6tRz/zPik8W76SwGA9ihpwB8HNYtJ9grq9utZCgC0R0kDPhjUvC2su1zPUoBxuSEH6ld6MvlrkrMF83eTLBR+BlCzM00HgFNoIcmlwvklriV5X1gDAKdCyfPckvG4zkUAQBv9SrXN90m98QGgnRaTfE81zfdLzdkBoPWeZfIGvFp7agDogKspu2Tj8PjcQF4A6IzlJD9S1nz3Y/cLAJUoueu5l2Qnyc0mggJAl1zMeD9FHyR52EBeAOiMlxn/QNZ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