Documentation

1

Authentication

To use the QR Code API, you need to include a valid authentication token in the request header.

		
		x-api-key: undefined
		

2

POST Request

		
		POST https://odin.qrcode-ai.com/api/qrcode
		

Headers

		
{
   "x-api-key": "undefined",
   "Content-Type": "application/json"
}

Request Body (JSON)

		
{
   to: "mailto:undefined"
}
  • Prefix: Here are a few examples of "to" prefixing according to use cases

  • Website URL:

    		
    		https://<Website>
    		
  • E-mail Address:

    		
    		mailto:<Email>
    		
  • Phone Numbers:

    		
    		tel:<Phone Number>
    		
  • Text (SMS):

    		
    		sms:<Phone Number>
    		
  • WiFi:

    		
    		WIFI:S:<SSID>;T:<Security type>;P:<Password>;;
    		
  • Paypal:

    		
    		https://www.paypal.me/<Username>/amount
    		
  • Spotify:

    		
    		https://open.spotify.com/track/2Foc5Q5nqNiosCNqttzHof
    		

3

Response

If successful, the API will return an HTTP 200 status code and a JSON object containing the link to the generated QR code.

Example response

		
{
   qrcode: {
      url: "https://cdn.qrcode-ai.com/qrcode/841e8d7d32d013d94f10cac81671549a-1698770116554.png",
      width: 768,
      height: 768,
      color: 4288058525
   }
}

In the event of an error, the API will return an appropriate error status code and a descriptive error message.

Example of error response

		
{
   message: "Invalid authentication token.",
   statusCode: 401
}

Error management

The API uses the following HTTP status codes to indicate the success or failure of a request:

  • OK The request was successful and the QR code was generated.

  • Bad Request There is a problem with the request sent by the customer.

  • Unauthorized The authentication token is missing or invalid.

  • Payment Required This code indicates that the request cannot be processed because the user has run out of credits.

  • Internal Server Error A server-side error is preventing the QR code from being generated.