Home | vCards | Labels | API and Samples
Ayna QR Code -- API
This documents includes the API used to contact the Ayna QR Code service, to
generate QR Code matrix for printing and including on web pages.
API Options:
There are three types of QR codes that can be generated with Ayna service. The QR codes created enable the following actions
when the QR code is scanned:
- Visit a website
- Place a call to a phone number
- SMS a specific message to a number
Action API and examples
Visit a website
If you want to direct a user to visit a specific website, then use this API:
http://code.ayna.com/ac/?goto=http%3A%2F%2Fwww.ayna.com&type=URL
goto: What url you want the user directed to (Note: URL is fully qualified, (includes http://), and do not forget to urlencode goto in the overall API call)
type: URL (case insensitive)
size(optional): Size of QR image, 2 (Small),4 (Medium),6 (Large), 8(X-Large), default is
Medium
Place a call to a phone number
If you want a user to call a specific phone number, then use this API:
http://code.ayna.com/ac/?goto=%2B9611280416&type=PHONE
goto: Phone number to call (Note:Use fully qualified international phone numbering, to ensure
that anyone can scan and call the number, and do not forget to urlencode goto in the overall API call)
type: PHONE (case insensitive)
size(optional): Size of QR image, 2 (Small),4 (Medium),6 (Large), 8(X-Large), default is
Medium
SMS a specific message to a number
If you want a user to send a predefined text message to phone number, then use this API:
http://code.ayna.com/ac/?goto=%2B9611280416&type=SMS&text=MY ANSWER
goto: Phone number to send SMS to. (Note:Use fully qualified international phone numbering, to ensure
that anyone can scan and send SMS message,, and do not forget to urlencode goto in the overall API call)
type: SMS
text: The text you want to include in SMS message (Note: This is a handy short way to send
messages to SHORT CODES)
size(optional): Size of QR image, 2 (Small),4 (Medium),6 (Large), 8(X-Large), default is
Medium
Note
Type = SMS not fully functional. Also the functionality of sending SMS is very tied to the handset.
Controlling QR Images Sizes
You can control the size of the QR image using the size variable. Available sizes are 2 (Small),4 (Medium),6 (Large), 8(X-Large), default is
Medium
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&size=2
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&size=4
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&size=6
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&size=8
Muting the info text
In the event that you only need the QR code and not the info below it, you can send the mute=1 variable in the URL and that
will the info from showing
Changing color of QR
You can change the color of the "Black" part of the QR by providing the Foreground and background colors in HEX format in the URL api. the url should be in the form of
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&hex=710030
Control both foreground and background colors (purple and grey)
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&hex=710030&bhex=CECECE
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&hex=202020&bhex=FFF&bg_tran=on
And if you mute the information around the QR you get this
http://code.ayna.com/ac/?goto=http://www.ayna.com&type=URL&hex=205596&bhex=FFF&bg_tran=on&mute=1
Shorten URLS
You can shorten long urls by specifying short=on in the URL. These urls will be
shortened using the ayna.in service.
Error Correction
Whenever QR codes are displayed, errors are produced in the process fo scanning. This could be due to the printed on material,
light conditions for scanning etc.. You can control how much information you want to emmbed in the QR image to deal with the
errors related to later scanning. According to Wikipedia, QR Code error correction capacity is:
Error correction capacity
- Level L 7% of codewords can be restored.
- Level M 15% of codewords can be restored.
- Level Q 25% of codewords can be restored.
- Level H 30% of codewords can be restored.
We support only two modes (M and H). To enable error correction, set the correct API to M or H
We support two modes :
- [H] (High), which assumes that there is a lot of errors in the scanning, (not a high resolution camera, material,
ink, etc..) when you select this method, the QR code includes much information in it, so in the event of higher levels of error,
the QR reader can still figure out the action to take.
- [M] (Medium) which means that there is a normal acmount of erros in the scanning and we do nto require more information in the
printed code.
Comparison between High and Medium error correction for same URL type QR Code |
1. Error Correction HIGH | 2. Error Correction MEDIUM |
API: &correct=H
|
API: &correct=M
|
Home | vCards | Labels | API and Samples
Ayna © 2010-2014, QRcode library © 2002-2009,Y.Swetake,
Revision: 4909