Add Subscribers to an On-Your-Behalf Account

Use On-Your-Behalf accounts to send messages from a central managing account. Messages that you send in this way include the From address of the On-Your-Behalf user.

When you add subscribers to an On-Your-Behalf account, messages sent from the managing account target the appropriate subscribers.

Sample SOAP Envelope 

This example code creates a subscriber in an On-Your-Behalf account.

1<s:Envelope
2  xmlns:s="http://www.w3.org/2003/05/soap-envelope"
3  xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
4  xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
5  <s:Header>
6    <a:Action s:mustUnderstand="1">Create</a:Action>
7    <a:To s:mustUnderstand="1">https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx</a:To>
8    <fueloauth xmlns="http://exacttarget.com">YOUR_ACCESS_TOKEN</fueloauth>
9  </s:Header>
10  <s:Body
11    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
13    <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
14      <Options></Options>
15      <Objects xsi:type="Subscriber">
16        <ObjectID xsi:nil="true"></ObjectID>
17        <EmailAddress>help@example.com</EmailAddress>
18        <Attributes>
19          <Name>ChannelMemberID</Name>
20          <Value>123</Value>
21        </Attributes>
22        <!-- Lists tag is optional. If not included they are added to All Subscribers only -->
23        <Lists>
24          <ID>123</ID>
25          <ObjectID xsi:nil="true" />
26        </Lists>
27      </Objects>
28    </CreateRequest>
29  </s:Body>
30</s:Envelope>

Related Items