/crm/v3/objects/deals/batch/update does not seem to work - Cannot deserialize instance of `java.util

SOLVE
WSuren
Member

Hello,

 

On the V3 API itself, this page, I try out the Update a batch of deals function for python and it works on the page with the given input data, giving a 200 return code. But when I copy paste exactly that code as python to my local machine it gives an error.

 

What am I doing wrong?

 

code

import hubspot
from hubspot.crm.deals import BatchInputSimplePublicObjectBatchInput, ApiException

client = hubspot.Client.create(api_key="xxxxxxxx")

batch_input_simple_public_object_batch_input = BatchInputSimplePublicObjectBatchInput(

inputs={"properties":{"test_wouter_data_import":"1"},"id":"2015419691"})
api_response = client.crm.deals.batch_api.update(

batch_input_simple_public_object_batch_input=batch_input_simple_public_object_batch_input)

 

400 code response on local machine

Invalid input JSON on line 1, column 12: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token"

 

0 Upvotes
1 Accepted solution

Accepted Solutions
WSuren
Solution
Member

I found what's wrong: the code on the API page is not correct when you test with one ID, since it forgets to add the square brackets

 

replacing this code:

inputs={"properties":{"test_wouter_data_import":"1"},"id":"2015419691"})

with this:

inputs=[{"properties":{"test_wouter_data_import":"1"},"id":"2015419691"})]

 

fixed it for me. 

View solution in original post

2 Replies 2
dennisedson
Community Manager

@taran42 , eventually I will have a tshirt with your name and python on it.  It won't be weird 😜

Until then, could you help out here?

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
WSuren
Solution
Member

I found what's wrong: the code on the API page is not correct when you test with one ID, since it forgets to add the square brackets

 

replacing this code:

inputs={"properties":{"test_wouter_data_import":"1"},"id":"2015419691"})

with this:

inputs=[{"properties":{"test_wouter_data_import":"1"},"id":"2015419691"})]

 

fixed it for me. 

View solution in original post