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.

EmailPreferenceUpdateByContactRequest
NameDescriptionTypeAdditional information
EmailPreferencesByContact

Collection of EmailPreferenceByContact

None.

Request Formats

application/json, text/json

Sample:
{
  "EmailPreferencesByContact": [
    {
      "LegacyContactKey": "sample string 1",
      "ContactKey": "9fa19a75-b51d-401c-881a-bab02157828a",
      "MessageClass": 0,
      "OptOut": true
    },
    {
      "LegacyContactKey": "sample string 1",
      "ContactKey": "9fa19a75-b51d-401c-881a-bab02157828a",
      "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>9fa19a75-b51d-401c-881a-bab02157828a</ContactKey>
      <LegacyContactKey>sample string 1</LegacyContactKey>
      <MessageClass>All</MessageClass>
      <OptOut>true</OptOut>
    </EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact>
    <EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact>
      <ContactKey>9fa19a75-b51d-401c-881a-bab02157828a</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.

EmailPreferenceUpdateByContactResponse
NameDescriptionTypeAdditional 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": "cee29a56-1c31-4a5c-aef6-323d459f8a7d",
      "MessageClass": 0,
      "OptOut": true
    },
    {
      "LegacyContactKey": "sample string 1",
      "ContactKey": "cee29a56-1c31-4a5c-aef6-323d459f8a7d",
      "MessageClass": 0,
      "OptOut": true
    }
  ],
  "FailureList": [
    {
      "RequestData": {
        "LegacyContactKey": "sample string 1",
        "ContactKey": "cee29a56-1c31-4a5c-aef6-323d459f8a7d",
        "MessageClass": 0,
        "OptOut": true
      },
      "ErrorMessage": "sample string 1"
    },
    {
      "RequestData": {
        "LegacyContactKey": "sample string 1",
        "ContactKey": "cee29a56-1c31-4a5c-aef6-323d459f8a7d",
        "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>cee29a56-1c31-4a5c-aef6-323d459f8a7d</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>cee29a56-1c31-4a5c-aef6-323d459f8a7d</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>cee29a56-1c31-4a5c-aef6-323d459f8a7d</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>cee29a56-1c31-4a5c-aef6-323d459f8a7d</d2p1:ContactKey>
      <d2p1:LegacyContactKey>sample string 1</d2p1:LegacyContactKey>
      <d2p1:MessageClass>All</d2p1:MessageClass>
      <d2p1:OptOut>true</d2p1:OptOut>
    </d2p1:EmailPreferenceUpdateByContactRequest.EmailPreferenceByContact>
  </SuccessList>
</EmailPreferenceUpdateByContactResponse>