{"id":20145,"date":"2023-01-18T06:40:17","date_gmt":"2023-01-18T06:40:17","guid":{"rendered":"https:\/\/44.225.35.201\/testrail\/docs\/801\/api-manual\/getting-started-with-testrail-api\/accessing-the-testrail-api\/"},"modified":"2025-11-07T22:42:50","modified_gmt":"2025-11-07T13:42:50","slug":"accessing-api","status":"publish","type":"page","link":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/api-manual\/getting-started-with-testrail-api\/accessing-api\/","title":{"rendered":"TestRail API \u3078\u306e\u30a2\u30af\u30bb\u30b9"},"content":{"rendered":"<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/TestRail_API-Navy-Logo.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/TestRail_API-Navy-Logo-300x121.png\" alt=\"\" width=\"300\" height=\"121\" class=\"alignnone wp-image-27825 size-medium\" \/><\/a><\/p>\n<p>TestRail \u306e API \u306f HTTP \u30d9\u30fc\u30b9\u3067\u3042\u308a\u3001\u5358\u7d14\u306a HTTP \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u5bfe\u8a71\u3067\u304d\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u66f8\u304d\u8fbc\u307f\u30ea\u30af\u30a8\u30b9\u30c8\u306f HTTP POST \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u3059\u3079\u3066\u306e\u8aad\u307f\u53d6\u308a\u30ea\u30af\u30a8\u30b9\u30c8\u306f HTTP GET \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306f UTF-8 \u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e <a href=\"http:\/\/json.org\/\" target=\"_blank\" rel=\"noopener\"><strong>JSON<\/strong><\/a> \u5f62\u5f0f\u3067\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u8a8d\u8a3c<\/h2>\n<p>TestRail \u306f\u3001API \u306e\u8a8d\u8a3c\u60c5\u5831\u304c\u6a19\u6e96\u7684\u306a HTTP \u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\u306b\u3088\u3063\u3066\u6307\u5b9a\u3055\u308c\u308b\u3068\u671f\u5f85\u3057\u307e\u3059\u3002TestRail \u3067 API \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u8a8d\u8a3c\u3059\u308b\u65b9\u6cd5\u306f2\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9<\/h3>\n<p>\u6a19\u6e96\u306e TestRail \u30e6\u30fc\u30b6\u30fc\u540d (\u901a\u5e38\u306f\u96fb\u5b50\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9) \u3068 TestRail \u30d1\u30b9\u30ef\u30fc\u30c9\u3092 TestRail \u306b\u6e21\u3057\u3066 API \u8a8d\u8a3c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306f HTTP \u306e\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\u3067\u9001\u4fe1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>TestRail \u8a8d\u8a3c\u306e\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u901a\u5e38\u306e Active Directory \u307e\u305f\u306f LDAP \u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3042\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059 (TestRail \u306e\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002\u8a73\u7d30\u306f<a href=\"\/server-guide\/authentication\/authentication-introduction\/\" target=\"_blank\" rel=\"noopener\"><strong>\u8a8d\u8a3c\u30ac\u30a4\u30c9<\/strong><\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044)\u3002TestRail \u3067\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u5834\u5408\u306f\u3001TestRail \u7ba1\u7406\u8005\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">$ curl -H \"Content-Type: application\/json\" \\ \n  -u \"user@example.com:{some-password}\" \\\n  ..<\/pre>\n<div class=\"callout callout--info\">\n<p><span style=\"text-decoration: underline;\"><strong>\u203b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3059\u308b\u969b\u306f\u3001\u5fc5\u305a\u6ce2\u62ec\u5f27\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/span><\/p>\n<\/div>\n<p>\u30d8\u30c3\u30c0\u30fc\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u304a\u308a\u3001<code class=\"inline-code\">-H<\/code> \u3067\u59cb\u307e\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u60c5\u5831\u306e\u5f8c\u306e 2 \u3064\u3081\u306e <strong>\\<\/strong>\u3067\u7d42\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30e6\u30fc\u30b6\u30fc\u540d\u3068 API \u30ad\u30fc<\/h3>\n<p>\u5225\u306e\u65b9\u6cd5\u3068\u3057\u3066\u3001TestRail \u306f API \u30ad\u30fc\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002API \u30ad\u30fc\u306f TestRail \u306e [<strong>\u500b\u4eba\u8a2d\u5b9a<\/strong>] \u3067\u751f\u6210\u3067\u304d\u307e\u3059\u3002API \u30ad\u30fc\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3082\u3001HTTP \u306e\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\u3092\u4f7f\u7528\u3057\u3066 TestRail \u306e\u30e6\u30fc\u30b6\u30fc\u540d (\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306a\u3069) \u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4efb\u610f\u306e\u751f\u6210\u3055\u308c\u305f\u307e\u305f\u306f\u30a2\u30af\u30c6\u30a3\u30d6\u306a API \u30ad\u30fc\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002\u8907\u6570\u306e API \u30ad\u30fc\u3092\u751f\u6210\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u307e\u305f\u306f\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u88fd\u30c4\u30fc\u30eb\u3054\u3068\u306b\u4f7f\u3044\u5206\u3051\u3001 [<strong>\u500b\u4eba\u8a2d\u5b9a<\/strong>] \u3067 API \u30ad\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u3067\u3001\u3044\u3064\u3067\u3082\u30a2\u30af\u30bb\u30b9\u3092\u53d6\u308a\u6d88\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">$ curl -H \"Content-Type: application\/json\" \\\n  -u \"user@example.com:{api key}\" \\\n  ..<\/pre>\n<div class=\"callout callout--info\">\n<p><span style=\"text-decoration: underline;\"><strong>\u203bAPI \u3092\u4f7f\u7528\u3059\u308b\u306b\u306f TestRail \u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u9001\u4fe1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u81ea\u7d44\u7e54\u306e\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067 TestRail \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u7ba1\u7406\u3057\u3066\u3044\u308b\u5834\u5408\u3001<a href=\"\/server-guide\/server-administration\/securing-testrail\/\" target=\"_blank\" rel=\"noopener\">TestRail \u306e HTTPS \u3092\u6709\u52b9\u306b\u3059\u308b<\/a>\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002TestRail \u30af\u30e9\u30a6\u30c9\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u5834\u5408\u3001\u3059\u3079\u3066\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u81ea\u52d5\u7684\u306b HTTPS \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<\/div>\n<h2>API \u30b9\u30af\u30ea\u30d7\u30c8 \u30ea\u30dd\u30b8\u30c8\u30ea<\/h2>\n<p>\u30d1\u30d6\u30ea\u30c3\u30af\u306a GitHub \u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30b5\u30f3\u30d7\u30eb API \u30b9\u30af\u30ea\u30d7\u30c8\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u307e\u307e\u3067\u3001\u3042\u308b\u3044\u306f\u7c21\u5358\u306a\u5909\u66f4\u3060\u3051\u3067\u304a\u5ba2\u69d8\u306e\u30cb\u30fc\u30ba\u306b\u5408\u3046\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u898b\u3064\u304b\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<strong><a href=\"https:\/\/github.com\/gurock\/testrail-custom\/tree\/master\/user-submitted\/api-scripts\" target=\"_blank\" rel=\"noopener\">TestRail \u30ab\u30b9\u30bf\u30de\u30a4\u30ba GitHub \u30ea\u30dd\u30b8\u30c8\u30ea<\/a><\/strong>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306f\u3001\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u5f79\u306b\u7acb\u3064\u53ef\u80fd\u6027\u304c\u3042\u308b\u81ea\u4f5c\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30b5\u30d6\u30df\u30c3\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>GET \u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4f8b<\/h3>\n<p>\u6b21\u306e\u4f8b\u306f\u3001\u30c6\u30b9\u30c8 \u30b1\u30fc\u30b9\u3092\u8aad\u307f\u53d6\u308b\u5358\u7d14\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f cURL \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3069\u306e HTTP \u30c4\u30fc\u30eb\u307e\u305f\u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3082\u6a5f\u80fd\u3057\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3001\u304a\u3088\u3073 URL \u306f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">$ curl -H \"Content-Type: application\/json\" \\\n  -u \"user@example.com:APIkey\" \\\n  \"https:\/\/example.testrail.com\/index.php?\/api\/v2\/get_case\/1\"<\/pre>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u5404\u90e8\u5206\u306e\u8a73\u7d30\uff1a<\/p>\n<table class=\"table table--hover\" style=\"border-collapse: collapse; width: 100%;\">\n<thead>\n<tr>\n<th style=\"width: 50%;\">\u90e8\u5206<\/th>\n<th style=\"width: 50%;\">\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"width: 50%;\">\u201cContent-Type: application\/json\u201d<\/td>\n<td style=\"width: 50%;\">\u5fc5\u9808\u30d8\u30c3\u30c0\u30fc<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">https:\/\/example.testrail.com\/<\/td>\n<td style=\"width: 50%;\">\u30b5\u30fc\u30d0\u30fc \u30a2\u30c9\u30ec\u30b9<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">index.php?\/api\/v2\/<\/td>\n<td style=\"width: 50%;\">TestRail API \u306e\u30d1\u30b9<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">get_case<\/td>\n<td style=\"width: 50%;\">\u547c\u3073\u51fa\u3055\u308c\u308b API \u30e1\u30bd\u30c3\u30c9<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">\/1<\/td>\n<td style=\"width: 50%;\">API \u30e1\u30bd\u30c3\u30c9\u3078\u306e\u5f15\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b9f\u969b\u306e HTTP \u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059 (\u7c21\u7565\u5316\u3055\u308c\u3066\u3044\u307e\u3059)\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">GET \/index.php?\/api\/v2\/get_case\/1 HTTP\/1.1\nHost: example.testrail.com\nContent-Type: application\/json<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">HTTP\/1.1 200 OK\nContent-Type: application\/json; charset=utf-8\n\n{\n  \"id\":1,\n  \"title\":\"An example test case\"\n  ..\n}<\/pre>\n<h2>POST \u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4f8b<\/h2>\n<p>\u6b21\u306e\u4f8b\u306f\u3001\u30c6\u30b9\u30c8\u7d50\u679c\u3092\u9001\u4fe1\u3059\u308b\u5358\u7d14\u306a\u66f8\u304d\u8fbc\u307f\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">$ curl -H \"Content-Type: application\/json\" \\\n  -u \"user@example.com:\" \\\n  -d '{ \"status_id\": 1 }' \\\n  \"https:\/\/example.testrail.com\/\/index.php?\/api\/v2\/add_result\/1\"<\/pre>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059 (\u7c21\u7565\u5316\u3055\u308c\u3066\u3044\u307e\u3059)\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">POST \/index.php?\/api\/v2\/add_result\/1 HTTP\/1.1\nHost: example.testrail.com\nContent-Type: application\/json\n\n{ \"status_id\": 1 }<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">HTTP\/1.1 200 OK\nContent-Type: application\/json; charset=utf-8\n\n{\n  \"id\":1,\n  \"test_id\":1,\n  \"status_id\":1\n  ..\n}<\/pre>\n<h2>\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306e\u4f8b<\/h2>\n<div class=\"callout\">\n<p><span style=\"text-decoration: underline;\"><strong>\u203bAPI \u3092\u4f7f\u7528\u3057\u3066\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f\u3001TestRail 5.7 \u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002<\/strong><\/span><\/p>\n<\/div>\n<p>\u6b21\u306e\u4f8b\u306f\u3001\u30c6\u30b9\u30c8\u7d50\u679c\u306b\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u5358\u7d14\u306a\u66f8\u304d\u8fbc\u307f\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">$ curl -H \"Content-Type: multipart\/form-data\" \\ \n  -u \"user@example.com:\" \\ \n  -F \"attachment=@C:\\\\image.jpg\" \\ \n  \"https:\/\/example.testrail.io\/index.php?\/api\/v2\/add_attachment_to_result\/1\"<\/pre>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059 (\u7c21\u7565\u5316\u3055\u308c\u3066\u3044\u307e\u3059)\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">POST \/index.php?\/api\/v2\/add_attachment_to_result\/1 HTTP\/1.1\nHost: example.testrail.io\nContent-Type: multipart\/form-data<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">{\"attachment_id\":11}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>TestRail \u306e API \u306f HTTP \u30d9\u30fc\u30b9\u3067\u3042\u308a\u3001\u5358\u7d14\u306a HTTP \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u5bfe\u8a71\u3067\u304d\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u66f8\u304d\u8fbc\u307f\u30ea\u30af\u30a8\u30b9\u30c8\u306f HTTP POST \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u3059\u3079\u3066\u306e\u8aad\u307f\u53d6\u308a\u30ea\u30af\u30a8\u30b9\u30c8\u306f HTTP G [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":6735,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-20145","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/20145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/comments?post=20145"}],"version-history":[{"count":28,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/20145\/revisions"}],"predecessor-version":[{"id":31357,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/20145\/revisions\/31357"}],"up":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/6735"}],"wp:attachment":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/media?parent=20145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}