Response

When you make a valid request to the BarcodeThis API, the response you get is an image.

If you request the image to be returned in Base64 encode, you get a string:

        
            data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS...
        
    

When an invalid request is made or an error is found, BarcodeThis returns an error message in JSON format. All errors are returned in a JSON errors payload with the following fields:

status Status code
title Error message title
detail Error message details

For example, the following request with an invalid barcode type:

        
            https://barcodethis.io/api/v1?value=hello&type=XYZ&api_token=[TOKEN]
        
    

Generates the following error:

        
            {"errors":{"status":422,"title":"Request Error","detail":"Provide a valid type. Visit https:\/\/barcodethis.io for details."}}