0
私は、RESTを介してGoogleカスタム検索を使用するウェブアプリを持っています。これまでのところ、すべてうまくいきましたが、割り当てられた毎日のクォータを超えると、ユーザーにいくつかの情報を提供したいと考えています。私はこのJSONレスポンスを取得し、response.error.codeとresponse.error.messageを使用して "code"と "message"データにアクセスできますが、サブセット "errors"にアクセスする方法、特に "reason "このGoogleカスタム検索エラー配列の内部データにアクセスするにはどうすればよいですか?
これはJSONの質問ですが、私はそれに多くの経験がありません。 これは私が受け取るJSON構造であり、私は違うことをしようとして解決策を見つけた
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceeded",
"message": "This API requires billing to be enabled on the project. Visit https://console.developers.google.com/billing?project=323544036192 to enable billing.",
"extendedHelp": "https://console.developers.google.com/billing?project=323544036192"
}
],
"code": 403,
"message": "This API requires billing to be enabled on the project. Visit https://console.developers.google.com/billing?project=323544036192 to enable billing."
}
}