{"id":887,"date":"2018-01-04T16:32:50","date_gmt":"2018-01-04T07:32:50","guid":{"rendered":"http:\/\/assist-tencho.com\/faq\/?p=887"},"modified":"2025-10-14T22:37:33","modified_gmt":"2025-10-14T13:37:33","slug":"02-0077","status":"publish","type":"post","link":"https:\/\/ec.smaregi.jp\/oms\/faq\/order\/02-0077\/","title":{"rendered":"API\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8"},"content":{"rendered":"\n<div id=\"keni_toc\" class=\"disp_tree\">\u76ee\u6b21<\/div>\n\n\n\n<div style=\"height:62px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u203b\uff21\uff30\uff29\u3092\u4f7f\u3063\u3066\u3067\u304d\u308b\u3053\u3068<\/p>\n\n\n\n<p>\u73fe\u5728\u3001\u4ee5\u4e0b\u306e\u6a5f\u80fd\u304cAPI\u304b\u3089\u5229\u7528\u3067\u304d\u307e\u3059\u3002<br>\u203b\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306eWebView\u304b\u3089\u306e\u5229\u7528\u306b\u306f\u73fe\u5728\u306e\u3068\u3053\u308d\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53d7\u6ce8\uff21\uff30\uff29\n<ul class=\"wp-block-list\">\n<li>\u691c\u7d22<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\uff21\uff30\uff29\u3092\u4f7f\u3046\u305f\u3081\u306e\u6e96\u5099<\/h3>\n\n\n\n<p>\uff21\uff30\uff29\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u767a\u884c<\/p>\n\n\n\n<p>\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306f\u3001\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u306e\u7ba1\u7406\u753b\u9762\u306b\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001\u300c\u74b0\u5883\u8a2d\u5b9a\uff1e\u5916\u90e8\u30a2\u30d7\u30ea\u9023\u643a\u300d\u30e1\u30cb\u30e5\u30fc\u3088\u308a\u767b\u9332\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>1. API\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u306f\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059<\/strong> <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>RESTful\u306aHTTP\u30ea\u30af\u30a8\u30b9\u30c8<\/li>\n\n\n\n<li>JSON\u306e\u30d1\u30fc\u30b9\u3084\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba<\/li>\n\n\n\n<li>\u8a8d\u53ef\u30b3\u30fc\u30c9\u306e\u53d7\u3051\u53d6\u308a\u304c\u53ef\u80fd\u306a\u3053\u3068\u3002\u30b9\u30de\u30ec\u30b8EC\u30fb\u30ea\u30d4\u30fc\u30c8\uff21\uff30\uff29\u8a8d\u53ef\u30da\u30fc\u30b8\u304b\u3089\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u3089\u308c\u308bWeb\u30b5\u30fc\u30d0<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>2. API\u5229\u7528\u306e\u6d41\u308c<\/strong><\/p>\n\n\n\n<p>API\u5229\u7528\u306e\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"858\" height=\"1029\" src=\"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/image.png\" alt=\"\" class=\"wp-image-22268\" style=\"width:568px;height:auto\" srcset=\"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/image.png 858w, https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/image-534x640.png 534w, https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/image-854x1024.png 854w, https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/image-768x921.png 768w\" sizes=\"auto, (max-width: 858px) 100vw, 858px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u5229\u7528\u624b\u9806<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u3001OAuth2\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u306e\u8a8d\u8a3c\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>1. OAuth\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u767b\u9332<\/strong><\/p>\n\n\n\n<p>\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u306e\u7ba1\u7406\u753b\u9762\u306b\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001\u300c\u74b0\u5883\u8a2d\u5b9a\uff1e\u5916\u90e8\u30a2\u30d7\u30ea\u9023\u643a\u300d\u30e1\u30cb\u30e5\u30fc\u3088\u308a\u767b\u9332\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1523\" height=\"787\" src=\"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/apidoc_00.png\" alt=\"\" class=\"wp-image-7063\" srcset=\"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/apidoc_00.png 1523w, https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/apidoc_00-640x331.png 640w, https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/apidoc_00-768x397.png 768w, https:\/\/ec.smaregi.jp\/oms\/faq\/wp-content\/uploads\/2018\/01\/apidoc_00-1024x529.png 1024w\" sizes=\"auto, (max-width: 1523px) 100vw, 1523px\" \/><\/figure>\n\n\n\n<p>\u203b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8URL\u306b\u306f\u5fa1\u793eWEB\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u8a8d\u8a3c\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308bURL\u3092\u6307\u5b9a\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>2. \u8a8d\u8a3c\u30da\u30fc\u30b8\u8868\u793a<\/strong><\/p>\n\n\n\n<p>https:\/\/{\u30c9\u30e1\u30a4\u30f3\u540d}\/api\/oauth\/authorize.php\u306b\u3001\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3064\u3051\u3066GET\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 \u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8a8d\u8a3c\u3092\u884c\u3046HTML\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u30d1\u30e9\u30e1\u30fc\u30bf\u540d<\/th><th>\u6709\u52b9\u306a\u5024<\/th><\/tr><tr><td>response_type<\/td><td>&#8220;code&#8221;\u3092\u6307\u5b9a<\/td><\/tr><tr><td>redirect_uri<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u767b\u9332\u6642\u306b\u5165\u529b\u3057\u305f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8URL\u3068\u540c\u4e00\u306e\u3082\u306e\u3092\u6307\u5b9a<\/td><\/tr><tr><td>client_id<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8a73\u7d30\u753b\u9762\u3067\u78ba\u8a8d\u3067\u304d\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID<\/td><\/tr><tr><td>state<\/td><td>CSRF\u5bfe\u7b56\u306e\u70ba\u306e\u5b89\u5168\u304b\u3064\u91cd\u8907\u3057\u306b\u304f\u3044\u30e9\u30f3\u30c0\u30e0\u6587\u5b57\u5217<\/td><\/tr><tr><td>scope<\/td><td>\u4e88\u7d04\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002\u73fe\u5728\u306f\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<br>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u5229\u7528\u3057\u305f\u3044\u6a5f\u80fd\u3092\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<br>&#8220;read_sales&#8221; = \u53d7\u6ce8\u30c7\u30fc\u30bf\u3092\u53c2\u7167<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u4f8b\uff09<\/p>\n\n\n\n<p>https:\/\/{\u30c9\u30e1\u30a4\u30f3\u540d}\/api\/oauth\/authorize.php?client_id=CLIENT_ID&#038;redirect_uri=REDIRECT_URL&#038;response_type=code&#038;state=a397aabc602f7e296db23b0717edd1fda06c345f<\/p>\n<\/blockquote>\n\n\n\n<p>\u30fbURL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u8a8d\u53ef\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br>\u30fb\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u6301\u3064\u5229\u7528\u8005\u306f\u3001\u3053\u306e\u30da\u30fc\u30b8\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30b7\u30e7\u30c3\u30d7\u306e\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<br>\u30fb\u521d\u3081\u3066\u8a8d\u53ef\u30da\u30fc\u30b8\u3078\u8a2a\u308c\u308b\u5229\u7528\u8005\u306f\u3001\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u306e\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3ID\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u3092\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>3. \u8a8d\u53ef\u30b3\u30fc\u30c9\u306e\u53d6\u5f97<\/strong><\/p>\n\n\n\n<p>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8URL\u306b\u6307\u5b9a\u3057\u305fURL\u3067\u3001\u8a8d\u53ef\u30b3\u30fc\u30c9\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u4f8b\uff09<\/p>\n\n\n\n<p>https:\/\/{\u5fa1\u793e\u30c4\u30fc\u30eb\u30c9\u30e1\u30a4\u30f3\u540d}\/getAuth.php?code=xxxxxxxxx&#038;state=zzzzzzzzz<\/p>\n<\/blockquote>\n\n\n\n<p>code\u306e\u5024\u304c\u8a8d\u53ef\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>4. \u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u53d6\u5f97<\/strong><\/p>\n\n\n\n<p>\u8a8d\u53ef\u30b3\u30fc\u30c9\u3092\u5229\u7528\u3057\u3066\u3001\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>https:\/\/{\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u30c9\u30e1\u30a4\u30f3\u540d}\/api\/oauth\/token.php \u306b\u5bfe\u3057\u3066POST\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:#008000\"><strong>\u30ea\u30af\u30a8\u30b9\u30c8\u30d1\u30e9\u30e1\u30fc\u30bf<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u30d1\u30e9\u30e1\u30fc\u30bf\u540d<\/th><th>\u6709\u52b9\u306a\u5024<\/th><\/tr><tr><td>client_id<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8a73\u7d30\u753b\u9762\u3067\u78ba\u8a8d\u3067\u304d\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID<\/td><\/tr><tr><td>client_secret<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8a73\u7d30\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u6587\u5b57\u5217<\/td><\/tr><tr><td>code<\/td><td>\u8a8d\u53ef\u30b3\u30fc\u30c9\u6587\u5b57\u5217<\/td><\/tr><tr><td>grant_type<\/td><td>&#8220;client_credentials&#8221; \u3092\u6307\u5b9a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-text-color\" style=\"color:#008000\"><strong>\u30ec\u30b9\u30dd\u30f3\u30b9\u30c7\u30fc\u30bf<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u30d1\u30e9\u30e1\u30fc\u30bf\u540d<\/th><th>\u6709\u52b9\u306a\u5024<\/th><\/tr><tr><td>access_token<\/td><td>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3<\/td><\/tr><tr><td>expires_in<\/td><td>\u6709\u52b9\u671f\u9650<\/td><\/tr><tr><td>refresh_token<\/td><td>\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5\u30c8\u30fc\u30af\u30f3<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8a8d\u53ef\u30b3\u30fc\u30c9\u3092\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u306b\u4ea4\u63db\u3067\u304d\u308b\u306e\u306f1\u5ea6\u3060\u3051\u3067\u3059\u3002<\/li>\n\n\n\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5074\u3067\u4fdd\u5b58\u3057\u3066\u304a\u304f\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n\n\n\n<li>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u306e\u6709\u52b9\u671f\u9650\u306f\u3001\u767a\u884c\u304b\u3089100\u65e5\u9593\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>5. API\u60c5\u5831\u306e\u547c\u3073\u51fa\u3057<\/strong><\/p>\n\n\n\n<p>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3064\u304d\u3067 HTTP \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406API \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u30dc\u30c7\u30a3\u306eJSON\u306b\u65e5\u672c\u8a9e\u304c\u542b\u307e\u308c\u308b\u5834\u5408\u306f \u6587\u5b57\u30b3\u30fc\u30c9\u306fUTF-8\u3001\\uNNNN \u5f62\u5f0f\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>Authorization\u30d8\u30c3\u30c0\u306b\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u4ed8\u4e0e\u3057\u3001API\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Authorization: Bearer {\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<p>\u203b\u4ee5\u4e0b\u306f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002URL\u3084\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4fbf\u5b9c\u5909\u66f4\u30fb\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-text-color\" style=\"color:#0000ff\"><strong>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eWeb\u30b5\u30fc\u30d0\u306e\u30b5\u30f3\u30d7\u30eb<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n\ndefine(\"OAUTH2_SITE\", 'https:\/\/{\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u30c9\u30e1\u30a4\u30f3}');\ndefine(\"OAUTH2_CLIENT_ID\",'XXXXX');      \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID\u3092\u5165\u529b\u3057\u307e\u3059\u3002\ndefine(\"OAUTH2_CLIENT_SECRET\", 'XXXXX'); \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u3092\u5165\u529b\u3057\u307e\u3059\u3002\ndefine(\"OAUTH2_REDIRECT_URI\", 'http:\/\/example.com\/index.php');\n\n$code = $_GET['code'];\n$state = sha1(uniqid(mt_rand(), true));\n\/\/ \u8a8d\u53ef\u30da\u30fc\u30b8\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\nif (empty($code)) {\n    $params = array(\n        'client_id'     =&gt; OAUTH2_CLIENT_ID,\n        'redirect_uri'  =&gt; OAUTH2_REDIRECT_URI,\n        'response_type' =&gt; 'code',\n&nbsp;      &nbsp;'state'         =&gt; $state\n    );\n    $auth_url = OAUTH2_SITE . '\/api\/oauth\/authorize.php?' . http_build_query($params);\n    header('Location: ' . $auth_url);\n    exit;\n}\n\n\/\/ \u8a8d\u53ef\u5f8c\n$params = array(\n    'client_id'     =&gt; OAUTH2_CLIENT_ID,\n    'client_secret' =&gt; OAUTH2_CLIENT_SECRET,\n    'code'          =&gt; $code,\n    'grant_type'    =&gt; 'client_credentials',\n    'redirect_uri'  =&gt; OAUTH2_REDIRECT_URI\n);\n$request_options = array(\n    'http' =&gt; array(\n        'method'  =&gt; 'POST',\n        'content' =&gt; http_build_query($params)\n    )\n);\n$context = stream_context_create($request_options);\n\n$token_url = OAUTH2_SITE . '\/api\/oauth\/token.php';\n$response_body = file_get_contents($token_url, false, $context);\n$response_json = json_decode($response_body);\n<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-text-color\" style=\"color:#0000ff\"><strong>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u7528\u3044\u305fGET\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30b5\u30f3\u30d7\u30eb<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n\n$arrParam = array();\n$arrParam['serial_order_id'] = '5'\n\n\n$api_url = 'https:\/\/{\u30b9\u30de\u30ec\u30b8EC\u30fb\u4e00\u5143\u7ba1\u7406\u30c9\u30e1\u30a4\u30f3}\/api\/v1\/orders.php?' . http_build_query($arrParam);\n$api = new HTTP_Request($api_url, $option);\n\/\/ POST\u3067\u9001\u4fe1\n$api-&gt;setMethod(HTTP_REQUEST_METHOD_GET);\n\/\/ Header\u8a2d\u5b9a\n$api-&gt;addHeader('Authorization', \"Bearer {\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3}\");\n\/\/ HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u5b9f\u884c \n$response_api = $api-&gt;sendRequest();\n$status_code = $api-&gt;getResponseCode();\n$response_body_api = $api-&gt;getResponseBody();\n$response_body_api = json_decode($response_body_api);\n?&gt;<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong><span style=\"color:#0000ff;\">\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5\u30c8\u30fc\u30af\u30f3\u30b5\u30f3\u30d7\u30eb<\/span><\/strong><br><span class=\"small\">\u203b\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u304c\u5931\u52b9\u3057\u305f\u969b\u306b\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002<\/span> <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n\n$token_url = 'https:\/\/aspXXX.raku2cube.com\/XXX' . '\/oauth\/token.php';\n\n\/\/ \u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\n$option = array( \n    'timeout'           =&gt; '10', \/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306e\u79d2\u6570\u6307\u5b9a \n    'allowRedirects'    =&gt; true, \/\/ \u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u8a31\u53ef\u8a2d\u5b9a(true\/false) \n    'maxRedirects'      =&gt; 3,        \/\/ \u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u6700\u5927\u56de\u6570 \n); \n\n$params = array(\n    'grant_type'    =&gt; 'refresh_token',\n    'client_id'  =&gt; '\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID',\n    'client_secret' =&gt; '\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b7\u30fc\u30af\u30ec\u30c3\u30c8',\n    'refresh_token'  =&gt; '\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5\u30c8\u30fc\u30af\u30f3'\n);\n$request_options = array(\n    'http' =&gt; array(\n        'method'  =&gt; 'POST',\n        'content' =&gt; http_build_query($params)\n    )\n);\n\n$http = new HTTP_Request($token_url, $option); \n\n$context = stream_context_create($request_options);\n\n\/\/ POST\u3067\u9001\u4fe1\n$http-&gt;setMethod(HTTP_REQUEST_METHOD_POST);\n\n$response_body = file_get_contents($token_url, false, $context);\n\n?&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u6b21 \u203b\uff21\uff30\uff29\u3092\u4f7f\u3063\u3066\u3067\u304d\u308b\u3053\u3068 \u73fe\u5728\u3001\u4ee5\u4e0b\u306e\u6a5f\u80fd\u304cAPI\u304b\u3089\u5229\u7528\u3067\u304d\u307e\u3059\u3002\u203b\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306eWebView\u304b\u3089\u306e\u5229\u7528\u306b\u306f\u73fe\u5728\u306e\u3068\u3053\u308d\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \uff21\uff30\uff29\u3092\u4f7f\u3046\u305f\u3081\u306e\u6e96\u5099 \uff21\uff30\uff29\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u767a\u884c \u30c7\u30d9\u30ed\u30fb\u30fb\u30fb<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":[],"meta":{"footnotes":""},"categories":[16,5],"tags":[],"class_list":{"0":"post-887","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-api","7":"category-order"},"views":4292,"_links":{"self":[{"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/posts\/887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/comments?post=887"}],"version-history":[{"count":23,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/posts\/887\/revisions"}],"predecessor-version":[{"id":22269,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/posts\/887\/revisions\/22269"}],"wp:attachment":[{"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/media?parent=887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/categories?post=887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/tags?post=887"},{"taxonomy":"format","embeddable":true,"href":"https:\/\/ec.smaregi.jp\/oms\/faq\/wp-json\/wp\/v2\/format?post=887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}