問題の内容
アクセストークンを取得しようとすると、エラーメッセージが表示されます。
{"error":"invalid_grant",
"error_description":"The provided access grant is invalid,
expired, or revoked (e.g. invalid assertion, expired authorization
token, bad end-user password credentials, or mismatching authorization
code and redirection URI).
解決のステップ
リダイレクトURLに使用されるパラメータが、以下に示すようにredirect_uri
であることを確認し、斜体の部分をデータで置き換えます。
curl https://yoursubdomain.zendesk.com/oauth/tokens \ -H "Content-Type: application/json" \ -d '{"grant_type": "authorization_code", "code": "your_code", "client_id": "your_client_id", "client_secret": "your_client_secret", "redirect_uri": "your_redirect_url", "scope": "read" }' \ -X POST
重要:パラメータは
redirect_uri
でなければなりません。
詳細については、次の記事を参照してください:「アプリでのOAuth認証の使用」