Come indicato nella panoramica, per ricevere un invito, un account utente deve soddisfare più criteri. Puoi utilizzare il metodo
IsInvitableUser()
per scoprire se un determinato account utente è idoneo.
GET https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com:isInvitableUser
Recupero degli inviti degli utenti
L'API User Invitation fornisce metodi per recuperare un singolo invito
dell'utente e recuperarli tutti. Quando recuperi tutti gli inviti degli utenti,
se vuoi puoi filtrarli in base allo stato e impostare l'ordine di ordinamento.
Recupero di un invito per un singolo utente
REST
Per recuperare l'invito di un singolo utente, chiama
customers.userinvitations.get()
con l'ID cliente e l'indirizzo email dell'account.
Richiesta di esempio
GET https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com
Recupero di un elenco di inviti all'utente
Tutti gli utenti non gestiti vengono visualizzati automaticamente come inviti nello stato NOT_YET_SENT
fino a quando l'amministratore o l'utente finale non interviene. Una volta accettato un invitato dall'utente, l'account non è più considerato non gestito.
Se chiami
customers.userinvitations.list()
con lo stato nella richiesta, verranno restituiti solo gli utenti il cui invito
è in quello stato.
Puoi verificare la presenza di più stati aggiungendo un operatore or al filtro:
state=='accepted'||state=='declined'
REST
Per recuperare un elenco di inviti utente, chiama
customers.userinvitations.list()
con l'ID cliente e gli eventuali parametri di query per filtrare, ordinare e
paginare i risultati. L'esempio seguente restituisce un elenco di tutti gli utenti non gestiti, ordinati in ordine decrescente in base all'ora dell'ultimo aggiornamento.
Richiesta di esempio
GET https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations?filter=state!='accepted'&orderBy='updateTime desc'
Invio di inviti agli utenti
Gli inviti agli utenti non vengono inviati automaticamente agli utenti idonei. Una volta ottenuto un elenco degli utenti che vuoi invitare, puoi utilizzare il metodo customers.userinvitations.send().
Verrà creato anche un invito, se non esiste.
REST
Per inviare un'email di invito a un utente, chiama
customers.userinvitations.send()
con l'ID cliente e l'indirizzo email dell'account utente.
Richiesta di esempio
POST https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com:send
Annullamento degli inviti degli utenti
Gli inviti degli utenti possono essere annullati finché non vengono accettati o rifiutati.
Chiama il metodo
customers.userinvitations.cancel()
per annullare un invito.
REST
Per annullare un invito a un utente, chiama
customers.userinvitations.cancel()
con l'ID cliente e l'indirizzo email dell'account utente.
Richiesta di esempio
POST https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com:cancel
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis page provides guidance on using the Cloud Identity User Invitation API to manage user invitations, including checking eligibility, retrieving, sending, and canceling them.\u003c/p\u003e\n"],["\u003cp\u003eYou can verify if a user account is eligible for an invitation using the \u003ccode\u003eIsInvitableUser()\u003c/code\u003e method, which requires the customer ID and the user's email address.\u003c/p\u003e\n"],["\u003cp\u003eThe API allows retrieval of single or multiple user invitations, with the option to filter by state and sort the results when retrieving a list of invitations.\u003c/p\u003e\n"],["\u003cp\u003eUser invitations are not automatically sent; you must use the \u003ccode\u003ecustomers.userinvitations.send()\u003c/code\u003e method to send an invitation email to a specific user, which also creates the invitation if one does not already exist.\u003c/p\u003e\n"],["\u003cp\u003eUser invitations can be canceled until they are accepted or declined, by using the \u003ccode\u003ecustomers.userinvitations.cancel()\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["# Creating and managing user invitations\n======================================\n\nThis page explains how to perform some fundamental operations with the\nCloud Identity User Invitation API.\n\nBefore you begin\n----------------\n\n**Note:** Before you use any of the Cloud Identity APIs, you must set up\nCloud Identity. See [Setting up Cloud Identity](/identity/docs/set-up-cloud-identity-admin)\nfor instructions.\n\nPerform the following tasks before proceeding with the information on this page:\n\n- Read the [User Invitation API overview](/identity/docs/concepts/overview-user-invitations).\n- Set up the [User Invitation API](/identity/docs/how-to/setup-user-invitations).\n\nDetermining invitation eligibility\n----------------------------------\n\nAs noted in the [overview](/identity/docs/concepts/overview-user-invitations),\nto be invited a user account must meet multiple criteria. You can use the\n[`IsInvitableUser()`](/identity/docs/reference/rest/v1/customers.userinvitations/isInvitableUser)\nmethod to find out if a given user account is eligible. \n\n### REST\n\nTo check the eligibility of a user account, call\n[`customers.userinvitations.isInvitableUser()`](/identity/docs/reference/rest/v1/customers.userinvitations/isInvitableUser)\nwith the customer ID and the account's email address.\n\n**Sample request** \n\n GET https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com:isInvitableUser\n\nRetrieving user invitations\n---------------------------\n\nThe User Invitation API provides methods for retrieving a single user\ninvitation and retrieving all of them. When retrieving all user invitations,\nyou can optionally filter them by state and set the sorting order.\n\n### Retrieving a single user invitation\n\n### REST\n\nTo retrieve a single user invitation, call\n[`customers.userinvitations.get()`](/identity/docs/reference/rest/v1/customers.userinvitations/get)\nwith the customer ID and the account's email address.\n\n**Sample request** \n\n GET https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com\n\n### Retrieving a list of user invitations\n\nAll unmanaged users appear automatically as invitations in the `NOT_YET_SENT`\nstate until otherwise acted upon by either the admin or the end user. Once an\ninvitation is accepted by the user, the account is no longer considered\nunmanaged.\n\n- If you call [`customers.userinvitations.list()`](/identity/docs/reference/rest/v1/customers.userinvitations/list) with the state in the request, it will return only users whose invitation is in that state.\n- If you call [`customers.userinvitations.list()`](/identity/docs/reference/rest/v1/customers.userinvitations/list) without the state in the request, it will return all user invitations.\n\nYou can check for multiple states by adding an `or` operator in the filter:\n`state=='accepted'||state=='declined'` \n\n### REST\n\nTo retrieve a list of user invitations, call\n[`customers.userinvitations.list()`](/identity/docs/reference/rest/v1/customers.userinvitations/list)\nwith the customer ID and any desired query parameters to filter, order, and\npaginate the results. The following example returns a list of all unmanaged\nusers, ordered by the last updated time in descending order.\n\n**Sample request** \n\n GET https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations?filter=state!='accepted'&orderBy='updateTime desc'\n\nSending user invitations\n------------------------\n\nUser invitations are not automatically sent to eligible users. Once you have a\nlist of the users you want to invite, you can use the\n[`customers.userinvitations.send()`](/identity/docs/reference/rest/v1/customers.userinvitations/send) method.\nThis will also create an invitation if it doesn't exist. \n\n### REST\n\nTo send a user invitation email to a user, call\n[`customers.userinvitations.send()`](/identity/docs/reference/rest/v1/customers.userinvitations/send)\nwith the customer ID and the user account's email address.\n\n**Sample request** \n\n POST https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com:send\n\nCanceling user invitations\n--------------------------\n\nUser invitations can be canceled until they are either accepted or declined.\nCall the\n[customers.userinvitations.cancel()](/identity/docs/reference/rest/v1/customers.userinvitations/cancel)\nmethod to cancel an invitation. \n\n### REST\n\nTo cancel a user invitation, call\n[customers.userinvitations.cancel()](/identity/docs/reference/rest/v1/customers.userinvitations/cancel)\nwith the customer ID and the user account's email address.\n\n**Sample request** \n\n POST https://cloudidentity.googleapis.com/v1/customers/C00000000/userinvitations/writer@altostrat.com:cancel"]]