Skip to content

Instantly share code, notes, and snippets.

View eliotharper's full-sized avatar

Eliot Harper eliotharper

View GitHub Profile
@eliotharper
eliotharper / request.xml
Created February 13, 2017 21:52
Triggered Send to multiple subscribers
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">Create</a:Action>
<a:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
<a:ReplyTo>
<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">https://webservice.s7.exacttarget.com/Service.asmx</a:To>
<fueloauth xmlns="http://exacttarget.com">{{accessToken}}</fueloauth>
POST https://pub.s7.exacttarget.com/f42z3hbhqzz
Content-Type: application/x-www-form-urlencoded
ContactKey=a0d1a000000tAEbAAM&orderNumber=100007394&orderStatus=pending
@eliotharper
eliotharper / thankyou.html
Created April 1, 2017 23:04
retrieves form parameters and inserts into Data Extension
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
body {
margin: 50px;
color: #555;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, sans-serif;
}
</style>
{
"items": [
{
"adapterID": 6011,
"adapterKey": "ContactDeleteProcessor.ContactBuilder.Roots",
"applicationID": "e3640f97-1328-48ed-b3d5-03ca7c0d2e12",
"options": [
{
"iD": "5523009a-4174-4dd8-8ba6-c6df7c28a39b",
"key": "Contacts",
HOST: https://www.exacttargetapis.com
PATCH /contacts/v1/contacts
Authorization: Bearer {{accessToken}}
Content-Type: application/json
{
"contactKey":"1C7634EACB83EEACFC16889D8BCB957BA1001",
"contactId":null,
"attributeSets":[
{
<script type="text/javascript">
alert("Hello world");
</script>
{
"ref": "refs/heads/master",
"before": "c590fa60a37627f6d07fc74cfb44758752963e7a",
"after": "4a372650814b0c191dc10064830e5e4e5cbf3130",
"created": false,
"deleted": false,
"forced": false,
"base_ref": null,
"compare": "https://github.com/eliotharper/ampscript-guide-build/compare/c590fa60a376...4a372650814b",
"commits": [
@eliotharper
eliotharper / updateSubscriber.xml
Created April 29, 2018 23:58
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>
@eliotharper
eliotharper / copyDE.js
Created September 15, 2020 23:37
Creates a backup Data Extension in SFMC
<script runat=server>
Platform.Load("core", "1");
// create DE
var timeStamp = Math.round((new Date()).getTime() / 1000);
var deKey = "BACKUP_" + timeStamp;
var deName = "Backup DE " + timeStamp;
var obj = {