POST api/v2.0/Contacts/UpdateEmailPreferences
Change Global Email preferences for 1 or more Contacts. * For use by Administrators only *. Individual users can updated their own Email Preferences via the "UpdateMyEmailPreferences" endpoint.
Request Information
URI Parameters
None.
Body Parameters
Updates to apply to Email settings.
EmailPreferenceUpdateByContactRequestName | Description | Type | Additional information |
---|---|---|---|
EmailPreferencesByContact | Collection of EmailPreferenceByContact |
None. |
Request Formats
application/json, text/json
Sample:
{ "EmailPreferencesByContact": [ { "LegacyContactKey": "sample string 1", "ContactKey": "e583d007-29b8-478c-8836-1d388d49526c", "MessageClass": 0, "OptOut": true }, { "LegacyContactKey": "sample string 1", "ContactKey": "e583d007-29b8-478c-8836-1d388d49526c", "MessageClass": 0, "OptOut": true } ] }
application/xml, text/xml
Sample:
<EmailPreferenceUpdateByContactRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/HigherLogic.API.Models.Enterprise.Request"> <EmailPreferencesByContact> <EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> <ContactKey>e583d007-29b8-478c-8836-1d388d49526c</ContactKey> <LegacyContactKey>sample string 1</LegacyContactKey> <MessageClass>All</MessageClass> <OptOut>true</OptOut> </EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> <EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> <ContactKey>e583d007-29b8-478c-8836-1d388d49526c</ContactKey> <LegacyContactKey>sample string 1</LegacyContactKey> <MessageClass>All</MessageClass> <OptOut>true</OptOut> </EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> </EmailPreferencesByContact> </EmailPreferenceUpdateByContactRequest>
Response Information
Resource Description
A list of updated EmailPreference objects corresponding to the updates passed in.
EmailPreferenceUpdateByContactResponseName | Description | Type | Additional information |
---|---|---|---|
SuccessList |
List of Email Preference Updates that succeeded. |
Collection of EmailPreferenceByContact |
None. |
FailureList |
List of Email Preference Updates that failed. |
Collection of EmailPreferenceByContactUpdateFailure |
None. |
Response Formats
application/json, text/json
Sample:
{ "SuccessList": [ { "LegacyContactKey": "sample string 1", "ContactKey": "c984a392-80c4-4e1b-904a-1e910f54ddd2", "MessageClass": 0, "OptOut": true }, { "LegacyContactKey": "sample string 1", "ContactKey": "c984a392-80c4-4e1b-904a-1e910f54ddd2", "MessageClass": 0, "OptOut": true } ], "FailureList": [ { "RequestData": { "LegacyContactKey": "sample string 1", "ContactKey": "c984a392-80c4-4e1b-904a-1e910f54ddd2", "MessageClass": 0, "OptOut": true }, "ErrorMessage": "sample string 1" }, { "RequestData": { "LegacyContactKey": "sample string 1", "ContactKey": "c984a392-80c4-4e1b-904a-1e910f54ddd2", "MessageClass": 0, "OptOut": true }, "ErrorMessage": "sample string 1" } ] }
application/xml, text/xml
Sample:
<EmailPreferenceUpdateByContactResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/HigherLogic.API.Models.Enterprise"> <FailureList> <EmailPreferenceUpdateByContactResponse.EmailPreferenceByContactUpdateFailure> <ErrorMessage>sample string 1</ErrorMessage> <RequestData xmlns:d4p1="http://schemas.datacontract.org/2004/07/HigherLogic.API.Models.Enterprise.Request"> <d4p1:ContactKey>c984a392-80c4-4e1b-904a-1e910f54ddd2</d4p1:ContactKey> <d4p1:LegacyContactKey>sample string 1</d4p1:LegacyContactKey> <d4p1:MessageClass>All</d4p1:MessageClass> <d4p1:OptOut>true</d4p1:OptOut> </RequestData> </EmailPreferenceUpdateByContactResponse.EmailPreferenceByContactUpdateFailure> <EmailPreferenceUpdateByContactResponse.EmailPreferenceByContactUpdateFailure> <ErrorMessage>sample string 1</ErrorMessage> <RequestData xmlns:d4p1="http://schemas.datacontract.org/2004/07/HigherLogic.API.Models.Enterprise.Request"> <d4p1:ContactKey>c984a392-80c4-4e1b-904a-1e910f54ddd2</d4p1:ContactKey> <d4p1:LegacyContactKey>sample string 1</d4p1:LegacyContactKey> <d4p1:MessageClass>All</d4p1:MessageClass> <d4p1:OptOut>true</d4p1:OptOut> </RequestData> </EmailPreferenceUpdateByContactResponse.EmailPreferenceByContactUpdateFailure> </FailureList> <SuccessList xmlns:d2p1="http://schemas.datacontract.org/2004/07/HigherLogic.API.Models.Enterprise.Request"> <d2p1:EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> <d2p1:ContactKey>c984a392-80c4-4e1b-904a-1e910f54ddd2</d2p1:ContactKey> <d2p1:LegacyContactKey>sample string 1</d2p1:LegacyContactKey> <d2p1:MessageClass>All</d2p1:MessageClass> <d2p1:OptOut>true</d2p1:OptOut> </d2p1:EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> <d2p1:EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> <d2p1:ContactKey>c984a392-80c4-4e1b-904a-1e910f54ddd2</d2p1:ContactKey> <d2p1:LegacyContactKey>sample string 1</d2p1:LegacyContactKey> <d2p1:MessageClass>All</d2p1:MessageClass> <d2p1:OptOut>true</d2p1:OptOut> </d2p1:EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact> </SuccessList> </EmailPreferenceUpdateByContactResponse>