function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
James_DeanJames_Dean 

multiple create with one api call..possible?

for example
sf = beatbox._tPartnerNS
svc = beatbox.Client()
svc.login(username, password)
a = { 'type': 'Account',
    'Name': 'New Account',
    'Website': 'http://www.pocketsoap.com/'
    'type': 'Account',
    'Name': 'New Account' 1,
    'Website': 'http://www.pocketsoap.com/'
 }
sr = svc.create(a)
if str(sr[sf.success]) == 'true':
    print "id " + str(sr[sf.id])
Park Walker (TAGL)Park Walker (TAGL)
Yes, you can pass multiple objects to the create call, but not the way you are trying. You need to pass them as an array of objects rather than a single array with multiple objects.

I believe the Ruby code would look like:

a = { 'type': 'Account',
'Name': 'New Account1',
'Website': 'http://www.pocketsoap.com/'}
b = { 'type': 'Account',
'Name': 'New Account2',
'Website': 'http://www.pocketsoap.com/'}
}
sr = svc.create({a,b})

You may want to take a look at the API documentation in the Wiki. It can really help with questions like this.

Park
James_DeanJames_Dean
thats great thanks........that counts as only 1 api call right?.
Park Walker (TAGL)Park Walker (TAGL)
Yes, it's only one API call.