APIs & Integrations

WSuren
Mitglied

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

lösung

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 Akzeptierte Lösung
WSuren
Lösung
Mitglied

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

lösung

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. 

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten
WSuren
Lösung
Mitglied

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

lösung

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. 

dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

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

lösung

@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?

0 Upvotes