Log in:

Login

getHitCount

Gets the number of hits for a given code.

Arguments

  • API-KEY (Required) : Your API application key. See here for more details.
  • code (Optional) : The code to get hits from.
  • timespanFrom (Optional) : Only returns hits after this UNIX Timestamp.
  • timespanTo (Optional) : Only returns hits before this UNIX Timestamp.

Returns

  • array : [ int CODE => array ['sms' => int HITS, 'mobile' => int HITS, ... ] ].

Example Request (HTTP GET)

http://decode.kaywa.com/api/gethitCount?API-KEY=your_api_key_here&code=2029998765

Example Response

{"2029998765":{"mobile":1}}

for each code, the source of the hits is returned. Source can be either of:

  • api : generated when a code is decode via the decodeCode method of this API
  • mobile : generated when a user decodes a code via the QR Code reader (e.g. http://decode.kaywa.com/1234567)
  • sms : generated when a user decodes a code via the SMS interface (e.g. by sending 'QR 1234567' to 202)

Error Codes

  • 1 : DECODE_APIERROR_INVALID_CODE - The code passed was invalid.
  • 2 : DECODE_APIERROR_INVALID_RANGE - The range of timestamp passed was invalid.
  • 5 : DECODE_APIERROR_ARGUMENTS_ERROR - Arguments passed was invalid.
  • 6 : DECODE_APIERROR_NOT_AUTHORISED - Customer not authorized to get hits.
If either timespanFrom and timespanTo are not given, they will default to 0 (Jan 1st, 1970) and the current timestamp, respectively.
KAYWA // TECHNOPARKSTRASSE 1 // 8005 ZUERICH // SWITZERLAND // info@kaywa.com