Generate Barcode

GET /barcode/gen/:codec

Generates a barcode with the given codec and data. Returns the barcode if successful, otherwise returns an error.

Permissions Required: Barcode::Generate

Headers

  • x-format string

    The format to return the barcode in

    Values are png or svg.

Path parameters

  • codec string Required

    The codec to use for the barcode

    Values are auspost, azteccode, azteccodecompact, aztecrune, bc412, channelcode, codablockf, code11, code128, code16k, code2of5, code32, code39, code39ext, code49, code93, code93ext, codeone, coop2of5, daft, databarexpanded, databarexpandedcomposite, databarexpandedstacked, databarexpandedstackedcomposite, databarlimited, databarlimitedcomposite, databaromni, databaromnicomposite, databarstacked, databarstackedcomposite, databarstackedomni, databarstackedomnicomposite, databartruncated, databartruncatedcomposite, datalogic2of5, datamatrix, datamatrixrectangular, datamatrixrectangularextension, dotcode, ean13, ean13composite, ean14, ean2, ean5, ean8, ean8composite, flattermarken, gs1-128, gs1-128composite, gs1-cc, gs1datamatrix, gs1datamatrixrectangular, gs1dldatamatrix, gs1dlqrcode, gs1dotcode, gs1northamericancoupon, gs1qrcode, hanxin, hibcazteccode, hibccodablockf, hibccode128, hibccode39, hibcdatamatrix, hibcdatamatrixrectangular, hibcmicropdf417, hibcpdf417, hibcqrcode, iata2of5, identcode, industrial2of5, interleaved2of5, isbn, ismn, issn, itf14, japanpost, kix, leitcode, mailmark, mands, matrix2of5, maxicode, micropdf417, microqrcode, msi, onecode, pdf417, pdf417compact, pharmacode, pharmacode2, planet, plessey, posicode, postnet, pzn, qrcode, rationalizedCodabar, raw, rectangularmicroqrcode, royalmail, sscc18, swissqrcode, symbol, telepen, telepennumeric, ultracode, upca, upcacomposite, upce, or upcecomposite.

Query parameters

  • content string Required

    The data to encode in the barcode

Responses

  • The barcode for the given data

  • 400 application/json

    Missing barcode information

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

  • 401 application/json

    Invalid/Missing API Token

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

  • 403 application/json

    Missing Permissions

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

  • 500 application/json

    Unable to generate barcode

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

GET /barcode/gen/:codec
curl \
 -X GET https://thefemdevs.com/api/barcode/gen/:codec?content=Hello%2C+World%21 \
 -H "x-format: png"
Response examples (200)
@file
{
  "code": 6,
  "message": "Missing Query Parameter(s)"
}
{
  "code": 7,
  "message": "Invalid Query Parameter(s)"
}
{
  "code": 8,
  "message": "Missing Header Parameter(s)"
}
{
  "code": 9,
  "message": "Invalid Header Parameter(s)"
}
Response examples (401)
{
  "code": 3,
  "message": "No API key provided"
}
{
  "code": 4,
  "message": "Invalid API key provided"
}
Response examples (403)
{
  "code": 1,
  "message": "You are not authorized to access this resource"
}
{
  "code": 2,
  "message": "You are blacklisted from accessing this resource"
}
Response examples (500)
{
  "code": 0,
  "message": "Unknown error occurred"
}