Hi community,
I try to create an interface on my website to create QR codes using this 3rd party service: https://market.mashape.com/qrcode-monkey/custom-qr-code-with-logo
I tried to program the interface on the backend I called “module.jsw” using this code:
import {created, serverError, ok} from ‘wix-http-functions’;
export function post_qrquery(request) {
let options = {
“headers”: {
“Content-Type”: “application/json”,
“X-Mashape-Key”: “”,
“Accept”: “application/json”
}
};
// get the request body
return request.body.json({
“data”: “https://www.qrcode-monkey.com”,
“config”: {
“body”: “circle-zebra-vertical”,
“eye”: “frame13”,
“eyeBall”: “ball15”,
“erf1”: ,
“erf2”: ,
“erf3”: ,
“brf1”: ,
“brf2”: ,
“brf3”: ,
“bodyColor”: “#0277BD”,
“bgColor”: “#FFFFFF”,
“eye1Color”: “#075685”,
“eye2Color”: “#075685”,
“eye3Color”: “#075685”,
“eyeBall1Color”: “#0277BD”,
“eyeBall2Color”: “#0277BD”,
“eyeBall3Color”: “#0277BD”,
“gradientColor1”: “#075685”,
“gradientColor2”: “#0277BD”,
“gradientType”: “linear”,
“gradientOnEyes”: false,
“logo”: “#facebook”
},
“size”: 600,
“download”: false,
“file”: “png”} )
.then( (results) => {
options.body = {
"inserted": results
};
return created(options);
} )
// something went wrong
.catch( (error) => {
options.body = {
"error": error
};
return serverError(options);
} );
}
I really have no idea if it makes sense at all what I have written-
an no idea how to programm the get part.
I found only 1 or 2 others posts that deal with a comparable issue and this documentation:
Help and suggestions much appreciated!
Best Jacky