Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

exposing retrieveRequest #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pentium10
Copy link

@pentium10 pentium10 commented Jul 22, 2019

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();

@pentium10
Copy link
Author

@manivinesh @sfdrogojan can you look into this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant