deleteCustomObjects API giving "Unexpected error"

vijayanandpaul
Level 2

deleteCustomObjects API giving "Unexpected error"

Hello All,

I am seeing a strange behaviour with the Marketo deleteCustomObjects API. I am sending a delete operation for a custom object key list but I get status as FAILED with "Unexpected error" in the error. I am sending 1 key field in the delete operation out of 2 fields that the custom table has. 

 

Request:

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt="http://www.marketo.com/mktows/">
<soapenv:Header>
<mkt:AuthenticationHeader>
<mktowsUserId>MKxxxxxx </mktowsUserId>
<requestSignature>18900xxxxxxxxxxx</requestSignature>
<requestTimestamp>2021-01-27T13:21:32-08:00</requestTimestamp>
</mkt:AuthenticationHeader>
</soapenv:Header>
<soapenv:Body>
<ns1:paramsDeleteCustomObjects xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">
<objTypeName>opptyWithProductContactRoles_c</objTypeName>
<customObjKeyLists>
<keyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrValue>00k3900000bS1ieAAC</attrValue>
</attribute>
</keyList>
<keyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrValue>00k3900000bS1igAAC</attrValue>
</attribute>
</keyList>
<keyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrValue>00k3900000bS1iiAAC</attrValue>
</attribute>
</keyList>
<keyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrValue>00k3900000bS1ikAAC</attrValue>
</attribute>
</keyList>
</customObjKeyLists>
</ns1:paramsDeleteCustomObjects>
</soapenv:Body>
</soapenv:Envelope>

 

Response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">
<SOAP-ENV:Body>
<ns1:successDeleteCustomObjects>
<result>
<deleteCustomObjStatusList>
<syncCustomObjStatus>
<objTypeName>opptyWithProductContactRoles_c</objTypeName>
<customObjKeyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrType xsi:nil="true"/>
<attrValue>00k3900000bS1ieAAC</attrValue>
</attribute>
</customObjKeyList>
<status>FAILED</status>
<error>Unexpected error</error>
</syncCustomObjStatus>
<syncCustomObjStatus>
<objTypeName>opptyWithProductContactRoles_c</objTypeName>
<customObjKeyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrType xsi:nil="true"/>
<attrValue>00k3900000bS1igAAC</attrValue>
</attribute>
</customObjKeyList>
<status>FAILED</status>
<error>Unexpected error</error>
</syncCustomObjStatus>
<syncCustomObjStatus>
<objTypeName>opptyWithProductContactRoles_c</objTypeName>
<customObjKeyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrType xsi:nil="true"/>
<attrValue>00k3900000bS1iiAAC</attrValue>
</attribute>
</customObjKeyList>
<status>FAILED</status>
<error>Unexpected error</error>
</syncCustomObjStatus>
<syncCustomObjStatus>
<objTypeName>opptyWithProductContactRoles_c</objTypeName>
<customObjKeyList>
<attribute>
<attrName>oppLineItemID</attrName>
<attrType xsi:nil="true"/>
<attrValue>00k3900000bS1ikAAC</attrValue>
</attribute>
</customObjKeyList>
<status>FAILED</status>
<error>Unexpected error</error>
</syncCustomObjStatus>
</deleteCustomObjStatusList>
</result>
</ns1:successDeleteCustomObjects>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: deleteCustomObjects API giving "Unexpected error"

Can you show a getCustomObjects for one of those? (We really just need to look at one example, it's more confusing to look at the batch.)

vijayanandpaul
Level 2

Re: deleteCustomObjects API giving "Unexpected error"

Ok, Here is the thing. If I give the 2 key values , getCustomObjects is retrieving the custom record but it gives a "Partial key must include leading keys (20114)" if I provide only 1 key. 

 

My requirement is to delete the record with 1 key. Now I know that I can delete with both keys. Any work around for this ?

 

Thanks,

Paul.

SanfordWhiteman
Level 10 - Community Moderator

Re: deleteCustomObjects API giving "Unexpected error"

If it's a compound dedupe key I don't see how you could delete with only one value provided.