-
Notifications
You must be signed in to change notification settings - Fork 0
/
puttoportfolio.php
45 lines (36 loc) · 1.27 KB
/
puttoportfolio.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
require('vendor/exacttarget/exacttarget.php');
$wsdl = 'https://webservice.s4.exacttarget.com/etframework.wsdl';
$etusername = 'salachniewicz';//Enter the username you use to login to Exact Target
$etpassword = '750_BStreet!';//Enter the password you use to login to Exact Target
//method
try {
$client = new ExactTargetSoapClient($wsdl, array('trace'=>1));
$client->username = $etusername;
$client->password = $etpassword;
$port = new ExactTarget_Portfolio();
$port->DisplayName = $DisplayName;
//$port->CustomerKey = 'API Uploaded Test v10';
$rs = new ExactTarget_ResourceSpecification();
$rs->URN = $ET_file;
$port->Source = $rs;
$port->FileName = $DisplayName;
//$port->FileURL="myfileurl";
$object = new SoapVar($port, SOAP_ENC_OBJECT, 'Portfolio', "http://exacttarget.com/wsdl/partnerAPI");
$request = new ExactTarget_CreateRequest();
$request->Options = NULL;
$request->Objects = array($object);
$results = $client->Create($request);
//echo '<pre>';
//print_r($results);
//echo '</pre>';
$myvar = array(
'url'=> 'http://image.updates.sandiego.org/lib/fe9e15707566017871/m/5/'.$filename
);
echo json_encode($myvar);
} catch (SoapFault $e) {
echo '<pre>';
print_r($e);
echo '</pre>';
}
?>