Skip to content

Instantly share code, notes, and snippets.

@eliotharper
Created April 29, 2018 23:58
Show Gist options
  • Save eliotharper/8704be4b0c24a7a66c36c8906023b178 to your computer and use it in GitHub Desktop.
Save eliotharper/8704be4b0c24a7a66c36c8906023b178 to your computer and use it in GitHub Desktop.
SOAP API method to update existing Subscriber in Salesforce Marketing Cloud
<!--
Use the following cURL command to execute this request:
curl -XPOST -H "Content-type: text/xml; charset=utf-8" -H "SOAPAction: Update" -d @request.xml https://webservice.s7.exacttarget.com/Service.asmx
Replace 's7' with your SOAP endpoint as required
-->
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<fueloauth xmlns="http://exacttarget.com">insertAccessTokenHere</fueloauth>
</soapenv:Header>
<soapenv:Body>
<UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Options>
<SaveOptions>
<SaveOption>
<PropertyName>*</PropertyName>
<SaveAction>UpdateOnly</SaveAction>
</SaveOption>
</SaveOptions>
</Options>
<Objects xsi:type="Subscriber">
<PartnerKey xsi:nil="true" />
<ObjectID xsi:nil="true" />
<!-- refer to available status values at https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/subscriberstatus_appex.htm?search_text=SubscriberStatus -->
<Status>insertStatusHere</Status>
<SubscriberKey>insertExistingSubscriberKeyHere</SubscriberKey>
</Objects>
</UpdateRequest>
</soapenv:Body>
</soapenv:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment