• Live group demo of Marketing Hub + Data Agent

    Standardize reporting, reduce manual work, and introduce AI without cleanup

    Join us on March 12
  • Ready to build your local HubSpot community?

    HUG leaders host events, spark connections, and create spaces where people learn and grow together.

    Become a HUG Leader

Error: Cannot Deserialize

NSaad
Member

I'd like to know why the following request fails with this error. It's not clear as to what's going on, as it matches the expected format.

 

Error:

`{"status":"error","message":"Invalid input JSON on line 1, column 17: Cannot deserialize value of type `java.util.ArrayList<com.hubspot.crmpublic.core.models.associations.PublicAssociationsForObject>` from Object value (token `JsonToken.START_OBJECT`)","correlationId":"REDACTED"}`

 

Request Sent (Sent as one line, but multiline here for ease of viewing):

```

{
"inputs": [
{
"idProperty": "email",
"id": "aaa@aaa.com",
"properties": {
"email": "aaa@aaa.com",
"firstname": "Aaa",
"lastname": "Bbb",
"address": "123 Main St",
"city": "Edmonton",
"state": "AB ",
"zip": "T6W2R6",
"phone": "+11231231234"
}
}
]
}

```

This page shows the following sample format: https://developers.hubspot.com/beta-docs/guides/api/crm/objects/contacts#upsert-contacts

 

```

// Example request body with email
// POST /crm/v3/objects/contacts/batch/upsert
{
"inputs": [
{
"properties": {
"phone": "5555555555"
},
"id": "test@test.com",
"idProperty": "email"
},
{
"properties": {
"phone": "7777777777"
},
"id": "example@hubspot.com",
"idProperty": "email"
}
]
}

```

 

Please note that I have tried truncating the properties to just send the email. So, it's not that. Any help is greatly appreciated.

0 Upvotes
1 Accepted solution
GiantFocal
Solution
Top Contributor | Gold Partner
Top Contributor | Gold Partner

Hi @NSaad,

 

You'll need to ensure your request follows the exact format from the HubSpot API documentation:

 

{
  "inputs": [
    {
      "properties": {
        "phone": "5555555555"
      },
      "id": "test@test.com",
      "idProperty": "email"
    }
  ]
}

 

The order of properties in the request matters. You should put properties first, followed by id and idProperty. Also, remember to remove any extra whitespace or formatting.

Stop hiring HubSpot developers.

Get an entire team (design, dev, RevOps) for less than 1 hire.
48-hour start • No contracts • Unlimited requests

View solution in original post

1 Reply 1
GiantFocal
Solution
Top Contributor | Gold Partner
Top Contributor | Gold Partner

Hi @NSaad,

 

You'll need to ensure your request follows the exact format from the HubSpot API documentation:

 

{
  "inputs": [
    {
      "properties": {
        "phone": "5555555555"
      },
      "id": "test@test.com",
      "idProperty": "email"
    }
  ]
}

 

The order of properties in the request matters. You should put properties first, followed by id and idProperty. Also, remember to remove any extra whitespace or formatting.

Stop hiring HubSpot developers.

Get an entire team (design, dev, RevOps) for less than 1 hire.
48-hour start • No contracts • Unlimited requests