Method: invitations.create
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יצירת הזמנה. בכל רגע נתון יכולה להתקיים רק הזמנה אחת למשתמש ולקורס. מוחקים את ההזמנה ויוצרים אותה מחדש כדי לבצע שינויים.
השיטה הזו מחזירה את קודי השגיאה הבאים:
PERMISSION_DENIED
אם למשתמש המבקש אין הרשאה ליצור הזמנות לקורס הזה, או בגלל שגיאות גישה.
NOT_FOUND
אם הקורס או המשתמש לא קיימים.
FAILED_PRECONDITION
:
- אם החשבון של המשתמש המבוקש מושבת.
- אם למשתמש כבר יש את התפקיד הזה או תפקיד עם הרשאות גבוהות יותר.
- לשגיאות הבקשה הבאות:
ALREADY_EXISTS
אם כבר יש הזמנה למשתמש ולקורס שצוינו.
בקשת HTTP
POST https://classroom.googleapis.com/v1/invitations
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
גוף הבקשה
גוף הבקשה מכיל מופע של Invitation
.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע חדש של Invitation
.
היקפי הרשאה
נדרש היקף הרשאות OAuth הבא:
https://www.googleapis.com/auth/classroom.rosters
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["# Method: invitations.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 an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `NOT_FOUND` if the course or the user does not exist.\n- `FAILED_PRECONDITION`:\n - if the requested user's account is disabled.\n - if the user already has this role or a role with greater permissions.\n - for the following [request errors](/workspace/classroom/reference/Request.Errors):\n - IneligibleOwner\n- `ALREADY_EXISTS` if an invitation for the specified user and course already exists.\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/invitations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [Invitation](/workspace/classroom/reference/rest/v1/invitations#Invitation).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Invitation](/workspace/classroom/reference/rest/v1/invitations#Invitation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.rosters`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]