# /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:** 5

<div class="post-metadata">

**Author:** ![KMurota](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kmurota/32/61991_2.png) [@KMurota](https://community.hubspot.com/u/KMurota)\
**Post date:** [August 1, 2022, 12:00pm UTC](https://community.hubspot.com/t/crm-v3-objects-contacts-search-invalid-input-json/62054/5 "2022-08-01T12:00:28Z")

</div>

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

1. “sorts”:[“email”] でもリクエストは通ります(タイプミスがあっても通りますが)。デフォルトではASCENDINGなので、

`"direction"`

はDESCENDINGにしたい場合に利用するイメージだと思っています。

- すでにご覧になっていると思いますが、海外CommunityでもPHPライブラリのエラーが報告されていますね。PHPは全く知らないのですが、[]のCollectionとArrayの区別がライブラリがうまくつけられていないようです。解決策も結局「curlのwrapperを使った」というのが最終的なようです。  
[https://community.hubspot.com/t5/APIs-Integrations/Api-search-contact-by-email-in-php-invalid-json/td-p/496462](https://community.hubspot.com/t5/APIs-Integrations/Api-search-contact-by-email-in-php-invalid-json/td-p/496462)  
[https://community.hubspot.com/t5/APIs-Integrations/Problem-with-API-contacts-search-using-php-client-library/m-p/575002](https://community.hubspot.com/t5/APIs-Integrations/Problem-with-API-contacts-search-using-php-client-library/m-p/575002)  
コミュニティの報告にも関わらず放置されているところを見ると、ライブラリを諦めて、httpクライアントを使用した方がいい気がします。  
ちなみに、curlとPythonでは、「空プロパティが時々入り込む」という以外は今のところバグに当たったことはないので、JavaScriptとPythonの方が力が入っているのでしょうか？？と勘ぐってしまいます。

- もしSearchの値がテストでemailにしているだけでなく本当にemailなのであれば、V1で

- 余談ですが、VS Codeお使いであれば、 ~~Thunder Client~~ Rapid API Clientというaddonがいいですよ！  
- PostManのようにリクエストを設定でき、  
- PostManのWorkspace=\>新しいタブを開く=\>TEXT-\>Raw-\>JSONを選択  
というのが若干邪魔くさかったのが省略され  
- リクエストを各言語に変換できます。  
過去のリクエスト履歴も勝手に残していってくれるので再利用しやすいです。

---

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