# Java exception/error included in API response

**URL:** <https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079>\
**Category:** APIs & Integrations\
**Tags:** sdk\
**Created:** [May 31, 2022, 7:41pm UTC](https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079 "2022-05-31T19:41:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbkulinski](https://avatars.discourse-cdn.com/v4/letter/l/c67d28/32.png) [@lbkulinski](https://community.hubspot.com/u/lbkulinski)\
**Post date:** [May 31, 2022, 7:41pm UTC](https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079/1 "2022-05-31T19:41:34Z")

</div>

Hello

I’ve been using HubSpot’s custom objects API ([https://api.hubspot.com/crm/v3/objects/{fullyQualifiedName}](https://api.hubspot.com/crm/v3/objects/%7BfullyQualifiedName%7D)) and ran into an interesting response that contained a Java exception/error. I am using PHP with curl to interact with the API. The response is as follows:

```lia-code-sample
{
 "status": "error",
 "message": "Invalid input JSON on line 1, column 370: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)",
 "correlationId": "_redacted_"
}

```

I was able to correct the error on my end, but thought this was a confusing response. I thought I would make you aware of it.

Thanks

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [June 1, 2022, 4:46pm UTC](https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079/2 "2022-06-01T16:46:05Z")

</div>

@lbkulinski

Thanks for pointing this out! Will report to the team to make the messaging more useful!

---

<div class="post-metadata">

**Author:** ![lbkulinski](https://avatars.discourse-cdn.com/v4/letter/l/c67d28/32.png) [@lbkulinski](https://community.hubspot.com/u/lbkulinski)\
**Post date:** [June 1, 2022, 4:47pm UTC](https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079/3 "2022-06-01T16:47:18Z")

</div>

No problem! As a Java afficionado I was able to deduce the error, but just thought I’d share. Thank you!

---

<div class="post-metadata">

**Author:** ![EDash](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@EDash](https://community.hubspot.com/u/EDash)\
**Post date:** [November 21, 2022, 1:41am UTC](https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079/4 "2022-11-21T01:41:20Z")

</div>

Could you please share more information on how you resolved the error? I am getting this same (confusing) error in my PHP with curl attempt to use: [https://api.hubapi.com/crm/v3/objects/contacts](https://api.hubapi.com/crm/v3/objects/contacts)

I am baffled as to what is the problem. I have looked through documentation and this forum, but have not found anything that helps to resolve this issue yet. Thanks for any insights!

---

<div class="post-metadata">

**Author:** ![EDash](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@EDash](https://community.hubspot.com/u/EDash)\
**Post date:** [November 21, 2022, 4:49am UTC](https://community.hubspot.com/t/java-exception-error-included-in-api-response/58079/5 "2022-11-21T04:49:31Z")

</div>

Nevermind … I figured it out. The JSON is simply different in API v3.
