Welcome‎ > ‎Version 2‎ > ‎Publisher Api (Read/Write)‎ > ‎Methods‎ > ‎5 - Miscellaneous‎ > ‎

Barcode

Method used for retrieving a barcode image.

Method: /api/v2/publisher/barcode/{code}

Authentication: oauth

Required Parameters:
  code - The code that should be output on the barcode image

Optional Parameters:
  none

Returns:
  A Generic Image

Sample Request:
GET /api/v2/publisher/barcode/F-1EE-00-75C?format=xml HTTP/1.1

Authorization: OAuth oauth_signature="E1fr3Gi%2fTvp%2bNN6M7ykpg5zWwnQ%3d", oauth_nonce="8276755", oauth_timestamp="1304126644", oauth_consumer_key="43c5c674-620c-4f2b-bdcf-3082c99e8186", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"

Host: apitest.groupcommerce.com


Sample XML Response:
<imageResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <version>1</version>
    <success>true</success>
    <lastPublished>2011-04-30T01:24:06.1367031Z</lastPublished>
    <data>
        <bytes>iVBORw0KGgoAAAANSUhEUgAAAU4AAAAzCAYAAA  ...snip...  iPsd/GDiwAAAABJRU5ErkJggg==</bytes>
        <contentType>image/png</contentType>
        <height>51</height>
        <width>334</width>
    </data>
</imageResult>


Sample JSON Response:
{
    "version": "1",
    "success": true,
    "lastPublished": "\/Date(1304126790883)\/",
    "data": {
        "bytes": [
            137,
            80,
            78,
            71,
            13,
            10,
            78, /* truncated */
            68,
            174,
            66,
            96,
            130
        ],
        "contentType": "image\/png",
        "height": 51,
        "width": 334
    }
}

Comments