Re: Parameters to issue GetCustomObjects request

Anonymous
Not applicable

Parameters to issue GetCustomObjects request

I need to send a GetCustomObjects method request, in order to retrieve data from a Marketo Custom object (not a SF synched custom object).

I have these parameters in method (among others)

objTypeName
customObjKeyList
includeAttributes

I guess objTypeName refers to the name of the custom object
What exactly are the other ones for?

Thanks
Tags (1)
5 REPLIES 5
Anonymous
Not applicable

Re: Parameters to issue GetCustomObjects request

Juan Pablo,
  • objTypeName = Name of the custom object
  • customObjKeyList = ArrayOfAttribute where each Attribute contains a "Key" field and value you are searching for.  The array can contain any of the fields that you created as key fields at the time of custom obj creation.  If you don't know the list of key fields, please contact customer support and they'll be able to help you
  • includeAttributes = List of attributes you wish to fetch. 
Anonymous
Not applicable

Re: Parameters to issue GetCustomObjects request

Thanks... I have a little problem now... (two, in fact).
1. I know the key field of my custom object, it's name is testID... The custom object has two records (with testID values 1 and 2). Sending the getCustomObjects request with just one Attribute (with testID 1 for example) I am getting the desired record... also if I send the request with testID 2. But if I want to get both, by sending the two keys in the ArrayOfAttributes, I get an error...

here you can see the XML request and the response with the error

REQUEST:
    <paramsGetCustomObjects xmlns="http://www.marketo.com/mktows/">
      <objTypeName xmlns="">CustomTest</objTypeName>
      <streamPosition xsi:nil="true" xmlns=""/>
      <customObjKeyList xmlns="">
        <attribute>
          <attrName>testID</attrName>
          <attrType>integer</attrType>
          <attrValue>1</attrValue>
        </attribute>
        <attribute>
          <attrName>testID</attrName>
          <attrType>integer</attrType>
          <attrValue>2</attrValue>
        </attribute>
      </customObjKeyList>
      <includeAttributes xmlns="">
        <stringItem>testID</stringItem>
        <stringItem>ObjectID</stringItem>
      </includeAttributes>
    </paramsGetCustomObjects>
 
RESPONSE:
    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Server</faultcode>
      <faultstring>Internal error</faultstring>
      <detail>
        <ns1:serviceException xmlns:ns1="http://www.marketo.com/mktows/">
          <name>mktValidationException</name>
          <message>Duplicate name in key list: testID</message>
          <code>10001</code>
        </ns1:serviceException>
      </detail>
    </SOAP-ENV:Fault>

What am I doing wrong?

Thanks

Anonymous
Not applicable

Re: Parameters to issue GetCustomObjects request

Juan Pablo,
You can specify multiple attributes in the customObjKeyLists, but we do not currently support duplicate values for the Key's AttrName.

In other words, you can query for all objects matching Key1="Val1" and Key2="Val2", but not Key1="Val1" and Key1="Val2"

Anonymous
Not applicable

Re: Parameters to issue GetCustomObjects request

Thanks.. that really helps.. so, basically, I will get more than one record if I have more than one record matching the those "conditions"... but I can't send a request that will bring more than one record with different values in that field...

now.... one last thing... I have a custom object that was created for testing purposes... we need to know if any of the fields in this custom object references to a leadID or any field belonging to leads... and also need to know how to associate leads (if it can be done) to this custom object...

thanks!
Anonymous
Not applicable

Re: Parameters to issue GetCustomObjects request

You should contact customer support - they will be able to help you with this.