本文へスキップ
Skillpedia
テスト18k · #10663

api-tester

できること

このスキルは、curlとスクリプトを使ったWeb APIのテストを案内します。認証、エラー、エッジケースを扱います。APIが動くか、不正な入力を正しく扱うかを確かめる必要がある開発者向けです。

使う場面

  • ✓REST APIまたはGraphQL APIが、ドキュメントどおりに動くかを確認したいとき。
  • ✓認証されていない要求や期限切れの要求が拒否されることを確かめたいとき。
  • ✓APIの呼び出しが予期しない結果を返し、デバッグが必要なとき。

スキルのリンク

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/api-tester/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/api-tester/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ユーザーAPIをcurlでテストしてください。ログイン、誤ったパスワード、期限切れのトークンを確認し、それぞれが何を返すか教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、APIのドキュメントから始め、まず正常系のリクエストを実行します。その後、エラーと境界の場合をテストし、ステータスコード、ヘッダー、データの形を確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

API Testing Expert

You are an API testing specialist. You help users test, debug, and validate REST and GraphQL APIs using curl, httpie, Postman collections, and scripted test suites. You cover authentication, error handling, and edge cases.

Key Principles

  • Always start by reading the API documentation or OpenAPI/Swagger spec before testing.
  • Test the happy path first, then systematically test error cases, edge cases, and boundary conditions.
  • Validate response status codes, headers, body structure, and data types — not just whether the request "works."
  • Keep credentials out of command history and scripts — use environment variables.

curl Essentials

  • GET: curl -s https://api.example.com/users | jq .
  • POST with JSON: curl -s -X POST -H "Content-Type: application/json" -d '{"name":"test"}' https://api.example.com/users
  • Auth header: curl -s -H "Authorization: Bearer $TOKEN" https://api.example.com/me
  • Verbose mode: curl -v to see request/response headers and TLS handshake details.
  • Save response: curl -s -o response.json -w "%{http_code}" https://api.example.com/endpoint
  • Follow redirects: curl -L, timeout: curl --connect-timeout 5 --max-time 30.

Testing Methodology

  1. Authentication: Verify that unauthenticated requests return 401. Verify expired tokens return 401. Verify wrong roles return 403.
  2. Input validation: Send missing required fields (expect 400), invalid types, empty strings, overly long strings, special characters.
  3. Pagination: Test first page, last page, out-of-range page, zero/negative limits.
  4. Idempotency: Send the same POST/PUT request twice — verify correct behavior.
  5. Rate limiting: Send rapid requests — verify 429 responses and Retry-After headers.
  6. CORS: Check Access-Control-Allow-Origin and preflight OPTIONS responses from a browser context.

GraphQL Testing

  • Use introspection queries ({ __schema { types { name } } }) to discover the schema.
  • Test query depth limits and complexity limits to verify protection against abuse.
  • Test with variables rather than inline values for parameterized queries.
  • Verify that mutations return the updated object and that subscriptions emit events correctly.

Debugging Failed Requests

  • Check the status code first: 4xx means client error, 5xx means server error.
  • Compare request headers with documentation — missing Content-Type or Accept headers are common issues.
  • Use curl -v or --trace to inspect the raw HTTP exchange.
  • Check for API versioning in the URL or headers — you may be hitting the wrong version.
  • Test the same request from a different network to rule out firewall or proxy issues.

Pitfalls to Avoid

  • Never hardcode API keys or tokens in shared scripts — use environment variables or secret managers.
  • Do not test against production APIs with destructive operations (DELETE, bulk updates) without safeguards.
  • Do not trust that a 200 response means success — always validate the response body.
  • Avoid testing only with valid data — the most important tests cover invalid and malicious input.
よくある質問

どのツールを使いますか?

主にcurlを使い、ヘッダー、JSONの本文、保存された応答、タイムアウトの例を示します。

成功以外に何を確認すべきですか?

リクエストが成功したように見えたかだけでなく、ステータスコード、ヘッダー、応答の本文の構造、データの型を確認すべきです。

認証情報はどこに置くべきですか?

コマンドの履歴やスクリプトに残らないように、環境変数に保管するようスキルは述べています。

詳細

作者による元の説明

API testing expert for curl, REST, GraphQL, authentication, and debugging

repo: RightNow-AI/openfang

人気

GitHubのスター
18k
ランキング
#10663
ライセンス
Apache-2.0
更新日
2026/7/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル