The Relational Find Data command allows you to search and report records in a User Defined Relational Table. The Relational Find Data command requires the following arguments: Command, Realm, Password, Table, and Data. The Relational Find Data command expects as least one field in the Data argument.
api_web?r=myrealm&p=mypass&c=rdbfinddata&table=mytable&data=column1,column2^value1,value2
The command is 'rdbfinddata', the realm is 'myrealm', the password is 'mypass', and the table to search is 'mytable' and the data to search is in column1 and column2. This command will return results where the data in the row matches the values defined for the data fields.
Arguments
The Relational Find Data command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=rdbfinddata c=rdbfinddata |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Relational Table Name |
Yes |
Identifier of the relational data table to search. |
table=[table_name] t=[table_name] |
Data |
Yes |
Column search criteria. This is the data to match in order to return search results. The format is a list of comma separated field column names followed by one or more comma separated lists of column values separated by a carat (^). If missing or empty, all rows will be returned. |
data=[column_names^values] d=[column_names^values] d=[column_names^values^values] |
Return Data for Field Columns |
Comma separated list of field names to return. If missing or empty, all columns will be returned. |
fields=[field_name_1, field_name_2,field_name_n] f=[field_name_1, field_name_2,field_name_n] |
|
Limit Results |
Limits the number of records returned from 1 to 250 |
limit=[1 to 250] DEFAULT==250 |
|
Exact Match |
If you are searching using more than one data field, use exact as a conditional for AND or OR. If set to 1, the returned results must match all data fields (AND). If set to 0, the OR condition will be used. |
exact=[0,1] DEFAULT==1 |
|
Output Format |
Tod specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string. |
csv=1 or output_format=[csv, csv_tab, csv_pipe, xml] DEFAULT==csv |
|
Headers |
To define the data with a label, use the Header argument. This can be used in conjunction with the output_format, and does not affect XML |
headers=[0,1] DEFAULT==0 |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=rdbfinddata&table=pets&data=pet_type,pet_breed^cat,orange%20tabby&limit=50&exact=1&output_format=csv&headers=1
Successful results return:
"subscriber_id","pet_id","pet_type","pet_name","pet_breed" "1232","1232_01","cat","Chairman Meow","orange tabby" "1232","1232_02","cat","Mr. Cat","orange tabby"
Results
The Relational Find Data command outputs either a SUCCESS or FAILURE message.
SUCCESS
The Relational Find Data command success message returns the SUCCESS message. It also outputs the details in plain text format. Use the output_format argument to return the results in an alternate format. The result format is:
[header]
[query_results]
FAILURE
The Relational Find Data command will fail for several reasons, such as if the table does not exist. The result format is:
FAILURE: [Reason]
If the table exists, but no matching results are found, the result format is:
[header]
No Results