Settings
This is a sample JSON settings file. See description below. To apply the settings, encode the JSON document into a QR code and scan by app to apply your settings.
You can use any online QR generator, such as simple qr-code-generator
#
Settings format{ "app" : "scan2check.com", "settings" : { "apiUrl" : "https://3f3e6f3259e8.ngrok.io/scanner/", "method" : "POST", "soundFailed" : "doubleBeep2", "soundSuccess" : "beep2", "symbols" : [ "qr", "ean13" ], "formData" : "", "apiTimeout" : 5000, "headers" : { "X-API-KEY" : "123456", "X-CUSTOM-VALUE" : "789101112" }, "autoScanTimeout" : -1 }}
- app - must be equal scan2check.com, so app knows the scanned QR code is a settings QR code
- settings - these are the app settings
- autoScanTimeout = if ok/failed status screen is shown, it is possible to configure if and when
the scanner should auto start. Possible values are:
- -1 - disabled (user need to tap the scan button to launch scanner),
- 0 - means immidiate return to scanner, after the confirmation sound ends playing
- 800 - time in ms, means the scanner will auto-launch after 0.8s
- apiTimeout - if API does not respond within specified value (ms), application displays error
- apiUrl - is the API endpoint URL, to which the scanned value is sent
- formData - if custom form data needs to be collected with a code scan, this key defines the form
- headers - is an object with any custom headers you want the application adds to the API request
- method - currently only POST is supported (GET comming soon)
- soundFailed: id of sound that is played, when "failed" API response is received available sound ids are: ['beep1','beep2','doubleBeep1','doubleBeep2']
- soundSuccess: id of sound that is played, when "success" API response is received available sound ids are: ['beep1','beep2','doubleBeep1','doubleBeep2']
- symbols: list of supported symbols. You can include only the symbols you want to recognize, so other symbols/codes are ignored. This is the complete list of symbols the application supports: [ 'code39', 'code93', 'code128', 'ean8', 'ean13', 'pdf417', 'qr', 'upce', 'datamatrix' ]
- autoScanTimeout = if ok/failed status screen is shown, it is possible to configure if and when
the scanner should auto start. Possible values are:
#
Updating a settingTo update a specific setting, include it in the settings key, example:
{ "app" : "scan2check.com", "settings" : { "apiUrl" : "https://some.other.url" }}
This will not remove any other previously stored setting.
#
Removing a settingTo remove a previously set setting, set it again with an empty string:
{ "app" : "scan2check.com", "settings" : { "formData" : "" }}
This above example removes the formData setting (no form is shown after a code is scanned)