API REFERENCE GUIDE

utilities  qr

api description

purpose

qr returns a QR code either as HTML data in the context of standard API response or as PNG picture as a direct response (see optional parameter out below).

http method: GET

call cost: 1 point

See the pricing section for more details.

mandatory parameter(s)

parameter values / comments
api"qr"
key E.g. "c54e7837e0cd0ced286cb5995327d1ab54e35987179b2". It is an application key generated by AuverCloud Studio.
uri The text to QR-code. As the method is GET, in order to support any text, this parameter needs to be Base64 encoded using base64_encode() for PHP or window.btoa()for JavaScript e.g. "aHR0cHM6Ly93d3cuYXV2ZXJjbG91ZC5jb20=". See also crypto-js for old browsers.

optional parameters(s)

parameter values / comments
outputThis parameter defines the response format. It supports two values:
  • "json" returns a standard API response where the data is an HTML fragment composed of 0 and 1 e.g.
    <div class='qr'>
      <span class='pixel1'>1</span><span class='pixel0'>0</span>..<span class='pixel1'>1</span>
      <br>
      ..
      <br>
      <span class='pixel1'>1</span><span class='pixel0'>0</span>..<span class='pixel1'>1</span>
    </div>
    
  • "png" is the default value. In that case the response is not a JSON object but a PNG picture. See the GET example below.

call sample

This example is the code used in the test case below. It assumes that jQuery and the JavaScript AuverCloud runtime client are loaded in order to use the arc.api() method. See the API client section for more details.


								

In the following URL, the parameter output is omitted then the response is a PNG file:

errors

No specific errors.

See also the Common errors section.

test bed

Call

To test the API with your own keys, please see the section Application keys in AuverCloud Studio.

api
qr
key
uri
output
 send
request
 clear
response
Response
code
msg
data

discussion