{"id":26,"date":"2022-03-01T09:00:00","date_gmt":"2022-03-01T09:00:00","guid":{"rendered":"https:\/\/gfejp-demo.com\/?p=26"},"modified":"2022-05-31T01:11:20","modified_gmt":"2022-05-31T01:11:20","slug":"classroom-api","status":"publish","type":"post","link":"https:\/\/apidemo.ddrive.cloud\/?p=26","title":{"rendered":"Classroom API"},"content":{"rendered":"\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001Google Classroom \u306e\u8ab2\u984c\u3068\u3057\u3066\u30a6\u30a7\u30d6\u30b3\u30f3\u30c6\u30f3\u30c4\uff08URL\uff09\u3092\u516c\u958b\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u3067\u6271\u3046\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f &nbsp;<a href=\"https:\/\/github.com\/ddrivedemo\/Devel-ClassroomAPI-Demo\">\u3053\u3061\u3089\uff08github.com\uff09<\/a>&nbsp;\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Classroom \u306b\u516c\u958b\u3059\u308b<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">\u30b5\u30a4\u30c8\u306e\u516c\u958b<\/h5>\n\n\n\n<p>\u30b3\u30fc\u30b9(\u30af\u30e9\u30b9)\u3092\u6307\u5b9a\u3057\u3066\u3001\u30b5\u30a4\u30c8\u3092\u516c\u958b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<form method=\"get\" name=\"demoform01\" target=\"_new\" action=\"\/demo\/devel_drive_api_demo_01_auth?devel_url_share\">\n  <input type=\"hidden\" name=\"state\" value=\"devel_url_share\">\n  <a href=\"#\" onclick=\"document.demoform01.submit(); return false;\" class=\"demo-button\"><img decoding=\"async\" src=\"https:\/\/apidemo.ddrive.cloud\/wp-content\/uploads\/2022\/05\/Apps-1-554x1024.png\" alt=\"\" class=\"appimage_logo\">\u3053\u306e\u30b5\u30a4\u30c8\u3092Classroom \u306b\u516c\u958b\u3059\u308b<\/a>\n<\/form>\n\n\n\n<a href=\"https:\/\/classroom.google.com\" target=\"_new\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/apidemo.ddrive.cloud\/wp-content\/uploads\/2022\/04\/icons8-google-\u6559\u5ba4-48.png\" alt=\"\" class=\"wp-image-383\" width=\"48\" height=\"48\">Classroom \u3067\u30af\u30e9\u30b9\u3092\u78ba\u8a8d\u3059\u308b<\/a><br>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>\/**\n* Web\u30b5\u30a4\u30c8\u3092Classroom\u306b\u516c\u958b\n* $client: Google\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\n* $courseId: Google Classroom\u306e\u30b3\u30fc\u30b9ID\n*\/\npublic function develUrlShare($client, $courseId) {\n\n    \/\/ Google Classroom\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\n    $service = new \\Google_Service_Classroom($client);\n\n    try {\n\n        \/\/ Google Classroom\u306e\u30b3\u30fc\u30b9\u30ef\u30fc\u30af\u3068\u3057\u3066URL\u3092\u516c\u958b\n        $postBody = new \\Google_Service_Classroom_CourseWork(array(\n            &quot;workType&quot; =&gt; &quot;ASSIGNMENT&quot;,\n            &quot;title&quot; =&gt; &quot;Share form API Demo&quot;, \/\/ \u30b3\u30fc\u30b9\u30ef\u30fc\u30af\u30bf\u30a4\u30c8\u30eb\n            &quot;state&quot; =&gt; &quot;PUBLISHED&quot;, \/\/ \u516c\u958b\u72b6\u614b\u306b\u8a2d\u5b9a\n            &quot;materials&quot;=&gt;[\n                &#39;link&#39;=&gt;[\n                    &#39;url&#39;=&gt;&#39;https:\/\/apidemo.ddrive.cloud\/&#39;, \/\/ \u516c\u958b\u3059\u308bURL\n                    &#39;title&#39;=&gt;&#39;API Demo&#39;, \/\/ URL\u306e\u540d\u524d\n                    &#39;thumbnailUrl&#39;=&gt;&#39;https:\/\/classroom.google.com\/webthumbnail?url=https:\/\/apidemo.ddrive.cloud\/&#39;\n                    ]\n            ]\n        ));\n        $coursework = $service-&gt;courses_courseWork-&gt;create($courseId, $postBody, array());\n\n    } catch(\\Exception $e) {\n        $msg = $e -&gt; getMessage();\n        return $msg;\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u30b5\u30a4\u30c8\u3078\u306e\u30ea\u30f3\u30af\u3092\u8cbc\u4ed8\u3057\u3066\u3001\u30b3\u30fc\u30b9\u306b\u8ab2\u984c\u3092\u4f5c\u6210\u3057\u3066\u516c\u958b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c7\u30e2\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u9078\u629e\u3057\u305f\u30b3\u30fc\u30b9\u306b\u672c\u30b5\u30a4\u30c8\uff08https:\/\/apidemo.ddrive.cloud\/\uff09\u304c\u516c\u958b\u3055\u308c\u307e\u3059<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001Google Classroom \u306e\u8ab2\u984c\u3068\u3057\u3066\u30a6\u30a7\u30d6\u30b3\u30f3\u30c6\u30f3\u30c4\uff08URL\uff09\u3092\u516c\u958b\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u6271\u3046\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f &nbsp;\u3053\u3061\u3089\uff08github.com\uff09&nbsp;\u304b\u3089\u30c0\u30a6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-developer"],"_links":{"self":[{"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":21,"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":611,"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions\/611"}],"wp:attachment":[{"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apidemo.ddrive.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}