Aspose.BarCode.Cloud v4 API explorer
Welcome to the Aspose.BarCode.Cloud API Explorer Page! This API allows you to high-quality generate and recognize barcodes. Below, you’ll find the available endpoints along with their descriptions, parameters, and example requests. You also can see API references here and full swagger specification here.
API Overview
API Version: v4.0
Base URL: https://api.aspose.cloud/v4.0
Endpoints
1. Generate Barcode
Generate Barcode using GET Request
- Endpoint:
/barcode/generate/{barcodeType}
- Method:
GET
- Summary: Generate a barcode using parameters in the route and query string.
Parameters:
barcodeType
(path, required): Type of barcode to generate.DataType
(query, optional): Type of data to encode. Default:StringData
.Data
(query, required): String representing data to encode.ImageFormat
(query, optional): Output image format. Default:png
.- Additional parameters related to display text, colors, dimensions, and resolution.
Responses:
200 OK
: Returns the generated barcode image in various formats (PNG, BMP, GIF, JPEG, SVG, TIFF).400 Bad Request
: Invalid request parameters.401 Unauthorized
: Authentication failed.500 Internal Server Error
: Server error.
Generate Barcode using POST Request (Form Encoded)
- Endpoint:
/barcode/generate-multipart
- Method:
POST
- Summary: Generate a barcode using POST request with parameters in a URL-encoded form.
Request Body:
- Required fields:
barcodeType
,Data
. - Optional fields include
DataType
,ImageFormat
, and others related to display settings.
Responses: Same as the GET request.
Generate Barcode using POST Request (Body in JSON/XML Format)
- Endpoint:
/barcode/generate-body
- Method:
POST
- Summary: Generate a barcode using parameters in the body in JSON or XML format.
Request Body:
{
"barcodeType": "EncodeBarcodeType",
"encodeData": {
"dataType": "EncodeDataType",
"data": "String representing data to encode"
},
"barcodeImageParams": {
"imageFormat": "BarcodeImageFormat",
"textLocation": "CodeLocation",
"foregroundColor": "Color name or ARGB value",
"backgroundColor": "Color name or ARGB value",
"units": "GraphicsUnit",
"resolution": 96.0,
"imageHeight": 100.0,
"imageWidth": 200.0,
"rotationAngle": 0
}
}
Request Body (XML):
<GenerateParams>
<barcodeType>EncodeBarcodeType</barcodeType>
<encodeData>
<dataType>EncodeDataType</dataType>
<data>String representing data to encode</data>
</encodeData>
<barcodeImageParams>
<imageFormat>BarcodeImageFormat</imageFormat>
<textLocation>CodeLocation</textLocation>
<foregroundColor>Color name or ARGB value</foregroundColor>
<backgroundColor>Color name or ARGB value</backgroundColor>
<units>GraphicsUnit</units>
<resolution>96.0</resolution>
<imageHeight>100.0</imageHeight>
<imageWidth>200.0</imageWidth>
<rotationAngle>0</rotationAngle>
</barcodeImageParams>
</GenerateParams>
Parameters:
-
barcodeType
(required): Specifies the type of barcode to generate. It should be one of the values from theEncodeBarcodeType
enumeration (e.g., Code128, QR, etc.). -
encodeData
(required): An object containing:dataType
: The type of data being encoded. Should be one of the values fromEncodeDataType
(e.g., StringData, Base64Bytes).data
: A string that represents the actual data you want to encode in the barcode. This field is mandatory.
-
barcodeImageParams
(optional): An object containing optional parameters for customizing the barcode image:imageFormat
: The desired output image format (e.g., PNG, JPEG, etc.), specified inBarcodeImageFormat
.textLocation
: Specifies where the text is displayed in relation to the barcode (e.g., above, below, or none).foregroundColor
: The color of the barcode (can be specified as a color name or an ARGB value).backgroundColor
: The background color of the barcode image (can be specified as a color name or an ARGB value).units
: The unit of measurement for the barcode dimensions (e.g., pixels, inches).resolution
: The resolution of the barcode image in DPI (dots per inch).imageHeight
: The height of the barcode image in the specified units.imageWidth
: The width of the barcode image in the specified units.rotationAngle
: The angle of rotation for the barcode image.
Responses: Same as the GET request.
2. Recognize Barcode
Recognize Barcode from File using GET Request
- Endpoint:
/barcode/recognize/{barcodeType}
- Method:
GET
- Summary: Recognize a barcode from a file on the server using parameters in the route and query string.
Parameters:
barcodeType
(path, required): Type of barcode to recognize.fileUrl
(query, required): URL to the barcode image.- Optional fields:
recognitionMode
,recognitionImageKind
.
Responses:
200 OK
: Returns recognized barcode data.400 Bad Request
,401 Unauthorized
,500 Internal Server Error
: Similar to previous endpoints.
Recognize Barcode from File using POST Request (JSON/XML Body)
- Endpoint:
/barcode/recognize-body
- Method:
POST
- Summary: Recognize a barcode from a file in the request body (JSON or XML format).
Request Body:
{
"barcodeTypes": [
"DecodeBarcodeType"
],
"fileBase64": "Base64 encoded barcode image bytes",
"recognitionMode": "RecognitionMode",
"recognitionImageKind": "RecognitionImageKind"
}
Request Body (XML):
<RecognizeBase64Request>
<barcodeTypes>
<DecodeBarcodeType>TypeOfBarcode1</DecodeBarcodeType>
<DecodeBarcodeType>TypeOfBarcode2</DecodeBarcodeType>
</barcodeTypes>
<fileBase64>Base64 encoded barcode image bytes</fileBase64>
<recognitionMode>RecognitionMode</recognitionMode>
<recognitionImageKind>RecognitionImageKind</recognitionImageKind>
</RecognizeBase64Request>
Parameters:
-
barcodeTypes
(required): An array of strings specifying the types of barcodes to recognize. Each value should be one of the types from theDecodeBarcodeType
enumeration (e.g., QR, Code128, etc.). -
fileBase64
(required): A string containing the barcode image encoded as a Base64 string. This is the actual image data that will be processed for recognition. -
recognitionMode
(optional): Specifies the mode of recognition, which can be one of the values from theRecognitionMode
enumeration (e.g., Fast, Normal, Excellent). -
recognitionImageKind
(optional): Specifies the kind of image being recognized, selected from theRecognitionImageKind
enumeration (e.g., Photo, ScannedDocument, ClearImage).
Responses: Same as above.
Recognize Barcode from File using POST Request (Form Encoded)
- Endpoint:
/barcode/recognize-multipart
- Method:
POST
- Summary: Recognize a barcode from a file using multipart form.
Request Body:
- Required fields include
barcodeType
,file
, with optionalrecognitionMode
,recognitionImageKind
.
Responses: Same as above.
3. Scan Barcode
Scan Barcode from File using GET Request
- Endpoint:
/barcode/scan
- Method:
GET
- Summary: Scan a barcode from a file on the server using a query string parameter.
Parameters:
fileUrl
(query, required): URL to the barcode image.
Responses: Same as previous endpoints.
Scan Barcode from File using POST Request (JSON/XML Body)
- Endpoint:
/barcode/scan-body
- Method:
POST
- Summary: Scan a barcode from a file in the request body (JSON or XML format).
Request Body:
- Required:
{ "fileBase64": "..." }
.
Responses: Same as above.
Scan Barcode from File using POST Request (Form Encoded)
- Endpoint:
/barcode/scan-multipart
- Method:
POST
- Summary: Scan a barcode from a file using multipart form.
Request Body:
- Required:
file
.
Responses: Same as above.
Error Responses
Common error responses include:
- 400 Bad Request: Invalid parameters.
- 401 Unauthorized: Authentication issues.
- 500 Internal Server Error: Unexpected server errors.
Security
Authentication: JWT Bearer Token
Example: Bearer <your-token-here>
Feel free to explore the endpoints and try out the barcode generation and recognition features!