The Contact Details command allows you to search and return data for a single contact by ID.
Arguments
The Contact Details command requires the following arguments: Command, Realm, Password, and Contact ID.
api_web?r=myrealm&p=mypass&c=detail&subscriber_id=1123
The command is ‘detail', the realm is ‘myrealm’ and the password is ‘mypass’. The Contact to find has id '1123' .
This command will attempt to find a single contact associated with the specified contact id number and return the results. A successful search will return the contact ID, email address, first name, and last name for each matching Contact.
You can return all contact data fields, custom fields that contain data, and the ID numbers of each list to which the Contact is subscribed by using the output_format argument. If output in CSV format, the List results will appear in a column with the list ids separated by commas.
If the output is XML, the <lists> tag will hold a comma separated list of list ids. Additional Subscription details will also be included for each list, including the date the subscription was created, the format the contact has selected to receive, and the date a campaign was last sent to the contact.
The Contact Details command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=detail c=detail |
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] |
Contact ID |
Yes |
Identifier of the Contact to find. |
subscriber_id=[subscriber_id] |
Version |
Version of API to use. Data may be added to newer versions of the API. To alleviate issues for users who have already coded file parsing, new columns are only displayed if the version is included. |
version=[version_number] 9.3.0: When used in conjunction with CSV output, 'Created Date', 'Updated Date' and all Custom Data fields will be included (even if they do not contain a value). |
|
Output Format |
To 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, which may not include all data columns. |
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] |
|
Header |
To define the data with a label, use the Header argument. This can only 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=detail&subscriber_id=12345&version=9.3.0&output_format=csv&headers=1
The command will find and return the contact with the id '12345'.
Successful results return:
"subscriber_id","email","first","last","company","address_1","address_2","city","state","zip","country","phone","fax","lists","created_date","update_date","location","source"
"44356","janedup@domain.com","Jane","Doe","","","","","","","","","","5","2012-06-20 10:48:25","2014-03-28 14:15:55","","website"
Results
The Contact Details command outputs either a SUCCESS or FAILURE message.
SUCCESS
The Contact Details command does not explicitly return a Success code. Instead, it outputs the contact details in plain text format. Use the output_format argument to return the results in an alternate format.
FAILURE
A Contact Details command will fail for several reasons. The result format is:
FAILURE: [Reason]