Method: users.get
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בקשת HTTP
GET https://admin.googleapis.com/admin/directory/v1/users/{userKey}
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
userKey |
string
מזהה את המשתמש בבקשת ה-API. הערך יכול להיות כתובת האימייל הראשית של המשתמש, כתובת אימייל חלופית או מזהה משתמש ייחודי.
|
פרמטרים של שאילתה
פרמטרים |
customFieldMask |
string
רשימה מופרדת בפסיקים של שמות של סכימות. כל השדות מהסכמות האלה מאוחזרים. צריך להגדיר את הערך הזה רק כאשר projection=custom .
|
projection |
enum (Projection )
קבוצת המשנה של השדות שרוצים לאחזר עבור המשתמש הזה.
|
viewType |
enum (ViewType )
האם לאחזר את התצוגה הציבורית של המשתמש שזמינה רק לאדמינים או את התצוגה הציבורית ברמת הדומיין. מידע נוסף זמין במאמר אחזור משתמש כמשתמש שאינו אדמין.
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התשובה
אם הפעולה מצליחה, גוף התגובה מכיל מופע של User
.
היקפי הרשאה
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly
מידע נוסף זמין במדריך ההרשאות.
היטל
טיפוסים בני מנייה (enum) |
BASIC |
אין לכלול שדות מותאמים אישית של המשתמש. |
CUSTOM |
כוללים שדות מותאמים אישית מתבניות שביקשת ב-customFieldMask . |
FULL |
צריך לכלול את כל השדות שמשויכים למשתמש הזה. |
ViewType
טיפוסים בני מנייה (enum) |
admin_view |
התוצאות כוללות גם שדות של משתמשים עם הרשאת אדמין בלבד וגם שדות של משתמשים שגלויים לכולם בדומיין. |
domain_public |
התוצאות כוללות רק שדות של המשתמש שגלויים לכולם למשתמשים אחרים בדומיין. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["Retrieves a user.\n\nHTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/users/{userKey}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| `userKey` | `string` Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. |\n\nQuery parameters\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customFieldMask` | `string` A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`. |\n| `projection` | `enum (`[Projection](/workspace/admin/directory/reference/rest/v1/users/get#Projection)`)` What subset of fields to fetch for this user. |\n| `viewType` | `enum (`[ViewType](/workspace/admin/directory/reference/rest/v1/users/get#ViewType)`)` Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](https://developers.google.com/workspace/admin/directory/v1/guides/manage-users#retrieve_users_non_admin). |\n\nRequest body\n\nThe request body must be empty.\n\nResponse body\n\nIf successful, the response body contains an instance of [User](/workspace/admin/directory/reference/rest/v1/users#User).\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/admin.directory.user`\n- `\n https://www.googleapis.com/auth/admin.directory.user.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nProjection\n\n| Enums ||\n|----------|--------------------------------------------------------------------|\n| `BASIC` | Do not include any custom fields for the user. |\n| `CUSTOM` | Include custom fields from schemas requested in `customFieldMask`. |\n| `FULL` | Include all fields associated with this user. |\n\nViewType\n\n| Enums ||\n|-----------------|--------------------------------------------------------------------------------------------------|\n| `admin_view` | Results include both administrator-only and domain-public fields for the user. |\n| `domain_public` | Results only include fields for the user that are publicly visible to other users in the domain. |"]]