Comments (10)
actually, I think I figured it out by using retrieveRequest
$getDERows = new ET_DataExtension_Row();
$getDERows->authStub = $this->soap_client;
$getDERows->retrieveRequest['ClientIDs'] = array('ID' => $this->client_id);
$getDERows->props = array('ELECTRONIC_ADDRESS_TXT', 'UNIQUE_IDENTIFIER', 'TITLE_OF_CAMPAIGN', 'INSERT_DATE');
$getDERows->Name = $customerKey;
$getDERows->CustomerKey = $customerKey;
$res = $getDERows->get();
from fuelsdk-php.
@garek007 do you know how can we push/filter DataExtensions based on Client.ID
from fuelsdk-php.
Not sure if you're still having this issue, but ID needs to be an array. So it's not client.id, you'd set the client property to array like array("ID",820047); or something like that. I think I got it working. If you're still in need I can find the code.
from fuelsdk-php.
yes please @garek007, we still didn't sort this piece out, and we have a very inefficient call, retrieving all then filtering with other vanilla code
from fuelsdk-php.
Try it like this
$get->props = array(
"Name" => $deName,
"CustomerKey" => str_replace(" ", "_", $deName),
"IsSendable" => true,
"Client"=> array("ID" => 1234567),
"SendableDataExtensionField" => array(
"Name"=>"SubscriberKey",
"Value"=> NULL
),
"SendableSubscriberField"=>array(
"Name" => "Subscriber Key",
"Value" => NULL
)
);
This is for creating a data extension, so just pay attention to the part with the client id. You pass Client as a property, not in the filter, then the ID is an array.
Another way you should be able to do it is during authentication. Did you know that when you authenticate you can specify a specific business unit?
$config = array(
'appsignature' => 'none',
'clientid' => $config["id"],
'clientsecret' => $config["secret"],
'baseAuthUrl' => $config["authURL"],
'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
'xmlloc' => dirname(__DIR__,1).'/ExactTargetWSDL.xml',
'baseSoapUrl' => $config["soapURL"],
'baseUrl' => $config["restURL"],
'useOAuth2Authentication' => true,
'accountId' => 123456789
);
from fuelsdk-php.
your example is for setting data
I want to FILTER on READ, I am not the one who created the Data Extension. I need to read it to see if it has something in it.
from fuelsdk-php.
It should be the same though, pass an array. It should work with retrieve. I also have some code for simple and complex filters too, but I don't think they work for this.
from fuelsdk-php.
however now I don't know the reason why sometimes there is a function
- filter()
and sometimes - retrieveRequest()
from fuelsdk-php.
IDK, it's just the way the built the SDK I guess. The way I finally figured it out was by looking at the structure of some soap envelopes. They give you a hint at the code. I saw that ID was nested, and so I tried it with PHP. If you can download one of the free postman collections, it can help you solve some of these things. If it works in the SOAP envelope, it should be the same structure in the code. Also the docs should list the properties that are available as well as the items you can use for filtering.
<?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">{{soapEndPoint}}</a:To>
<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
<o:UsernameToken>
<o:Username>{{soapUsername}}</o:Username>
<o:Password><![CDATA[{{soapPassword}}]]></o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
<!--
<Options>
<SendResponseTo>
<ResponseType>email</ResponseType>
<ResponseAddress>[email protected]</ResponseAddress>
<RespondWhen>OnCallComplete</RespondWhen>
<IncludeResults>true</IncludeResults>
<IncludeObjects>true</IncludeObjects>
</SendResponseTo>
<RequestType>Asynchronous</RequestType>
</Options>
-->
<Objects xsi:type="DataExtension">
<!--
<Client>
<ID>10798224</ID>
</Client>
-->
<CustomerKey>de_custkey</CustomerKey>
<Name>Data Extension Name</Name>
<!-- Specify folder DE created in
<CategoryID>432655</CategoryID>
-->
<IsSendable>true</IsSendable>
<SendableDataExtensionField>
<CustomerKey>SubscriberKey</CustomerKey>
<Name>Subscriber Key</Name>
<FieldType>Text</FieldType>
</SendableDataExtensionField>
<SendableSubscriberField>
<Name>Subscriber Key</Name>
<Value/>
</SendableSubscriberField>
<Fields>
<Field>
<CustomerKey>SubscriberKey</CustomerKey>
<Name>Subscriber Key</Name>
<FieldType>Text</FieldType>
<MaxLength>50</MaxLength>
<IsRequired>true</IsRequired>
<IsPrimaryKey>true</IsPrimaryKey>
</Field>
<Field>
<CustomerKey>EmailAddress</CustomerKey>
<Name>Email Address</Name>
<FieldType>EmailAddress</FieldType>
<IsRequired>true</IsRequired>
<IsPrimaryKey>true</IsPrimaryKey>
</Field>
<Field>
<CustomerKey>FirstName</CustomerKey>
<Name>First Name</Name>
<FieldType>Text</FieldType>
<IsNillable>true</IsNillable>
<IsPrimaryKey>false</IsPrimaryKey>
</Field>
<Field>
<CustomerKey>SignupDate</CustomerKey>
<Name>Signup Date</Name>
<DataType>Date</DataType>
<IsNillable>true</IsNillable>
<IsPrimaryKey>false</IsPrimaryKey>
<FieldType>Date</FieldType>
</Field>
</Fields>
</Objects>
</CreateRequest>
</s:Body>
</s:Envelope>
from fuelsdk-php.
It's been a while, but for retrieving, I think the main thing I used was to pass the MID in the auth call. That should work. (posted above)
from fuelsdk-php.
Related Issues (20)
- [BUG] Authentication fails on newly created packages using Legacy authentication HOT 5
- Is there no way to pull from all business units?
- "Error: API Permission Failed." in ET_Get.php HOT 2
- [BUG] config.php file is already present in my project HOT 5
- [BUG]
- Triggered Send Attributes? HOT 1
- Adding data for a triggered send HOT 1
- Connecting from a local environment HOT 1
- Unable to validate App Keys(ClientID/ClientSecret) w/ Php 7.4.x [BUG] HOT 3
- ET_GetSupportRest does not support URLProps and MoreResults logic not working HOT 1
- ET_DataExtension_Row extends but does not implement Upserts HOT 1
- [Enhancement] Maintain these packages?
- [undefined array index in ET_Client.php in function getAuthTokenExpiration if $tenantKey and $this->tenantTokens are null] HOT 8
- print_r in ET_Perform
- [BUG] PHP 8: Deprecated function: trim(): Passing null to parameter of type string is deprecated.
- [Enhancement] Support firebase/php-jwt version 6
- [BUG] Trying to access array offset on value of type null in ET_Client.php on line 645
- [BUG] php8.0 or upper
- OAuth error on SOAP request HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuelsdk-php.