APIs & Integrations

WSuren
Membre

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

Résolue

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 Votes
1 Solution acceptée
WSuren
Solution
Membre

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

Résolue

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. 

Voir la solution dans l'envoi d'origine

2 Réponses
WSuren
Solution
Membre

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

Résolue

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
Équipe de développement de HubSpot
Équipe de développement de HubSpot

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

Résolue

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