{"id":94802,"date":"2022-10-04T15:35:04","date_gmt":"2022-10-04T06:35:04","guid":{"rendered":"https:\/\/learningbox.online\/?p=94802"},"modified":"2022-09-29T15:31:22","modified_gmt":"2022-09-29T06:31:22","slug":"api","status":"publish","type":"post","link":"https:\/\/learningbox.online\/en\/column\/api\/","title":{"rendered":"Important] Notice of API (Push Notification Function) Specification Changes"},"content":{"rendered":"<p>\u5e73\u7d20\u3088\u308alearningBOX\u3092\u3054\u5229\u7528\u3044\u305f\u3060\u304d\u3001\u8aa0\u306b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<p>learningBOX\u3067\u306f\u3001Ver2.19\u306e\u30ea\u30ea\u30fc\u30b9\u3088\u308a\u3001API\u306e\u4ed5\u69d8\u3092\u5909\u66f4\u3044\u305f\u3057\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306e\u304a\u77e5\u3089\u305b\u306f\u3001API\u9023\u643a\u3092\u3054\u5229\u7528\u306e\u304a\u5ba2\u69d8\u5411\u3051\u306e\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<h2>API\u306e\u5909\u66f4\u70b9\u306b\u3064\u3044\u3066<\/h2>\n<p>\u5909\u66f4\u524d<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2022\/10\/API\u306e\u4ed5\u69d8\u5909\u66f4-01.png\" alt=\"\" width=\"1551\" height=\"702\" class=\"aligncenter size-full wp-image-94999\" \/><\/p>\n<p>\u5909\u66f4\u5f8c<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2022\/10\/API\u306e\u4ed5\u69d8\u5909\u66f4-02.png\" alt=\"\" width=\"1542\" height=\"726\" class=\"aligncenter size-full wp-image-95001\" \/><\/p>\n<h3>\u5b9f\u88c5\u65b9\u6cd5\u306b\u3088\u3063\u3066\u306f\u3001\u901a\u4fe1\u304c\u5931\u6557\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059<\/h3>\n<p>\u30cf\u30fc\u30c9\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u5834\u5408\u3001\u7121\u52b9\u306a\u901a\u77e5\u3068\u5224\u5b9a\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h4 class=\"style4b\">PUSH\u901a\u77e5\u306e\u6709\u52b9\u6027\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u65b9\u6cd5<\/h4>\n<p>\u305d\u306e\uff11\uff1a\u9001\u4fe1\u5185\u5bb9\u3092\u53d6\u5f97\u3059\u308b\u3002<br \/>\n\u305d\u306e\uff12\uff1a\u9001\u4fe1\u5185\u5bb9\u304b\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u300chash\u300d\u3092\u53d6\u308a\u9664\u3044\u3066\u4e00\u6642\u4fdd\u5b58\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\uff13\uff1a\u9001\u4fe1\u5185\u5bb9\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u9806\u756a\u3092\u5909\u3048\u305a\u306b\u5f8c\u308d\u306b\u300csecret\u300d\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u305d\u306e\uff14\uff1a\u9001\u4fe1\u5185\u5bb9\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u5024\u3092\u300c|\u300d\u3067\u9023\u7d50\u3057\u305f\u5f8c\u3001sha256\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\uff15\uff1a\u9001\u4fe1\u5185\u5bb9\u304b\u3089\u53d6\u5f97\u3057\u305fhash\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2022\/10\/API\u306e\u4ed5\u69d8\u5909\u66f4-03.png\" alt=\"\" width=\"1374\" height=\"533\" class=\"aligncenter size-full wp-image-95006\" \/><\/p>\n<h4 class=\"style4b\">PUSH\u901a\u77e5\u6709\u52b9\u6027\u30c1\u30a7\u30c3\u30af\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h4>\n<p>\/**<br \/>\n * PUSH\u901a\u77e5\u6709\u52b9\u6027\u30c1\u30a7\u30c3\u30af<br \/>\n * \u901a\u77e5\u5185\u5bb9\u4f8b\uff1a<br \/>\n * &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n * {<br \/>\n *     &#8216;param1&#8217;: &#8216;aaa&#8217;,<br \/>\n *     &#8216;param2&#8217;: &#8216;bbb&#8217;,<br \/>\n *     &#8216;param3&#8217;: &#8216;ccc&#8217;,<br \/>\n *     &#8216;hash&#8217;: &#8216;ae12de&#8217;<br \/>\n * }<br \/>\n * &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n * \u203bhash\u4ee5\u5916\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4e26\u3073\u9806\u5909\u66f4\u3001\u307e\u305f\u306f\u5897\u6e1b\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n *\/<\/p>\n<h5><b>\u6b63\u5e38\u306b\u52d5\u4f5c\u3059\u308b\u4f8b<\/b><\/h5>\n<p>$payload = file_get_contents(&#8216;php:\/\/input&#8217;);        \/\/ \u901a\u77e5\u5185\u5bb9\u3092\u53d6\u5f97<br \/>\n$payload = json_decode($payload, true);             \/\/ \u901a\u77e5\u5185\u5bb9\u3092\u914d\u5217\u5316<br \/>\n$hash = $payload[&#8216;hash&#8217;];                           \/\/ \u691c\u8a3c\u7528\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u53d6\u5f97<br \/>\nunset($payload[&#8216;hash&#8217;]);                            \/\/ \u691c\u8a3c\u7528\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u9001\u4fe1\u5185\u5bb9\u304b\u3089\u53d6\u308a\u9664\u304f<br \/>\n$payload = $payload + [&#8216;secret&#8217; =>  &#8216;tatsuno123&#8217;];  \/\/ \u901a\u77e5\u5185\u5bb9\u306e\u5f8c\u308d\u306b\u901a\u77e5\u5148\u306e\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u3092\u8ffd\u52a0<br \/>\nif($hash === hash(&#8216;sha256&#8217;, implode(&#8216;|&#8217;, $payload))) {<br \/>\n    \/\/ \u9001\u4fe1\u5185\u5bb9\u8a8d\u8a3c\u6210\u529f<br \/>\n} else {<br \/>\n    \/\/ \u9001\u4fe1\u5185\u5bb9\u8a8d\u8a3c\u5931\u6557<br \/>\n}<\/p>\n<h5><b>\u4e0d\u5177\u5408\u306e\u51fa\u308b\u4f8b<\/b><\/h5>\n<p>$payload = file_get_contents(&#8216;php:\/\/input&#8217;);        \/\/ \u901a\u77e5\u5185\u5bb9\u3092\u53d6\u5f97<br \/>\n$payload = json_decode($payload, true);             \/\/ \u901a\u77e5\u5185\u5bb9\u3092\u914d\u5217\u5316<br \/>\n$hash = $payload[&#8216;hash&#8217;];                           \/\/ \u691c\u8a3c\u7528\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u53d6\u5f97<br \/>\n$param1 = $payload[&#8216;param1&#8217;];                       \/\/ \u691c\u8a3c\u7528\u306e\u30d1\u30e9\u30e1\u30fc\u30bf1\u3092\u53d6\u5f97<br \/>\n$param2 = $payload[&#8216;param2&#8217;];                       \/\/ \u691c\u8a3c\u7528\u306e\u30d1\u30e9\u30e1\u30fc\u30bf2\u3092\u53d6\u5f97<br \/>\n$param3 = $payload[&#8216;param3&#8217;];                       \/\/ \u691c\u8a3c\u7528\u306e\u30d1\u30e9\u30e1\u30fc\u30bf3\u3092\u53d6\u5f97<br \/>\n$secret = &#8216;tatsuno123&#8217;;                             \/\/ \u901a\u77e5\u5148\u306e\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc<br \/>\nif($hash === hash(&#8216;sha256&#8217;, $param1 . &#8216;|&#8217; . $param2 . &#8216;|&#8217; . $param3 . &#8216;|&#8217; . $secret)) {<br \/>\n    \/\/ \u9001\u4fe1\u5185\u5bb9\u8a8d\u8a3c\u6210\u529f<br \/>\n    \/\/ \u901a\u77e5\u5185\u5bb9\u306b\u5909\u66f4\u304c\u3042\u3063\u305f\u5834\u5408\u3001\u8a8d\u8a3c\u901a\u3089\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n} else {<br \/>\n    \/\/ \u9001\u4fe1\u5185\u5bb9\u8a8d\u8a3c\u5931\u6557<br \/>\n}<\/p>\n<p>\u3054\u5229\u7528\u306e\u304a\u5ba2\u69d8\u306b\u306f\u3054\u8ff7\u60d1\u3092\u304a\u639b\u3051\u3044\u305f\u3057\u307e\u3059\u304c\u3001\u3054\u7406\u89e3\u3054\u5354\u529b\u306e\u307b\u3069\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Thank you for using learningBOX. Since the release of Ver. 2.19, learningBOX has changed the API specifications...","protected":false},"author":6,"featured_media":91000,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","_lmt_disableupdate":"yes","_lmt_disable":"","slim_seo":{"title":"\u3010\u91cd\u8981\u3011API\uff08Push\u901a\u77e5\u6a5f\u80fd\uff09\u306e\u4ed5\u69d8\u5909\u66f4\u306b\u95a2\u3059\u308b\u3054\u6848\u5185 - learningBOX(\u30e9\u30fc\u30cb\u30f3\u30b0\u30dc\u30c3\u30af\u30b9) | \u9ad8\u6a5f\u80fd\u30fb\u9ad8\u54c1\u8cea\u306eLMS\u3092\u3053\u306e\u4fa1\u683c\u3067","description":"\u5e73\u7d20\u3088\u308alearningBOX\u3092\u3054\u5229\u7528\u3044\u305f\u3060\u304d\u3001\u8aa0\u306b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002 learningBOX\u3067\u306f\u3001Ver2.19\u306e\u30ea\u30ea\u30fc\u30b9\u3088\u308a\u3001API\u306e\u4ed5\u69d8\u3092\u5909\u66f4\u3044\u305f\u3057\u307e\u3059\u3002 \u4eca\u56de\u306e\u304a\u77e5\u3089\u305b\u306f\u3001API\u9023\u643a\u3092\u3054\u5229\u7528\u306e\u304a\u5ba2\u69d8\u5411\u3051\u306e\u5185\u5bb9\u3067\u3059\u3002 API\u306e\u5909\u66f4\u70b9\u306b\u3064\u3044\u3066 \u5909\u66f4\u524d \u5909\u66f4\u5f8c \u5b9f\u88c5\u65b9\u6cd5\u306b\u3088\u3063\u3066\u306f\u3001\u901a\u4fe1\u304c\u5931\u6557\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059"},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_vk_print_noindex":"","_veu_custom_css":"","_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-94802","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4"],"acf":[],"modified_by":"h.iritani","jetpack_featured_media_url":"https:\/\/learningbox.online\/wp-content\/uploads\/2022\/07\/topics.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/sgWaOl-api","publishpress_future_action":{"enabled":false,"date":"2026-06-30 17:35:57","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category","extraData":[]},"publishpress_future_workflow_manual_trigger":{"enabledWorkflows":[]},"_links":{"self":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts\/94802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/comments?post=94802"}],"version-history":[{"count":35,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts\/94802\/revisions"}],"predecessor-version":[{"id":106560,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/posts\/94802\/revisions\/106560"}],"wp:attachment":[{"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/media?parent=94802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/categories?post=94802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learningbox.online\/en\/wp-json\/wp\/v2\/tags?post=94802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}