افزونه های Google Classroom اکنون به طور کلی در دسترس توسعه دهندگان هستند! لطفاً برای اطلاعات بیشتر به
اسناد افزونه ها مراجعه کنید.
Method: invitations.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
فهرستی از دعوتنامههایی را برمیگرداند که کاربر درخواستکننده مجاز به مشاهده آنها است، محدود به دعوتهایی که با درخواست فهرست مطابقت دارند.
توجه: حداقل یکی از userId
یا courseId
باید ارائه شود. هر دو زمینه قابل عرضه است.
این روش کدهای خطای زیر را برمی گرداند:
درخواست HTTP
GET https://classroom.googleapis.com/v1/invitations
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
userId | string دعوتهای برگشتی را برای یک کاربر خاص محدود میکند. شناسه می تواند یکی از موارد زیر باشد: - شناسه عددی برای کاربر
- آدرس ایمیل کاربر
- رشته تحت اللفظی
"me" که کاربر درخواست کننده را نشان می دهد
|
courseId | string دعوت نامه های برگشتی را برای دوره هایی با شناسه مشخص شده محدود می کند. |
pageSize | integer حداکثر تعداد اقلام برای بازگشت. پیش فرض 500 در صورت نامشخص یا 0 است. سرور ممکن است کمتر از تعداد مشخص شده نتایج را برگرداند. |
pageToken | string مقدار nextPageToken برگردانده شده از فراخوانی list قبلی، نشان می دهد که صفحه بعدی نتایج باید برگردانده شود. در غیر این صورت، درخواست list باید با درخواستی که منجر به این نشانه شده است، یکسان باشد. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
هنگام فهرست کردن دعوتنامه ها پاسخ دهید.
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"invitations": [
{
object (Invitation )
}
],
"nextPageToken": string
} |
فیلدها |
---|
invitations[] | object ( Invitation ) دعوتنامههایی که با درخواست فهرست مطابقت دارند. |
nextPageToken | string نشانه شناسایی صفحه بعدی نتایج برای بازگشت. اگر خالی باشد، هیچ نتیجه دیگری در دسترس نیست. |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/classroom.rosters
-
https://www.googleapis.com/auth/classroom.rosters.readonly
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Method: invitations.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.ListInvitationsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request.\n\n*Note:* At least one of `userId` or `courseId` must be supplied. Both fields can be supplied.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` for [access errors](/workspace/classroom/reference/Access.Errors).\n\n### HTTP request\n\n`GET https://classroom.googleapis.com/v1/invitations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `userId` | `string` Restricts returned invitations to those for a specific user. 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| `courseId` | `string` Restricts returned invitations to those for a course with the specified identifier. |\n| `pageSize` | `integer` Maximum number of items to return. The default is 500 if unspecified or `0`. The server may return fewer than the specified number of results. |\n| `pageToken` | `string` [nextPageToken](/workspace/classroom/reference/rest/v1/invitations/list#body.ListInvitationsResponse.FIELDS.next_page_token) value returned from a previous [list](/workspace/classroom/reference/rest/v1/invitations/list#google.classroom.v1.Invitations.ListInvitations) call, indicating that the subsequent page of results should be returned. The [list](/workspace/classroom/reference/rest/v1/invitations/list#google.classroom.v1.Invitations.ListInvitations) 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 invitations.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"invitations\": [ { object (/workspace/classroom/reference/rest/v1/invitations#Invitation) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| `invitations[]` | `object (`[Invitation](/workspace/classroom/reference/rest/v1/invitations#Invitation)`)` Invitations 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.rosters`\n- `\n https://www.googleapis.com/auth/classroom.rosters.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]