{"id":13355,"date":"2021-04-18T12:19:14","date_gmt":"2021-04-18T03:19:14","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=13355"},"modified":"2023-05-27T17:49:09","modified_gmt":"2023-05-27T08:49:09","slug":"%e3%80%90api%e3%80%91%e8%a8%ad%e8%a8%88%e6%89%8b%e9%a0%86","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=13355","title":{"rendered":"\u3010API\u3011\u8a2d\u8a08\u624b\u9806"},"content":{"rendered":"<h2>1.\u6a5f\u80fd\u4e00\u89a7\u3092\u66f8\u304d\u51fa\u3059\u3002<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3002<\/p>\n<ul>\n<li>\u30e6\u30fc\u30b6\u30fc\u767b\u9332<\/li>\n<li>\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7<\/li>\n<li>\u30e6\u30fc\u30b6\u30fc\u691c\u7d22<\/li>\n<\/ul>\n<h2>2.API\u3068\u3057\u3066\u5fc5\u8981\u306a\u3082\u306e\u3092\u6574\u7406\u3059\u308b\u3002<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u300c\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u300d\u3068\u300c\u30e6\u30fc\u30b6\u30fc\u691c\u7d22\u300d\u306eAPI\u306f\u4e00\u3064\u306b\u307e\u3068\u3081\u308c\u308b\u306a\u3069\u3002<\/p>\n<h2>3.URI\u3092\u6c7a\u3081\u308b\u3002<\/h2>\n<h3>\u77ed\u304f\u30b7\u30f3\u30d7\u30eb\u306a\u7269\u306b\u3059\u308b\u3002<\/h3>\n<h3>\u4eba\u9593\u304c\u8aad\u3093\u3067\u7406\u89e3\u3067\u304d\u308b\u3082\u306e\u306b\u3059\u308b\u3002<\/h3>\n<p>\u4f8b\u3048\u3070\u3001a\u3068\u304bb\u3068\u304b\u306e\u540d\u524d\u306b\u306a\u3063\u3066\u3044\u308bURL\u306b\u306f\u3057\u306a\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001\u547d\u540d\u306b\u95a2\u3057\u3066\u306f<span style=\"color: #ff0000;\"><strong>\u300cProgrammableWeb\u300d<\/strong><\/span>\u306a\u3069\u3092\u898b\u3066\u81ea\u5206\u304c\u4f7f\u3063\u3066\u3044\u308bAPI\u306b\u8fd1\u3044\u7269\u306e\u547d\u540d\u3092\u78ba\u8a8d\u3059\u308b\u3068\u826f\u3044\u3002<\/p>\n<h3>\u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u3092\u6df7\u5728\u3055\u305b\u306a\u3044\u3002<\/h3>\n<p>\u57fa\u672c\u7684\u306b\u306f\u5c0f\u6587\u5b57\u306e\u307f\u306eURI\u306b\u3059\u308b\u306e\u304c\u666e\u901a\u3002<\/p>\n<p>\u5927\u6587\u5b57\u304c\u6df7\u3056\u3063\u305f\u5834\u5408\u306f\u3001404\u30a8\u30e9\u30fc\u3068\u3057\u3066\u8fd4\u3057\u3066\u3044\u308b\u30b5\u30a4\u30c8\u304c\u591a\u3044\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf\u306e\u7d10\u4ed8\u304d\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u968e\u5c64\u5316\u3059\u308b\u3002<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u4f1a\u793e\u60c5\u5831\u306b\u5bfe\u3057\u3066\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u5834\u5408\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306aURL\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true\">http:\/\/localhost\/v1\/users\/:id\/companies\/:id<\/pre>\n<h3>\u8907\u6570\u306e\u5358\u8a9e\u3092\u3064\u306a\u3050\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u30cf\u30a4\u30d5\u30f3\u3092\u5229\u7528\u3059\u308b\u3002<\/h3>\n<p>\u7279\u306b\u7279\u5225\u306a\u30eb\u30fc\u30eb\u306f\u306a\u3044\u3088\u3046\u3067\u3059\u304c\u3001\u4e00\u822c\u7684\u306b\u4e00\u756a\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3002\u7279\u306b\u7406\u7531\u304c\u306a\u3051\u308c\u3070\u30cf\u30a4\u30d5\u30f3\u306b\u3059\u308b\u3002\u6b21\u70b9\u3067_\uff08\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\uff09\u304c\u826f\u3044\u3002<\/p>\n<h3>\u30db\u30b9\u30c8\u540d<\/h3>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30db\u30b9\u30c8\u540d\u306b\u306f\u81ea\u793e\u306e\u30db\u30b9\u30c8\u540d\u306e\u5148\u982d\u306bapi\u3092\u3064\u3051\u308b\u306e\u304c\u4e3b\u6d41\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">https:\/\/api.twitter.com<\/pre>\n<h2>4.HTTP\u30e1\u30bd\u30c3\u30c9\u3092\u6c7a\u3081\u308b\u3002<\/h2>\n<table>\n<tbody>\n<tr>\n<th>\u30e1\u30bd\u30c3\u30c9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>GET<\/td>\n<td>\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>POST<\/td>\n<td>\u65b0\u898f\u767b\u9332<\/td>\n<\/tr>\n<tr>\n<td>PUT<\/td>\n<td>\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td>DELETE<\/td>\n<td>\u524a\u9664<\/td>\n<\/tr>\n<tr>\n<td>PATCH<\/td>\n<td>\u4e00\u90e8\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td>HEAD<\/td>\n<td>\u30ea\u30bd\u30fc\u30b9\u306e\u30e1\u30bf\u60c5\u5831\u306e\u53d6\u5f97<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>5.\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6c7a\u3081\u308b<\/h2>\n<h3>\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u30d1\u30b9\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u4f7f\u3044\u5206\u3051<\/h3>\n<p>\u30d1\u30b9\u30d1\u30e9\u30e1\u30fc\u30bf\u306f<span style=\"color: #ff0000;\"><strong>\u30ea\u30bd\u30fc\u30b9\u3092\u4e00\u610f\u306b\u8868\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u60c5\u5831\u306e\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002<\/strong><\/span>\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u30ea\u30bd\u30fc\u30b9\u306e\u8b58\u5225\u306b\u95a2\u4fc2\u306a\u3044\u60c5\u5831\u3092\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b\u9001\u308b\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h3>\u691c\u7d22\u6761\u4ef6\u306e\u7d5e\u308a\u8fbc\u307f<\/h3>\n<p>\u691c\u7d22\u6761\u4ef6\u306e\u7d5e\u308a\u8fbc\u307f\u306e\u305f\u3081\u306b\u4f7f\u3046\u691c\u7d22\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u3053\u308c\u3092\u4f7f\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3059\u308b\u969b\u3082\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h4>\u53d6\u5f97\u6570<\/h4>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u82f1\u5358\u8a9e\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>count<\/li>\n<li>limit<\/li>\n<li>per_page<\/li>\n<\/ul>\n<h4>\u53d6\u5f97\u4f4d\u7f6e<\/h4>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u82f1\u5358\u8a9e\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>page<\/li>\n<li>offset<\/li>\n<\/ul>\n<h4>\u7d44\u307f\u5408\u308f\u305b\u306f\u6c7a\u307e\u3063\u3066\u3044\u308b\u3002<\/h4>\n<p><span style=\"color: #ff0000;\"><strong>\u300cpage\/per_page\u300d<\/strong><\/span> or <span style=\"color: #ff0000;\"><strong>\u300coffset\/limit\u300d<\/strong><\/span>\u3068\u7d44\u307f\u5408\u308f\u305b\u30d1\u30bf\u30fc\u30f3\u306f\u307b\u307c\u6c7a\u307e\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>\u691c\u7d22\u6761\u4ef6\u9805\u76ee\u306e\u547d\u540d<\/h4>\n<p>\u8907\u6570\u3042\u308b\u5834\u5408\u306fname\u3084customer_id\u306a\u3069\u3068\u5177\u4f53\u7684\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u540d\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u304c\u3001\u691c\u7d22\u5bfe\u8c61\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u4e00\u3064\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u306fq\u3068\u3060\u3051\u3059\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5358\u4e00\u9078\u629e\u9805\u76ee\u306e\u8868\u73fe\u65b9\u6cd5<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3067\u6027\u5225\u3092\u8868\u3059\u5834\u5408\u306fURL\u4e0a\u3067\u306f<span style=\"color: #ff0000;\"><strong>\u6570\u5024(1,2)<\/strong><\/span>\u3088\u308a\u3082<span style=\"color: #ff0000;\"><strong>\u6587\u5b57\u5217(male\u3001female\u306a\u3069)\u3067\u6e21\u3059\u3053\u3068\u304c\u4e00\u822c\u7684<\/strong><\/span>\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"1.\u6a5f\u80fd\u4e00\u89a7\u3092\u66f8\u304d\u51fa\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3002 \u30e6\u30fc\u30b6\u30fc\u767b\u9332 \u30e6\u30fc\u30b6\u30fc\u4e00\u89a7 \u30e6\u30fc\u30b6\u30fc\u691c\u7d22 2.API\u3068\u3057\u3066\u5fc5\u8981\u306a\u3082\u306e\u3092\u6574\u7406\u3059\u308b\u3002 \u4f8b\u3048\u3070\u3001\u300c\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u300d\u3068\u300c\u30e6\u30fc\u30b6\u30fc\u691c\u7d22\u300d\u306eAPI\u306f\u4e00\u3064\u306b\u307e\u3068\u3081\u308c\u308b\u306a\u3069\u3002 3.UR [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[118],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13355"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13355"}],"version-history":[{"count":15,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13355\/revisions"}],"predecessor-version":[{"id":20071,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13355\/revisions\/20071"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13355"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}