FuelSDK-PHP
FuelSDK-PHP copied to clipboard
exposing retrieveRequest
In order to work correctly with DataExtensions when it's being created on the parent account, you need to pass "ClientIDs" also at the Get calls as well.
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<ClientIDs>
<ClientID>1234567</ClientID>
</ClientIDs>
<!-- ...snippet end...-->
In order to make this possible, we
- exposed retrieveRequest to be able to pull the data
- modified post() to accept custom arrays
final working examples are like this:
create DataExtensions with custom ClientID
$postDRRow = new ET_DataExtension_Row();
$postDRRow->authStub = $this->soap_client;
$postDRRow->CustomerKey = $customerKey;
$objects = array(
'Client' => array('ID' => $this->client_id),
);
foreach ($props as $key => $value) {
$fields[] = array("Name" => $key, "Value" => $value);
}
$objects['CustomerKey'] = 'DataExtensionName';
$objects['Properties'] = array("Property" => $fields);
$res = $postDRRow->post($objects); /*<-- pass custom objects*/
and for retrieving custom DataExtensions
$getDERows = new ET_DataExtension_Row();
$getDERows->authStub = $this->soap_client;
$getDERows->retrieveRequest['ClientIDs'] = array('ID' => $this->client_id); /* <-- new exposed property*/
$getDERows->props = array(<edited attributes>'');
$getDERows->Name = $customerKey;
$getDERows->CustomerKey = $customerKey;
$res = $getDERows->get();
@manivinesh @sfdrogojan can you look into this?