アプリ接続用のAPIトークンを生成し、PCから接続確認を行おうと以下のコマンドを入力しましたが、APIトークンが誤っているとして失敗します。アプリ設定画面から「トークン生成&保存→確認エラー→削除」を繰り返しましたが解消しません。問題個所の特定・対策についてご教示をお願いします。
①サンプルベースの確認
curl -H “X-Cybozu-API-Token: {生成したAPIトークン}” “https://{ドメイン}.cybozu.com/k/v1/record.json?app={アプリID}&id=1”
{“code”:“GAIA_IA02”,“id”:“*認証情報が含まれていたため運営により削除しました*”,“message”:“指定したAPIトークンは、アプリで生成されたトークンと異なります。アプリのAPIトークンの設定を確認してください。設定が正しい場合、APIトークンの設定がアプリに反映されていない場合があります。アプリの設定を更新し、APIトークンの設定をアプリに反映します。”}
②コマンドを調整して確認
curl -v -H “X-Cybozu-API-Token: {生成したAPIトークン}” “https://{ドメイン}.cybozu.com/k/v1/app.json?id={アプリID}” -v
- Host {ドメイン}.cybozu.com:443 was resolved.
- IPv6: (none)
- IPv4: 103.79.14.41, 103.79.14.42
- Trying 103.79.14.41:443…
- schannel: disabled automatic use of client certificate
- ALPN: curl offers http/1.1
- ALPN: server accepted http/1.1
- Established connection to {ドメイン}.cybozu.com (103.79.14.41 port 443) from {IPアドレス} port 55894
- using HTTP/1.x
GET /k/v1/app.json?id={アプリID} HTTP/1.1
Host: {ドメイン}.cybozu.com
User-Agent: curl/8.16.0
Accept: /
X-Cybozu-API-Token: {生成したAPIトークン}
- Request completely sent off
- schannel: remote party requests renegotiation
- schannel: renegotiating SSL/TLS connection
- schannel: SSL/TLS connection renegotiated
- schannel: remote party requests renegotiation
- schannel: renegotiating SSL/TLS connection
- schannel: SSL/TLS connection renegotiated
< HTTP/1.1 400 Bad Request
< Server: nginx
< Date: Fri, 12 Dec 2025 03:09:54 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 424
< Connection: keep-alive
< X-Frame-Options: SAMEORIGIN
< Referrer-Policy: same-origin
< Cache-Control: no-cache, no-store, must-revalidate
< X-ConcurrencyLimit-Limit: 100
< X-ConcurrencyLimit-Running: 1
< X-Cybozu-Error: GAIA_IA02
< Strict-Transport-Security: max-age=315360000; includeSubDomains; preload;
< X-Content-Type-Options: nosniff
< X-Robots-Tag: noindex,nofollow
< Set-Cookie: __ctc=Z08OKWk7h4JKv/x9BArxAg==; expires=Mon, 10-Dec-35 03:09:54 GMT; domain=cybozu.com; path=/
<
{“code”:“GAIA_IA02”,“id”:“*認証情報が含まれていたため運営により削除しました*”,“message”:“指定したAPIトークンは、アプリで生成されたトークンと異なります。アプリのAPIトークンの設定を確認してください。設定が正しい場合、APIトークンの設定がアプリに反映されていない場合があります。アプリの設定を更新し、APIトークンの設定をアプリに反映します。”}* Connection #0 to host {ドメイン}.cybozu.com:443 left intact
③httpbinでのヘッダー情報確認(送信途中で棄損していないか⇒一致を確認済み)
Invoke-RestMethod -Uri ‘https://httpbin.org/anything’ -Method Get -Headers @{ ‘X-Cybozu-API-Token’ = ‘生成したAPIトークン’ }
args :
data :
files :
form :
headers : @{Host=httpbin.org; User-Agent=Mozilla/5.0 (Windows NT; Windows NT 10.0; ja-JP) WindowsPowerShell/5.1.26100.7019; X-Amzn-T
race-Id=Root=1-693b851d-4a32c5517a00ed8504c2261d; X-Cybozu-Api-Token=生成したAPIトークン}
json :
method : GET
origin : 111.98.253.139
url : https://httpbin.org/anything
よろしくお願いします。
コードをここに入力または貼り付け