# /crm/v3/objects/contacts/searchにてInvalid input JSON発生

**URL:** <https://community.hubspot.com/t/crm-v3-objects-contacts-search-invalid-input-json/62054>\
**Category:** Tips, Tricks & Best Practices\
**Tags:** enterprise\
**Created:** [August 1, 2022, 4:42am UTC](https://community.hubspot.com/t/crm-v3-objects-contacts-search-invalid-input-json/62054 "2022-08-01T04:42:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![assi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/assi/32/25699_2.png) [@assi](https://community.hubspot.com/u/assi)\
**Post date:** [August 1, 2022, 10:30am UTC](https://community.hubspot.com/t/crm-v3-objects-contacts-search-invalid-input-json/62054/4 "2022-08-01T10:30:51Z")

</div>

[@吉田成一](https://community.hubspot.com/t5/user/viewprofilepage/user-id/345451)

前提として、API ドキュメント内のAPIを実行できる箇所はあまり信用しない方が多いです。バグが多く、またAPI自体のアップデートに追いついていないことも多いので……。（現にまだ非公開アプリに対応できていません）

本題ですが、上記コメントの

\> エラーを次のように回避（ググった記事を参考にしました）

のコードを確認しました。ざっと見るに、sortの書き方が違うように思います。

一度削除してみるか、もしくは下記の形式で記述してみるといかがでしょうか？

```lia-code-sample
"sorts": [
 {
 "propertyName": "createdate",
 "direction": "DESCENDING"
 }
]

```

searchエンドポイントの書式については、下記のドキュメントページが詳しいです。

> **[Search the CRM - HubSpot docs](https://developers.hubspot.com/docs/api-reference/latest/crm/search-the-crm)**
>
> The CRM search endpoints make getting data more efficient by allowing developers to filter, sort, and search across any CRM object type.

余談ですが、私がAPIを試す際はドキュメントを見つつ、Postmanにてリクエストボディを書いてテストすることが多いです。使いこなせばかなり便利で、APIドキュメント上での実行よりもお勧めです。

---

_[View the full topic](https://community.hubspot.com/t/crm-v3-objects-contacts-search-invalid-input-json/62054)._
