POST
Creates a barcode image.
The following example creates a Code128 barcode.
# Request:
curl --location --request POST 'https://trial.dsserver.io/documentprocessing/barcodes/create?barcodeType=code128' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer fePFHv8OtIyRSCAdOnn7USc9kKdYB2rg' \
--data-raw '{
"AdditionalText" : "Sets an additional text that is displayed below or above the barcode image",
"Alignment" : "BottomCenter",
"BackColor" :"#ffffff",
"ForeColor" :"#000000",
"ShowText" : true,
"Text" : "Sets the text the barcode should encrypt.",
"TextAlignment" : "Bottom",
"UpperTextLength" : 23
}
'
# Result:
"UEsDBBQAAAAIAAACAAC5EQAAAAADKSKHJHDuHD[..]"| Name | Type | Value | Optional |
|---|---|---|---|
| image |
String | A string that specifies the image format of the created barcode. Possible values are: "BMP", "EMF", "GIF", "JPEG", "PNG", "TIFF". Default value is "PNG". | yes |
| barcode |
String | A string that specifies the barcode type. Possible values are: "QRCode", "Code128", "EAN13", "UPCA", "EAN8", "Interleaved2of5", "Postnet ", "Code39", "Aztec |
yes |
| width | int | Specifies the width of the barcode image. Default value is 200. | yes |
| height | int | Specifies the height of the barcode image. Default value is 200. | yes |
| Type | Value |
|---|---|
| Barcode | The Barcode object contains the settings for the requested barcode. |
| Name | Type | Value | Optional |
|---|---|---|---|
| image |
String | The image format. | yes |
| additional |
String | Specifies additional text that is rendered with the barcode. | yes |
| alignment | String | The alignment of the barcode. Possible values are: "Top |
yes |
| angle | Integer | Specifies the rotation angle of the barcode image. | yes |
| back |
String | Specifies the background color of the barcode image. | yes |
| barcode |
String | A string that specifies the barcode type. Possible values are: "QRCode", "Code128", "EAN13", "UPCA", "EAN8", "Interleaved2of5", "Postnet ", "Code39", "Aztec |
yes |
| fore |
String | Specifies the foreground color of the barcode image. | yes |
| show |
Boolean | Specifies whether to render the text. | yes |
| text | String | Specifies the actual data that is encoded in the barcode. | no |
| text |
String | A string that specifies the barcode alignment. Possible values are: "Bottom", "Top". | yes |
| upper |
Integer | Specifies the upper text length of the barcode. | yes |
| height | Integer | Specifies the height of the barcode. | yes |
| width | Integer | Specifies the width of the barcode. | yes |
| Status | Description |
|---|---|
| 200 | On success, the HTTP status code in the response header is 200 (OK). The response body contains the created barcode image encoded as a Base64 encoded string. |
| Status | Description |
|---|---|
| 401 | A 401 (Unauthorized) is returned, if the user is not authorized. |
| 400 | A 400 (Bad Request) is returned, if DS Server is not licensed or the license is invalid. |
| 400 | A 400 (Bad Request) is returned, if no data is found in the body. |