0

I use an undocumented preview API to render email preview.

POST /guide/v1/emails/<emailID>/dataExtension/<DE-Key>/rows/<rowId>/preview?kind=html

To render preview I need to specify exact DataExtension and its row

The problem is with getting an identifier of this row - none of the APIs I know return row Id

I try with SOAP for DataExtensionObject - but it never returns neither ObjectId nor CustomerKey - they are always null, and it doesn't allow to specify these properties for retrieve

I also try undocumented GET /data/v1/customobjectdata/key/<DE-Key>/rowset but it also doesn't return id's

When I generate preview from the browser I see that UI goes to some internal endpoint:
/fuelapi/data-internal/v1/customObjectData/<DE-Key>?showKey=true
identifiers from this endpoint work for preview, but I get 401 Unauthorized for s2s credentials when I call /data-internal/ endpoint

Is there any other way to get a row identifier or point to a row for preview in another way?

  • 2
    Hi, try _CustomObjectKey, which is a hidden field in every data extension, and contains a unique (within this DE) identifier for each row. No idea if used here, but it's where I would start. The field can be used with sql queries, and it should also be exposed when retrieving all fields in a DE. – Jonas Lamberty Sep 29 at 11:50
  • @JonasLamberty This works! Great Thanks! – Denis Kurochkin Sep 29 at 12:16
1

There is a hidden field _CustomObjectKey which is used in AmpScript, this field may also be requested for DataExtensionObject:

Thanks to Jonas Lamberty for a hint!

Request:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <fueloauth>secret</fueloauth>
  </soap:Header>
  <soap:Body>
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI" xmlns:ns2="urn:fault.partner.exacttarget.com">
      <RetrieveRequest>        
        <ObjectType>DataExtensionObject[D9F88129-A6AA-4A55-B625-C807BB0EFE14]</ObjectType>
        <Properties>_CustomObjectKey</Properties>
        <Properties>modulename</Properties>
        <Properties>display</Properties>
        <Properties>country</Properties>
        <Properties>subjectline</Properties>
        <Properties>language</Properties>
      </RetrieveRequest>
    </RetrieveRequestMsg>
  </soap:Body>
</soap:Envelope>

Response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ... >
   <soap:Header> ... </soap:Header>
   <soap:Body>
      <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <OverallStatus>OK</OverallStatus>
         <RequestID>3d71cc49-30e7-4432-97e1-8a31fb0680cf</RequestID>
         <Results xsi:type="DataExtensionObject">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <Type>DataExtensionObject</Type>
            <Properties>
               <Property>
                  <Name>_CustomObjectKey</Name>
                  <Value>13</Value>
               </Property>
               <Property>
                  <Name>modulename</Name>
                  <Value>NamedModule</Value>
               </Property>
               ...
            </Properties>
         </Results>
         <Results xsi:type="DataExtensionObject">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <Type>DataExtensionObject</Type>
            <Properties>
               <Property>
                  <Name>_CustomObjectKey</Name>
                  <Value>42</Value>
               </Property>
               <Property>
                  <Name>modulename</Name>
                  <Value>Subject</Value>
               </Property>
               ...
            </Properties>
         </Results>
      </RetrieveResponseMsg>
   </soap:Body>
</soap:Envelope>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.