Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 55 additions & 55 deletions documentation.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
#QR Code API#
# QR Code API

##Request##
## Request

The API base URL is: `http://api.qrcode.unitag.fr/api`

A QR Code API request is based on these following primary parameters:

##Parameters##
## Parameters

###t_pwd (required)
### t_pwd (required)
Provide the authentication for your account.

Values:
- To obtain a token please create an account on Unitag's platform and contact the Unitag Team.
- You can set `degraded` as value for tests (the answer received will be limited to a PNG format image of 200px size).

###T (optional)
### T (optional)
Change the image format received.

Values: `SVG`, `PDF`, `PNG`, `JPEG`.

###stored (optional)
### stored (optional)
Store the QR Code in your Unitag Dashboard.

Values: If needed, set value to `true`.

###SIZE (optional)
### SIZE (optional)
Change the image size in pixels.

Values : integer between 0 and 3,000

###setting (required)
### setting (required)
Send custom parameters to your QR Code design.

The setting parameter value is JSON formated and contains all QR Code customizations parameters. See description and examples below

Can be replaced by the templateId parameter.

###data (required)
### data (required)
Send QR Code data.

The data parameter value is JSON formated and contains all QR Code encoded data. See description and examples below.

###templateId (optional)
### templateId (optional)
The parameter templateId can replace the parameter setting in order to indicate a Unitag Template to use as a design.

Values : If needed, set value to the targeted template id Integer.


##Data object##

## Data object
```js
data = {
"TYPE" : "",
"DATA" : {}
}

###"Type" - STRING###
```
## "Type" - STRING

* url
* text
Expand All @@ -67,48 +67,48 @@ Values : If needed, set value to the targeted template id Integer.
* calendar
* call

###"data" - OBJECT###
## "data" - OBJECT

**Type : url**

```js
data = {
"TYPE" : "url",
"DATA" : {
"URL" : ""
}
}

```
**Type : text**

```js
data = {
"TYPE" : "text",
"DATA" : {
"TEXT" : ""
}
}

```
**Type : geoloc**

```js
data : {
"TYPE" : "geoloc",
"DATA" : {
"LAT" : "",
"LONG" : ""
}
}

```
**Type : smsto**

```js
data = {
"TYPE" : "smsto",
"DATA" : {
"TEL" : "",
"MESSAGE" : ""
}
}

```
**Type : wifi**

```js
data = {
"TYPE" : "wifi",
"DATA" : {
Expand All @@ -117,9 +117,9 @@ Values : If needed, set value to the targeted template id Integer.
"PASSWORD" : ""
}
}

```
**Type : vcard**

```js
data = {
"TYPE" : "vcard",
"DATA" : {
Expand All @@ -139,10 +139,10 @@ Values : If needed, set value to the targeted template id Integer.
"COUNTRY" : ""
}
}

```

**Type : email**

```js
data = {
"TYPE" : "email",
"DATA" : {
Expand All @@ -151,9 +151,9 @@ Values : If needed, set value to the targeted template id Integer.
"EMAIL_CORPS" : ""
}
}

```
**Type : calendar**

```js
data = {
"TYPE" : "calendar",
"DATA" : {
Expand All @@ -163,20 +163,20 @@ Values : If needed, set value to the targeted template id Integer.
"DATE_FIN" : ""
}
}
*LIEU : Place ; DATE_DEBUT : Start date ; DATE_FIN ; End date*

//LIEU : Place ; DATE_DEBUT : Start date ; DATE_FIN ; End date*
```
**Type : call**

```js
data = {
"TYPE" : "call",
"DATA" : {
"PHONE" : ""
}
}


##Setting object##

```
## Setting object
```js
setting = {
"LAYOUT" : {},
"EYES" : {},
Expand All @@ -187,11 +187,11 @@ Values : If needed, set value to the targeted template id Integer.
"ARRONDI" : INT,
"QUIET_ZONE" : BOOLEAN
}

```
*ARRONDI : Radius*

###LAYOUT - OBJECT###

### LAYOUT - OBJECT
```js
LAYOUT : {
"GRADIENT_TYPE" : "",
"COLOR1" : "",
Expand All @@ -207,7 +207,7 @@ Values : If needed, set value to the targeted template id Integer.
"Y_SHADOW" : INT,
"FORCE_SHADOW" : ""
}

```
**GRADIENT_TYPE - STRING - mandatory**

* From up to down : "HORI"
Expand Down Expand Up @@ -235,8 +235,8 @@ _Note: FORCE_SHADOW is a shortcut for X_SHADOW/Y_SHADOW_
* "S" : Strong (value is 10)


###EYES###

### EYES
```js
"EYES" : {
"COLOR_EHG" : "",
"COLOR_EHD" : "",
Expand All @@ -246,7 +246,7 @@ _Note: FORCE_SHADOW is a shortcut for X_SHADOW/Y_SHADOW_
"COLOR_IB" : "",
"EYE_TYPE" : ""
}

```
**EYE_TYPE**

* Square: "Simple"
Expand All @@ -266,8 +266,8 @@ _Note: FORCE_SHADOW is a shortcut for X_SHADOW/Y_SHADOW_
* Sharp "Sharp"
* Curved "ECurve_ICurve"

###LOGO###
### LOGO
```js
"LOGO" : {
"L_NAME" : "",
"L_X_Norm" : FLOAT,
Expand All @@ -276,25 +276,25 @@ _Note: FORCE_SHADOW is a shortcut for X_SHADOW/Y_SHADOW_
"L_LENGTH" : FLOAT,
"EXCAVATE" : BOOLEAN
}

```
**L_X_Norm & L_Y_Norm**

The upper corner of the logo in the QR Code as a percentage. Omit to have it centered.


###BACKGROUND###

### BACKGROUND
```js
"BACKGROUND" : {
"IMAGE_BACKGROUND" : "",
"ENLIGHTMENT" : FLOAT,
"CONTRAST" : FLOAT
}

```
**ENLIGHTMENT & CONTRAST - float**

0 <= x <= 2

###E - STRING###
### E - STRING

QR Code redundancy :

Expand All @@ -303,7 +303,7 @@ QR Code redundancy :
* Quality : "Q"
* Strong : "H"

###BODY_TYPE - INT###
### BODY_TYPE - INT

Modules look :

Expand All @@ -320,14 +320,14 @@ Modules look :
* Rectangular : 8


###ARRONDI - INT###
### ARRONDI - INT

0 <= x <= 10

###TEXT###
### TEXT

Use this module to add text under the QR Code

```js
"TEXT" : {
"LABEL" : String,
"COLOR" : 000000,
Expand All @@ -339,7 +339,7 @@ Use this module to add text under the QR Code
"QRMARGIN" : int,
"SPACING" : int
}

```

* LABEL : put \n for new lines
* POSITION : CENTER, LEFT, RIGHT or AUTO ( ie resize to take maximum space beneath the QR Code )
Expand Down