Method: invitations.create
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Crea un invito. Può esistere un solo invito per utente e corso alla volta. Elimina e ricrea un invito per apportare modifiche.
Questo metodo restituisce i seguenti codici di errore:
PERMISSION_DENIED
se l'utente che effettua la richiesta non è autorizzato a creare inviti per questo corso o per errori di accesso.
NOT_FOUND
se il corso o l'utente non esistono.
FAILED_PRECONDITION
:
- se l'account dell'utente richiesto è disattivato.
- se l'utente dispone già di questo ruolo o di un ruolo con autorizzazioni maggiori.
- per i seguenti errori di richiesta:
ALREADY_EXISTS
se esiste già un invito per l'utente e il corso specificati.
Richiesta HTTP
POST https://classroom.googleapis.com/v1/invitations
L'URL utilizza la sintassi di transcodifica gRPC.
Corpo della richiesta
Il corpo della richiesta contiene un'istanza di Invitation
.
Corpo della risposta
In caso di esito positivo, il corpo della risposta contiene un'istanza di Invitation
appena creata.
Ambiti di autorizzazione
Richiede il seguente ambito OAuth:
https://www.googleapis.com/auth/classroom.rosters
Per ulteriori informazioni, consulta la Guida all'autorizzazione.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 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)."]]