Power Automateからカスタムコネクタを呼び出したときに「 requires the property ‘body’ to be of type ‘Object’ but is of type ‘String’.」というエラーが出てしばらくはまったので対処方法をメモ。
今回使用したカスタムコネクタ
今回作成したカスタムコネクタはこちら。


郵便番号を送ると住所を返してくれるAPIで、特に認証とかも不要なのでテストも問題なく成功。


Power Appsでも問題なく動作する。


ただこのカスタムコネクタをPower Automateで使用したときにエラーが発生。
発生したエラー
ということで今回発生したエラーはこちら。


エラー全文
The API ‘API名’ returned an invalid response for workflow operation ‘API名’ of type ‘OpenApiConnection’. Error details: ‘The API operation ‘API名’ requires the property ‘body’ to be of type ‘Object’ but is of type ‘String’.’
「bodyはオブジェクト型が入るはずなのに、文字列が入っている」というエラーっぽいんだけど、原因がわからず。。
原因
で、しばらく色々探してみると以下の記事を発見。
どうやら原因はカスタムコネクターのポリシーを設定していないから、とのこと。
![]()
どうやら原因はカスタムコネクターのポリシーを設定していないから、とのこと。
Custom connector issue with body type
Hi! I'm facing issues with an simple custom connector that i created. I have an API with Azure Functions + APIM and i ...
ということでポリシーで「Content-Type」をきちんと設定してあげると、

エラーなく動作するようになった!


ということでカスタムコネクタを作るときはポリシーもきちんと設定しようというお話。
※今回使用した郵便番号のAPIはこちら
![]()
郵便番号検索API - zipcloud
日本郵便が公開している郵便番号データを検索する機能をRESTで提供しています。
コメント