APIs

Updated March 24, 2014

API Version 1.5

Full API documentation is also provided in the LiveCloud Manager (LCM) app, for instructions on setting up the LCM please visit this page: Setting up the LiveCloud Manager

cdb_AdvancedCloudQuery

function cdb_AdvancedCloudQuery pQuerySetA, pLogicMap, pClientDatabasename, pOutputFormat

Summary:
This function searches the provided cloud database using provided queries, applies the logical operations detailed in the pLogicMap, and returns the resulting subset in several possible formats.

Inputs:
pQuerySetA (Array) – A set of one or more search queries; each query’s key should be a single word, and correspond to one (or more) in the pLogicMap.
pLogicMap (String) – The order and method in which the queries’ results are combined.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.
*pOutputFormat (String) – The output format to use, from the following options:
‘recordList’ – A line-delimited String of the matching cdbRecordIDs. (This is the default if no format is provided.)
‘structured’ – A multidimensional Array of parsed, expanded database information.

Outputs:
(String or Array) – Varies based on ‘pOutputFormat’ parameter; see description above.

Logic Map Syntax::
The logic map is formatted as a String that can be parenthetically nested, with the following logical set operations:
‘AND’ – The intersection of the results.
‘OR’ – The union of the results.
‘XOR’ – The symmetric difference of the results.

optional parameter

API Version:
Introduced – 1.5


cdb_AdvancedLocalQuery

function cdb_advancedLocalQuery pQuerySetA, pLogicMap, pClientDatabasename, pOutputFormat

Summary:
This function searches the specified local database using provided queries, applies the logical operations detailed in the pLogicMap, and returns the resulting subset in several possible formats.

Inputs:
pQuerySetA (Array) – A set of one or more search queries; each query’s key should be a single word, and correspond to one (or more) in the pLogicMap.
pLogicMap (String) – The order and method in which the queries’ results are combined.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.
*pOutputFormat (String) – The output format to use, from the following options:
‘recordList’ – A line-delimited String of the matching cdbRecordIDs. (This is the default if no format is provided.)
‘structured’ – A multidimensional Array of parsed, expanded database information.

Outputs:
(String or Array) – Varies based on ‘pOutputFormat’ parameter; see description above.

Logic Map Syntax::
The logic map is formatted as a String that can be parenthetically nested, with the following logical set operations:
‘AND’ – The intersection of the results.
‘OR’ – The union of the results.
‘XOR’ – The symmetric difference of the results.

optional parameter

API Version:
Introduced – 1.0
Modified – 1.4


cdb_BasicCloudQuery

function cdb_BasicCloudQuery pQueryA, pClientDatabasename, pOutputFormat

Summary:
This function searches the specified cloud database, and returns the subset that matches that query in several possible formats.

Inputs:
pQueryA (Array) – The search query; see “Query Syntax” below.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.
*pOutputFormat (String) – The output format to use, from the following options:
‘recordList’ – A line-delimited String of the matching cdbRecordIDs. (This is the default if no format is provided.)
‘structured’ – A multidimensional Array of parsed, expanded database information.

Outputs:
(String or Array) – Varies based on ‘pOutputFormat’ parameter; see description above.

Query Syntax:
Queries are formatted as an array containing the following keys:
‘key’ – The key in the database to search, as defined by your active schema
‘value’ – The value to compare against the contents of the ‘key’
‘operator’ – The method to compare the ‘key’ and the ‘value’
~ – A key’s contents contains the ‘value’
!~ – A key’s contents does not contain the ‘value’
= – A key’s contents is equal to the ‘value’
!= – A key’s contents is not equal to the ‘value’
starts with – A key’s contents begins with the ‘value’
ends with – A key’s contents ends with the ‘value’
> – A key’s contents are greater than the ‘value’ (non-numeric contents are ignored)
< – A key’s contents are less than the ‘value’ (non-numeric contents are ignored)
>= – A key’s contents are greater than or equal to the ‘value’ (non-numeric contents are ignored)
<= – A key’s contents are less than or equal to the ‘value’ (non-numeric contents are ignored)
regex – A key’s contents matches the ‘value’ regular expression

optional parameter

API Version:
Introduced – 1.5


cdb_BasicLocalQuery

function cdb_BasicLocalQuery pQueryA, pClientDatabasename, pOutputFormat

Summary:
This function searches the specified local database, and returns the subset that matches that query in several possible formats.

Inputs:
pQueryA (Array) – The search query; see “Query Syntax” below.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.
*pOutputFormat (String) – The output format to use, from the following options:
‘recordList’ – A line-delimited String of the matching cdbRecordIDs. (This is the default if no format is provided.)
‘structured’ – A multidimensional Array of parsed, expanded database information.

Outputs:
(String or Array) – Varies based on ‘pOutputFormat’ parameter; see description above.

Query Syntax::
Queries are formatted as an array containing the following keys:
‘key’ – The key in the database to search, as defined by your active schema
‘value’ – The value to compare against the contents of the ‘key’
‘operator’ – The method to compare the ‘key’ and the ‘value’
~ – A key’s contents contains the ‘value’
!~ – A key’s contents does not contain the ‘value’
= – A key’s contents is equal to the ‘value’
!= – A key’s contents is not equal to the ‘value’
starts with – A key’s contents begins with the ‘value’
ends with – A key’s contents ends with the ‘value’
> – A key’s contents are greater than the ‘value’ (non-numeric contents are ignored)
< – A key’s contents are less than the ‘value’ (non-numeric contents are ignored)
>= – A key’s contents are greater than or equal to the ‘value’ (non-numeric contents are ignored)
<= – A key’s contents are less than or equal to the ‘value’ (non-numeric contents are ignored)
regex – A key’s contents matches the ‘value’ regular expression

optional parameter

API Version:
Introduced – 1.0
Modified – 1.4


cdb_BuildQuery

function cdb_BuildQuery pKey, pOperator, pValue

Summary:
This function returns a query-style array properly formatted for usage in other query-based API calls.

Inputs:
pKey (String) – The key in the database to search, as defined by your active schema.
pOperator (String) – The method to compare the ‘key’ and the ‘value’.
pValue (String) – The value to compare against the contents of the ‘key’.

Outputs:
(Array) – An array containing an array-formatted query, for use in other query functions.

Query Syntax::
Queries are formatted as an array containing the following keys:
‘key’ – The key in the database to search, as defined by your active schema
‘value’ – The value to compare against the contents of the ‘key’
‘operator’ – The method to compare the ‘key’ and the ‘value’
~ – A key’s contents contains the ‘value’
!~ – A key’s contents does not contain the ‘value’
= – A key’s contents is equal to the ‘value’
!= – A key’s contents is not equal to the ‘value’
starts with – A key’s contents begins with the ‘value’
ends with – A key’s contents ends with the ‘value’
> – A key’s contents are greater than the ‘value’ (non-numeric contents are ignored)
< – A key’s contents are less than the ‘value’ (non-numeric contents are ignored)
>= – A key’s contents are greater than or equal to the ‘value’ (non-numeric contents are ignored)
<= – A key’s contents are less than or equal to the ‘value’ (non-numeric contents are ignored)
regex – A key’s contents matches the ‘value’ regular expression

API Version:
Introduced – 1.0
Modified – 1.4


cdb_CloudRecordCount

function cdb_CloudRecordCount(pClientDatabaseName)

Summary:
The function returns the number of cloud records for the specified database.

Inputs:
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(String) – The number of records in the cloud.

optional parameter
Modified – 1.5


cdb_CreateCloudRecord

function cdb_CreateCloudRecord pRecordA, pClientDatabaseName

Summary:
This function allocates a new cdbRecordID for a record in the cloud (but not locally), storing the provided data if any.

Inputs:
pRecordA (Array) – An array containing one or more keys to store in a new record.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

Outputs:
(String) – Contains the allocated cdbRecordID for the new record.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4


cdb_CreateLocalRecord

command cdb_CreateLocalRecord pRecordA, pClientDatabaseName

Summary:
This command allocates a new cdbRecordID for a record locally (but not in the cloud), storing the provided data if any.

Inputs:
pRecordA (Array) – An array containing one or more keys to store in a new record.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(String) – Contains the allocated cdbRecordID for the new record.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4


cdb_DeleteCloudRecord

command cdb_DeleteCloudRecord pRecordIDList, pClientDatabaseName

Summary:
This command deletes one or more records from the cloud database.

Inputs:
pRecordIDList (String) – A single cdbRecordID, or a line-delimited list of cdbRecordIDs.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

* optional parameter

API Version:
Introduced – 1.0
Modified – 1.1


cdb_DeleteLocalRecord

command cdb_DeleteLocalRecord pRecordIDList, pClientDatabaseName

Summary:
This command deletes a record from the local database only.

Inputs:
pRecordIDList (String) – A single cdbRecordID, or a line-delimited list of cdbRecordIDs.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

* optional parameter

API Version:
Introduced – 1.0
Modified – 1.1


cdb_DeleteRecord

command cdb_DeleteRecord pRecordIDList, pClientDatabaseName

Summary:
This command deletes a record from both the cloud database and the local database.

Inputs:
pRecordIDList (String) – A single cdbRecordID, or a line-delimited list of cdbRecordIDs.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

* optional parameter

API Version:
Introduced – 1.0
Modified – 1.1


cdb_GetDatabaseNames

function cdb_GetDatabaseNames

Summary:
This function provides a list of all databases associated with the current API key.

Outputs:
(String) – A line-delimited list of the available databases.

*optional parameter

API Version:
Introduced – 1.2
Modified – 1.4


cdb_GetRecord

function cdb_GetRecord pRecordIDList, pClientDatabaseName

Summary:
This function downloads the most recent version of the record from the cloud, updates the local version of that record, and then returns that record as an array.

Inputs:
pRecordIDList (String) – A single cdbRecordID, or a line-delimited list of cdbRecordIDs.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

Outputs:
(Array) – If a single record was requested, a one-dimensional array of data as defined by the record’s schema. If multiple records were requested, a multidimensional array of the cdbRecordIDs requested, populated with the appropriate data.

* optional parameter

API Version:
Introduced – 1.0
Modified – 1.4


cdb_GetSchema

function cdb_GetSchema pOutputFormat, pClientDatabaseName

Summary:
This function returns the schema for a specified database.

Inputs:
*pOutputFormat (String) – The output format to use, from the following options:
‘basic’ – A line-delimited String of all user-defined schema keys. (This is the default if no format is provided.)
‘advanced’ – A line-delimited String of user-defined and internal schema keys.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(String) – A line-delimited list of the keys for the specified database.

*optional parameter

API Version:
Introduced – 1.2
Modified – 1.4


cdb_GetWorkingDatabase

function cdb_GetWorkingDatabase

Summary:
This function returns the name of the currently focused database.

Outputs:
(String) – The name of the working database, or empty if no working database has been defined.

API Version:
Introduced – 1.2
Modified – 1.4


cdb_ListLocalValues

function cdb_ListLocalValues pKey, pSortType, pSortDirection, pClientDatabaseName

Summary:
This function returns a line-delimited list of the values of the requested key.

Inputs:
*pKey (String) – The key whose values will be listed, or ‘cdbRecordID’ if empty.
*pSortType (String) – The type of sort to apply to the results, from the following options:
‘text’ – Sorts by the ASCII value of each character.
‘numeric’ – Sorts by number.
‘dateTime’ – Sorts by the a date and/or time.
empty – Sorts ‘text’ if a pSortDirection is provided, otherwise does not sort.
*pSortDirection (String) – The direction to sort the results, from the following options:
‘ascending’ – Sorts from smallest to largest value.
‘descending’ – Sorts from largest to smallest value.
empty – Sorts ‘ascending’ if a pSortType is provided, otherwise does not sort.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(String) – A line-delimited list of the values of the requested key.

*optional parameter

API Version:
Introduced – 1.2
Modified – 1.4


cdb_ListCloudValues

function cdb_ListCloudValues pKey, pSortType, pSortDirection, pClientDatabaseName

Summary:
This function returns a line-delimited list of the values of the requested key.

Inputs:
*pKey (String) – The key whose values will be listed, or ‘cdbRecordID’ if empty.
*pSortType (String) – The type of sort to apply to the results, from the following options:
‘text’ – Sorts by the ASCII value of each character.
‘numeric’ – Sorts by number.
‘dateTime’ – Sorts by the a date and/or time.
empty – Sorts ‘text’ if a pSortDirection is provided, otherwise does not sort.
*pSortDirection (String) – The direction to sort the results, from the following options:
‘ascending’ – Sorts from smallest to largest value.
‘descending’ – Sorts from largest to smallest value.
empty – Sorts ‘ascending’ if a pSortType is provided, otherwise does not sort.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

Outputs:
(String) – A line-delimited list of the values of the requested key.

API Version:
Introduced – 1.7


cdb_LocalRecordCount

function cdb_LocalRecordCount pClientDatabaseName

Summary:
This function counts the number of unique records in a given database.

Inputs:
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(String) – Contains the numeric count of records in a given database.

*optional parameter

API Version:
Introduced – 1.2
Modified – 1.4


cdb_LookupLocalValue

function cdb_LookupLocalValue pRecordID, pKey, pClientDatabaseName

Summary:
This function returns the value associated with a given key for a given record.

Inputs:
pRecordID (String) – The cdbRecordID of the record to examine.
pKey (String) – The key to retrieve.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(String) – Contains the value of the given key for the specified record.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4


cdb_ReadCloudRecord

function cdb_ReadCloudRecord pRecordID, pClientDatabaseName

Summary:
This function downloads the most recent version of a cloud record, and returns it as an array without updating the local record.

Inputs:
pRecordID (String) – The cdbRecordID of the record to read.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

Outputs:
(Array) – A record with keys as defined by the schema of the accessed database.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4


cdb_ReadLocalRecord

function cdb_ReadLocalRecord pRecordID, pClientDatabaseName

Summary:
This function reads a local record and returns that record’s contents.

Inputs:
pRecordID (String) – The cdbRecordID of the record to read.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Outputs:
(Array) – A record with keys as defined by the schema of the accessed database.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4


cdb_Result

function cdb_Result pResultKey

Summary:
This function provides various information about the results of other API calls.

Inputs:
*pResultKey (String) – The result array key to read, from the following options:
‘completed’ – A Boolean value indicating whether the most recent API completed successfully. (This is the default if no key is provided.)
‘response’ – A String containing the error message or other response from the API call.
‘context’ – A String containing the name of the API that generated these results.
‘date’ – A String containing the ISO 8601 time when the API call was made.
‘array’ – An Array containing all the available result keys.

Outputs:
(Array, Boolean, or String) – Varies based on ‘pResultKey’ parameter; see description above.

* optional parameter

API Version:
Introduced – 1.4


cdb_SaveRecord

function cdb_SaveRecord pRecordA, pClientDatabaseName

Summary:
This function creates a record both in the cloud and locally with the provided data, or updates an existing record with the provided data if the record exists.

Inputs:
pRecordA (Array) – An array containing a number of keys pertaining to a specific record. May or may not contain a cdbRecordID.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

Outputs:
(String) – Contains the allocated cdbRecordID for the new record, or the provided cdbRecordID for updates. Note: Empty output indicates function failed to complete successfully.

* optional parameter

API Version:
Introduced – 1.0
Modified – 1.4


cdb_SetLogMode

command cdb_SetLogMode pLogModes

Summary:
This command turns on debug logging for API calls in the IDE.

Inputs:
pLogModes (String) – A comma-delimited list of logging modes that the APIs should use, from the following options:
‘desktop’ – Write API logging to a text file located on the user’s desktop.
‘message box’ – Write API logs to the message box.

Additional Requirements:
This API call can only be made in the IDE; standalone calls to it are ignored.

* optional parameter

API Version:
Introduced – 1.4


cdb_SetWorkingDatabase

command cdb_SetWorkingDatabase pClientDatabaseName

Summary:
This command makes subsequent API calls focus on the provided database, removing the need to pass a database parameter.

Inputs:
*pClientDatabaseName (String) – The label of the database to access, or empty to clear the working database.

API Version:
Introduced – 1.2
Modified – 1.4


cdb_SyncDatabase

command cdb_SyncDatabase pClientDatabaseName, pResolutionMode

Summary:
This command synchronizes the local database with the database stored in the cloud.

Inputs:
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.
*pResolutionMode (String) – The resolution mode to use for conflicts, from the following options:
‘server_master’ – Local records are created, removed, or updated to match the cloud database. (This is the default if no mode is provided.)
‘local_master’ – Cloud records are created, removed, or updated to match the local database.
‘older_record’ – Records that exist in both the cloud and local databases are merged, with the least recently modified version taking precedence. Records which do not exist in both databases are ignored.
‘newer_record’ – Records that exist in both the cloud and local databases are merged, with the most recently modified version taking precedence. Records which do not exist in both databases are ignored.

Additional Requirements:
This API call requires internet access.

* optional parameter

API Version:
Introduced – 1.0
Modified – 1.4


cdb_UpdateCloudRecord

command cdb_UpdateCloudRecord pRecordA, pClientDatabaseName

Summary:
This command makes changes to an existing cloud record without modifying the corresponding local record.

Inputs:
pRecordA (Array) – An array containing the keys to update, plus the cdbRecordID of the record to modify.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

Additional Requirements:
This API call requires internet access.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4


cdb_UpdateLocalRecord

command cdb_UpdateLocalRecord pRecordA, pClientDatabaseName

Summary:
This command makes changes to a local record, without making changes to the corresponding cloud record.

Inputs:
pRecordA (Array) – An array containing the keys to update, plus the cdbRecordID of the record to modify.
*pClientDatabaseName (String) – The label of the database to access, or the working database if empty.

*optional parameter

API Version:
Introduced – 1.1
Modified – 1.4

cdb_BatchCreateCloudRecords

function cdb_BatchCreateCloudRecords pRecordA

function cdb_BatchCreateCloudRecords pRecordsA

Summary:
This function allocates a new cdbRecordID for a batch of records in the cloud (but not locally), storing the provided data.

Inputs:
pRecordsA (Array) – A multidimensional array containing one or more record arrays to store. The first level of keys is discarded, and the second level of keys must follow the associated database schema. If no database is specified in a record array, the working database will be used.

Additional Requirements:
This API call requires internet access.

Outputs:
(Array) – Contains the allocated cdbRecordID for each new record.

API Version:
Introduced – 1.6

*optional parameter

Examples:
put “Gary” into tRecordA[1][“FirstName”] put “Smith” into tRecordA[1][“LastName”] put “PayingCustomers” into tRecordA[1][“cdbClientDatabaseName”] //the first record will be stored into the ‘PayingCustomers’ database
put tRecordA[1] into tRecordA[2] //duplicate the first record
put “AllCustomers” into tRecordA[2][“cdbClientDatabaseName”] //the second record will be stored into the ‘AllCustomers’ database simultaneously
put cdb_BatchCreateCloudRecords(tRecordA) into tRecordIDsA

cdb_SetWorkingDatabaseName “EquipmentManifest”
put “Laptop” into tManifestA[“Laptop”][“EquipmentType”] put “Mouse” into tManifestA[“Mouse”][“EquipmentType”] put “Keyboard” into tManifestA[“Keyboard”][“EquipmentType”] put “Phone” into tManifestA[“Phone”][“EquipmentType”] get cdb_BatchCreateCloudRecords(tManifestA)