API: Databases

Make sure to read the API Overview before reading this document.

Creating a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to create.
api_key Must be set to your unique API key.
database_name A string which specifies the name of your new database.

Optional Variables

Variable Description
case_sensitivity A boolean value which specifies whether database values are case sensitive. Once the database is created, this setting cannot be changed. Specify 1 for case-sensitive validation, or 0 for case-insensitive validation. Set to 0 (not case-sensitive) by default.

Response

If your database is successfully created, we will respond with raw XML containing a status of 1 and your new database ID.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
    <id>1001</id>
</xml>

Back to Top

Retrieving A List of Databases

Required Variables

Variable Description
section Must be set to databases.
action Must be set to retrieve.
api_key Must be set to your unique API key.

Optional Variables

Variable Description
database_id An integer or series of integers which specifies the numeric IDs of the databases you want to list. You can specify a single integer or a comma-separated list of integers (Examples: 1005 or 1005, 1010, 1254 ). Set to all by default.
info_level Possible values are names and services. Target just the info you need for faster response times.
names - Only includes the name node (excluding associated services and potentially costly item count).
services - Includes both name and associated service nodes (excluding the slower item count in the default request).

Response

If we successfully receive your variables, we will respond with raw XML containing status and database information.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
    <database id="120">
        <name>My tickets</name>
        <count>5000</count>
        <service id="123"/>
        <service id="124"/>
    </database>
    <database id="125">
        <name>My inventory</name>
        <count>1574</count>
        <service id="323"/>
        <service id="524"/>
    </database>
</xml>

Back to Top

Renaming a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to update.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database you want to rename.
database_name A string which specifies the new name of your database.

Response

If your database is successfully renamed, we will respond with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top

Deleting a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to delete.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database you want to delete.

Response

If your database is successfully deleted, we will respond accordingly with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top

Clearing a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to clear.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database you want to clear.

Response

If your database is successfully cleared, we will respond with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top

Retrieving Values of a Database / Search for Values in a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to showvalues.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database.

Optional Variables

Variable Description
value A string to perform an exact match search against the value. (Example: value=abc will limit results to one value).
valuelike A string to perform a partial match search against the value. (Example: value=abc will match abc1 , 123abc , 123abc123 , etc).
response A string to perform an exact match search against the response. (Example: response=abc will limit results to one value).
responselike A string to perform a partial match search against the response. (Example: responselike=abc will match values with responses abc1 , 123abc , 123abc123 , etc).
validity An integer to filter results by validity. Set to 1 to show only valid values, and set it to 0 to show only invalid.
limit An integer which limits the maximum number of results displayed within the list.
offset An integer which offsets the results shown. Only valid if limit is provided. (Example: a limit of 20 and an offset of 5 will display a list of 20 values that begins with the 6th value).

Response

We will respond with raw XML containing a status of 1, results count and search results.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
    <count>2</count>
    <value validity="1">
        <id>A1</id>
        <response>A2</response>
    </value>
    <value validity="1">
        <id>B1</id>
        <response>B2</response>
    </value>
</xml>

Back to Top

Uploading a CSV File to a Database

You must use HTTP POST method to pass the csvfile.

Required Variables

Variable Description
section Must be set to databases.
action Must be set to upload.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database.
csvfile A CSV file. (Not the url to the file) For formatting guidelines, see this page.

Response

If your CSV file is successfully imported, we will respond accordingly with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Here is an example of a simple HTML form that imports the entries of a CSV file into a specified CodeREADr database.

Back to Top

Inserting or Updating a Barcode

Required Variables

Variable Description
section Must be set to databases.
action Must be set to upsertvalue.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database.
value A string which specifies the barcode value. Must be 100 characters or less.

Optional Variables

Variable Description
response A string which specifies the barcode value's associated response text.
validity A boolean type which specifies the validity of the barcode. Input 0 and the new barcode value will be treated as invalid whenever it is scanned. Set to 1 (valid) by default.

Response

This action allows you to update your database without first checking the state of the value. If your barcode value is successfully inserted or updated to match your request options, will respond accordingly with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top

Adding a Barcode Value to a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to addvalue.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database.
value A string which specifies the barcode value. Must be 100 characters or less.

Optional Variables

Variable Description
response A string which specifies the barcode value's associated response text.
validity A boolean type which specifies the validity of the barcode. Input 0 and the new barcode value will be treated as invalid whenever it is scanned. Set to 1 (valid) by default.

Response

If your barcode value is successfully added, we will respond accordingly with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top

Editing Barcode Responses and Results

Required Variables

Variable Description
section Must be set to databases.
action Must be set to editvalue.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database.
value A string which specifies the barcode value. Must be 100 characters or less.

Optional Variables

Variable Description
response A string which specifies the barcode value's associated response text.
validity A boolean type which specifies the validity of the barcode. Input 0 and the new barcode value will be treated as invalid whenever it is scanned. Validity remains unchanged by default.

Response

If your barcode response text and/or validity is successfully edited, we will respond accordingly with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top

Deleting Values From a Database

Required Variables

Variable Description
section Must be set to databases.
action Must be set to deletevalue.
api_key Must be set to your unique API key.
database_id An integer which specifies the numeric ID of the database.
value A string which specifies the barcode value. Must be 100 characters or less.

Response

If your barcode value is successfully deleted, we will respond with raw XML containing a status of 1.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <status>1</status>
</xml>

Back to Top