GetCustomerCommunicationPreference
| Initial Build | 2013.01 |
| xWeb | Web Method |
| Response Type | MailingListSetting |
The GetCustomerCommunicationPreference web method is used to get a customer's communication preferences for a single mailing type. This method could be useful if you want to opt-out or opt-in a customer for a single mailing type.
Parameters
The request contains the following parameters:
| Name | Type | Occurs | Description |
|---|---|---|---|
| customerKey | string | 0(R)..1 |
The customer key |
| preferenceTypeKey | string | 0(R)..1 |
The mailing list type key. This key can be obtained using the GetSubscriptionMailingTypes and GetPromotionalMailingTypes methods. |
Response
The request returns a single mailing list setting, based on the keys you supply in the request.
Sample Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<ns:Token>***********</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:GetCustomerCommunicationPreference>
<ns:customerKey>5d11b235-693a-404b-aadb-77a4fc319fd6</ns:customerKey>
<ns:preferenceTypeKey>e86b36bf-7ca2-4919-ad2e-3a7ef268ab39</ns:preferenceTypeKey>
</ns:GetCustomerCommunicationPreference>
</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>
<GetCustomerCommunicationPreferenceResponse xmlns="http://www.avectra.com/2005/">
<mailing_list_setting>
<mailing_list_key>e86b36bf-7ca2-4919-ad2e-3a7ef268ab39</mailing_list_key>
<mailing_list_name>Annual Conference Mailing List</mailing_list_name>
<mailing_list_category>event</mailing_list_category>
<status>OptIn</status>
<email_key>984b56f0-8875-4779-969a-16c366f11314</email_key>
<address_key>cee04154-199b-4bb4-9d4d-010eecd3062d</address_key>
<phone_key>f6c64b23-1110-4029-8be5-a2ada3b62544</phone_key>
<fax_key>c0229559-ac17-414c-ba34-b42207ab0bed</fax_key>
</mailing_list_setting>
</GetCustomerCommunicationPreferenceResponse>
</soap:Body>
</soap:Envelope>
JSON Method
POST /xWeb/JSON/GetCustomerCommunicationPreference
DATA: JSON
{
"GetCustomerCommunicationPreference": {
"customerKey": "{{indCstKeyInsert}}",
"preferenceTypeKey": "{{mlsKeyMailingListA}}"
}
}
SAMPLE RESULT
HTTP STATUS: 200
DATA: JSON
{
"mailing_list_key": "aaa01460-5a02-4440-b864-01af9eb16d40",
"mailing_list_name": "Do NOT Mail List",
"mailing_list_category": "Do NOT mail",
"status": 1,
"email_key": "",
"address_key": "",
"phone_key": "",
"fax_key": ""
}
More information