افزونه های Google Classroom اکنون به طور کلی در دسترس توسعه دهندگان هستند! لطفاً برای اطلاعات بیشتر به
اسناد افزونه ها مراجعه کنید.
Method: courses.create
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
دوره ایجاد می کند.
کاربری مشخص شده در ownerId
مالک دوره ایجاد شده است و به عنوان معلم اضافه شده است. یک کاربر غیر مدیر درخواست کننده فقط می تواند یک دوره با خود به عنوان مالک ایجاد کند. ادمین های دامنه می توانند دوره های آموزشی متعلق به هر کاربری را در دامنه خود ایجاد کنند.
این روش کدهای خطای زیر را برمی گرداند:
-
PERMISSION_DENIED
اگر کاربر درخواست کننده مجاز به ایجاد دوره ها یا خطاهای دسترسی نباشد. - اگر معلم اصلی کاربر معتبری نباشد،
NOT_FOUND
. -
FAILED_PRECONDITION
اگر حساب مالک دوره غیرفعال باشد یا برای خطاهای درخواستی زیر:- UserCannotOwnCourse
- UserGroupsMembershipLimitReached
- CourseTitleCannotContainUrl
- اگر نام مستعار در
id
مشخص شده باشد و از قبل وجود داشته باشد، ALREADY_EXISTS
.
درخواست HTTP
POST https://classroom.googleapis.com/v1/courses
URL از دستور GRPC Transcoding استفاده می کند.
درخواست بدن
بدنه درخواست شامل نمونه ای از Course
است.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه جدیدی از Course
است.
محدوده مجوز
به محدوده OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/classroom.courses
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-08 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-08 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Method: courses.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a course.\n\nThe user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `NOT_FOUND` if the primary teacher is not a valid user.\n- `FAILED_PRECONDITION` if the course owner's account is disabled or for the following [request errors](/workspace/classroom/reference/Request.Errors):\n - UserCannotOwnCourse\n - UserGroupsMembershipLimitReached\n - CourseTitleCannotContainUrl\n- `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/courses`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [Course](/workspace/classroom/reference/rest/v1/courses#Course).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Course](/workspace/classroom/reference/rest/v1/courses#Course).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.courses`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]