# Private App Key Migration: Cannot deserialize value of type \`java.lang.String (truncated...

**URL:** <https://community.hubspot.com/t/private-app-key-migration-cannot-deserialize-value-of-type-java-lang-string-truncated/66984>\
**Category:** APIs & Integrations\
**Tags:** php\
**Created:** [October 12, 2022, 6:34pm UTC](https://community.hubspot.com/t/private-app-key-migration-cannot-deserialize-value-of-type-java-lang-string-truncated/66984 "2022-10-12T18:34:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBagrowski](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gbagrowski/32/196611_2.png) [@GBagrowski](https://community.hubspot.com/u/GBagrowski)\
**Post date:** [October 12, 2022, 6:34pm UTC](https://community.hubspot.com/t/private-app-key-migration-cannot-deserialize-value-of-type-java-lang-string-truncated/66984/1 "2022-10-12T18:34:14Z")

</div>

Hi,

Trying to migrate to using the Private App Key.

Running

`$client->crm()->contacts()->batchApi()->create()`

for a list of “inputs” created like:

`$property = ['email' => $email, 'properties' => [ [ 'property' => $customPropertyField1, 'value' => $value1,],//... ],];$batch[] = new SimplePublicObjectInput(['properties' => $property]);// ... above loop finishes``$BatchInputSimplePublicObjectInput = new BatchInputSimplePublicObjectInput(['inputs' => $batch,]);``$apiResponse = $client->crm()->contacts()->batchApi()->create($BatchInputSimplePublicObjectInput);`

Getting the following exception info:

[400] Client error: `POST [https://api.hubapi.com/crm/v3/objects/contacts/batch/create\`](https://api.hubapi.com/crm/v3/objects/contacts/batch/create%5C%60) resulted in a `400 Bad Request` response:  
{“status”:“error”,“message”:"Invalid input JSON on line 1, column 75: Cannot deserialize value of type `java.lang.String (truncated…)

Am I doing something wrong above?

Or is it that I’m using the old data format rather than what I see at [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/contacts) ?

Do I need to perform the create for the custom properties, or should they exist still regardless of the migration?

Thanks,

Glenn

---

<div class="post-metadata">

**Author:** ![skimura](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@skimura](https://community.hubspot.com/u/skimura)\
**Post date:** [October 13, 2022, 10:37am UTC](https://community.hubspot.com/t/private-app-key-migration-cannot-deserialize-value-of-type-java-lang-string-truncated/66984/2 "2022-10-13T10:37:21Z")

</div>

@GBagrowski

Hi.

Input parameter format might be wrong.

```lia-code-sample
// before
$property = [
 'email' => $email,
 'properties' => [
 [
 'property' => $customPropertyField1,
 'value' => $value1,
 ],//...
 ],
];

// after (reference sample code uses this.)
$properties1 = [
 'company' => 'Biglytics',
 'email' => 'bcooper@biglytics.net',
 ...,
];

```

How about use API ‘test call’ ? It is very helpful.

 ![スクリーンショット 2022-10-13 19.30.14.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/0/0b4914953d2eed6f81d6f437a5ec4f7e13b27dd6.jpeg)

Thanks.

---

<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:06pm UTC](https://community.hubspot.com/t/private-app-key-migration-cannot-deserialize-value-of-type-java-lang-string-truncated/66984/3 "2022-11-21T13:06:26Z")

</div>

The JSON is different in V3 than V1. On the same documentation page that is snapped above, scroll down and look at the Response example. It shows properly formatted JSON. It no longer has property & value. So, skimura was on the right track.
