افزونه های Google Classroom اکنون به طور کلی در دسترس توسعه دهندگان هستند! لطفاً برای اطلاعات بیشتر به
اسناد افزونه ها مراجعه کنید.
Method: courses.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
فهرستی از دورههایی را که کاربر درخواستکننده مجاز به مشاهده آنها است، محدود به دورههایی که با درخواست مطابقت دارند، برمیگرداند. دوره های برگشتی بر اساس زمان ایجاد مرتب می شوند و جدیدترین دوره های ایجاد شده اول است.
این روش کدهای خطای زیر را برمی گرداند:
-
PERMISSION_DENIED
برای خطاهای دسترسی . - اگر آرگومان پرس و جو نادرست باشد،
INVALID_ARGUMENT
. -
NOT_FOUND
در صورتی که کاربران مشخص شده در آرگومان های پرس و جو وجود نداشته باشند.
درخواست HTTP
GET https://classroom.googleapis.com/v1/courses
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
studentId | string دوره های برگشتی را به کسانی که دانش آموزی با شناسه مشخص شده دارند محدود می کند. شناسه می تواند یکی از موارد زیر باشد: - شناسه عددی برای کاربر
- آدرس ایمیل کاربر
- رشته تحت اللفظی
"me" که کاربر درخواست کننده را نشان می دهد
|
teacherId | string دوره های برگشتی را به کسانی که معلمی با شناسه مشخص شده دارند محدود می کند. شناسه می تواند یکی از موارد زیر باشد: - شناسه عددی برای کاربر
- آدرس ایمیل کاربر
- رشته تحت اللفظی
"me" که کاربر درخواست کننده را نشان می دهد
|
courseStates[] | enum ( CourseState ) دوره های برگشتی را به دوره های در یکی از حالت های مشخص شده محدود می کند. مقدار پیش فرض ACTIVE، ARCHIVED، PROVISIONED، DECLINED است. |
pageSize | integer حداکثر تعداد اقلام برای بازگشت. صفر یا نامشخص نشان می دهد که سرور ممکن است حداکثر را اختصاص دهد. سرور ممکن است کمتر از تعداد مشخص شده نتایج را برگرداند. |
pageToken | string مقدار nextPageToken برگردانده شده از فراخوانی list قبلی، نشان می دهد که صفحه بعدی نتایج باید برگردانده شود. در غیر این صورت، درخواست list باید با درخواستی که منجر به این نشانه شده است، یکسان باشد. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
پاسخ هنگام فهرست کردن دوره ها.
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"courses": [
{
object (Course )
}
],
"nextPageToken": string
} |
فیلدها |
---|
courses[] | object ( Course ) دوره هایی که با درخواست لیست مطابقت دارند. |
nextPageToken | string نشانه شناسایی صفحه بعدی نتایج برای بازگشت. اگر خالی باشد، هیچ نتیجه دیگری در دسترس نیست. |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/classroom.courses
-
https://www.googleapis.com/auth/classroom.courses.readonly
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Method: courses.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListCoursesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` for [access errors](/workspace/classroom/reference/Access.Errors).\n- `INVALID_ARGUMENT` if the query argument is malformed.\n- `NOT_FOUND` if any users specified in the query arguments do not exist.\n\n### HTTP request\n\n`GET https://classroom.googleapis.com/v1/courses`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `studentId` | `string` Restricts returned courses to those having a student with the specified identifier. The identifier can be one of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user |\n| `teacherId` | `string` Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user |\n| `courseStates[]` | `enum (`[CourseState](/workspace/classroom/reference/rest/v1/courses#CourseState)`)` Restricts returned courses to those in one of the specified states The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. |\n| `pageSize` | `integer` Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. |\n| `pageToken` | `string` [nextPageToken](/workspace/classroom/reference/rest/v1/courses/list#body.ListCoursesResponse.FIELDS.next_page_token) value returned from a previous [list](/workspace/classroom/reference/rest/v1/courses/list#google.classroom.v1.Courses.ListCourses) call, indicating that the subsequent page of results should be returned. The [list](/workspace/classroom/reference/rest/v1/courses/list#google.classroom.v1.Courses.ListCourses) request must be otherwise identical to the one that resulted in this token. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse when listing courses.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"courses\": [ { object (/workspace/classroom/reference/rest/v1/courses#Course) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------|\n| `courses[]` | `object (`[Course](/workspace/classroom/reference/rest/v1/courses#Course)`)` Courses that match the list request. |\n| `nextPageToken` | `string` Token identifying the next page of results to return. If empty, no further results are available. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/classroom.courses`\n- `\n https://www.googleapis.com/auth/classroom.courses.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]