Git Product home page Git Product logo

Comments (10)

pentium10 avatar pentium10 commented on August 17, 2024 1

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.

pentium10 avatar pentium10 commented on August 17, 2024

@garek007 do you know how can we push/filter DataExtensions based on Client.ID

from fuelsdk-php.

garek007 avatar garek007 commented on August 17, 2024

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.

pentium10 avatar pentium10 commented on August 17, 2024

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.

garek007 avatar garek007 commented on August 17, 2024

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.

pentium10 avatar pentium10 commented on August 17, 2024

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.

garek007 avatar garek007 commented on August 17, 2024

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.

pentium10 avatar pentium10 commented on August 17, 2024

however now I don't know the reason why sometimes there is a function

  • filter()
    and sometimes
  • retrieveRequest()

from fuelsdk-php.

garek007 avatar garek007 commented on August 17, 2024

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.

garek007 avatar garek007 commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.