I am looking through beatbox's github repo here https://github.com/superfell/Beatbox/blob/master/beatbox/_beatbox.py#L122

And I am not sure whether I am using it correctly, specifically I am not sure if I am supplying the correct ExternalIdName argument. I keep getting this error *** KeyError: 'type'

So here is what I am currently doing

import beatbox

# login creds here
sf = beatbox.Client()
sf.serverUrl = 'https://test.salesforce.com/services/Soap/u/38.0'
sf.login(my_username, my_password+my_token)

data = [{'test_field__c': 'test_value', 'account__c': account_id}]  # account_id here is the parent lookup column

# my attempts to use the "upsert" method. I want to insert new records into my custom object called Test_Object
sf.upsert(externalIdName='Test_Object', sObjects=data)  # this fails
sf.upsert(externalIdName='Test_Object__c', sObjects=data) # this also fails
sf.upsert(externalIdName='0123456789abcde', sObjects=data) # i tried using the 15 character string that is assigned to my custom object and this also fails

The error is some generic message that doesn't give a whole of insight into the problem:

*** KeyError: 'type'

  • possible that you might to convert your data to JSON using a JSON encoder – glls Apr 17 at 12:02

Your Answer

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

Browse other questions tagged or ask your own question.