GetAudienceDefinition
| 
                                                                     Initial Build  | 
                                                                2014.01 | 
| 
                                                                     xWEB  | 
                                                                Web Method | 
| 
                                                                     Response Type  | 
                                                                
                                                                     XML results  | 
                                                            
Use this method to obtain the query definition used to produce a specific Audience record. See also, GetAudienceDefinition.
Parameters
The request contains the following parameters:
| Name | Type | Occurs | Description | 
|---|---|---|---|
| qrh_key | key | 1..1 | 
                                                                     Query header key. A unique key that represents the audience query. A key can be obtained by using the GetAudienceList web method.  | 
                                                            
Response
The request returns a list of all audience records in the system. Each record is delineated by a the Result element and a count of the included records is displayed at the top of the results.
| Name | Description | Type | Notes | 
|---|---|---|---|
| Results | Container for the list of results | XML element | Includes the record return field that indicates the total number of audience records returned from the system. | 
| Result | 
                                                                     Container for a single audience record  | 
                                                                XML | |
| qrh_key | Query header key. A unique key that represents the audience query. | key | |
| qrh_description | The audience query description. | string | 
                                                                     This field appears in the Load an Existing Audience list on the Audience page.  | 
                                                            
Sample Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<!--Optional:-->
<ns:Token>?</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:GetAudienceList/>
</soapenv:Body>
</soapenv:Envelope>
Sample Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/2005/">
<Token>?</Token>
</AuthorizationToken>
</soap:Header>
<soap:Body>
<GetAudienceListResponse xmlns="http://www.avectra.com/2005/">
<GetAudienceListResult>
<Results recordReturn="3">
<Result>
<qrh_key/>
<qrh_description/>
</Result>
<Result>
<qrh_key>d0206034-fa18-4f9f-93df-cc12a0efc3b3</qrh_key>
<qrh_description>Issue 11477</qrh_description>
</Result>
<Result>
<qrh_key>fe63106d-a70f-4f0c-a380-8e3eaa90665a</qrh_key>
<qrh_description>11159 Test Runtime Param</qrh_description>
</Result>
<Result>
<qrh_key>c4507474-26fa-48b7-873e-0de244822a47</qrh_key>
<qrh_description>7234CrAud001</qrh_description>
</Result>
</Results>
</GetAudienceListResult>
</GetAudienceListResponse>
</soap:Body>
</soap:Envelope>
JSON Method
POST /xWeb/JSON/GetAudienceDefinition
DATA: JSON
{
    "GetAudienceDefinition " : {
        "qrh_key": "{{qrhKeyAudience}}"
    }
}
                                                        
SAMPLE RESULT
HTTP STATUS: 200
DATA: JSON
{
    "qrh_key": "7bb59cc2-f436-4afa-9656-1eb66398946f",
    "qrh_description": "132657 Test",
    "Parameters": [],
    "Columns": [
        {
            "Name": "ind_last_name",
            "Description": "Last Name",
            "DataType": "nvarchar",
            "TableAlias": "",
            "TableDescription": "Individual",
            "TableName": "co_individual"
        },
        {
            "Name": "ind_first_name",
            "Description": "First Name",
            "DataType": "nvarchar",
            "TableAlias": "",
            "TableDescription": "Individual",
            "TableName": "co_individual"
        },
        {
            "Name": "ind_mid_name",
            "Description": "Middle Name",
            "DataType": "nvarchar",
            "TableAlias": "",
            "TableDescription": "Individual",
            "TableName": "co_individual"
        },
        {
            "Name": "cst_org_name_dn",
            "Description": "Organization Name",
            "DataType": "nvarchar",
            "TableAlias": "",
            "TableDescription": "Customer",
            "TableName": "co_customer"
        },
        {
            "Name": "cst_eml_address_dn",
            "Description": "Primary E-Mail",
            "DataType": "av_email",
            "TableAlias": "",
            "TableDescription": "Customer",
            "TableName": "co_customer"
        },
        {
            "Name": "adr_line1",
            "Description": "Address Line 1",
            "DataType": "nvarchar",
            "TableAlias": "",
            "TableDescription": "Address",
            "TableName": "co_address"
        },
        {
            "Name": "adr_city_state_code",
            "Description": "City, State, Post Code",
            "DataType": "nvarchar",
            "TableAlias": "",
            "TableDescription": "Address",
            "TableName": "co_address"
        },
        {
            "Name": "cst_no_email_flag",
            "Description": "Do Not Contact by Email",
            "DataType": "av_flag",
            "TableAlias": "",
            "TableDescription": "Customer",
            "TableName": "co_customer"
        }
    ]
}