deleteCustomObjects API giving "Unexpected error" | Community
Skip to main content
Level 2
January 27, 2021
Question

deleteCustomObjects API giving "Unexpected error"

  • January 27, 2021
  • 1 reply
  • 1493 views

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>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
January 27, 2021

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.)

Level 2
January 28, 2021

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
January 28, 2021
If it's a compound dedupe key I don't see how you could delete with only one value provided.