Method: users.getProfile
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הפונקציה מקבלת את פרופיל Gmail של המשתמש הנוכחי.
בקשת HTTP
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/profile
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
userId |
string
זוהי כתובת האימייל של המשתמש. אפשר להשתמש בערך המיוחד me כדי לציין את המשתמש המאומת.
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התשובה
פרופיל של משתמש ב-Gmail.
אם הפעולה מצליחה, גוף התגובה מכיל נתונים במבנה הבא:
ייצוג ב-JSON |
{
"emailAddress": string,
"messagesTotal": integer,
"threadsTotal": integer,
"historyId": string
} |
שדות |
emailAddress |
string
זוהי כתובת האימייל של המשתמש.
|
messagesTotal |
integer
המספר הכולל של ההודעות בתיבת הדואר.
|
threadsTotal |
integer
המספר הכולל של השרשור בתיבת הדואר.
|
historyId |
string
המזהה של רשומת ההיסטוריה הנוכחית של תיבת הדואר.
|
היקפי הרשאה
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.metadata
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["# Method: users.getProfile\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.Profile.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGets the current user's Gmail profile.\n\n### HTTP request\n\n`GET https://gmail.googleapis.com/gmail/v1/users/{userId}/profile`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------|\n| `userId` | `string` The user's email address. The special value `me` can be used to indicate the authenticated user. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nProfile for a Gmail user.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------|\n| ``` { \"emailAddress\": string, \"messagesTotal\": integer, \"threadsTotal\": integer, \"historyId\": string } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------|\n| `emailAddress` | `string` The user's email address. |\n| `messagesTotal` | `integer` The total number of messages in the mailbox. |\n| `threadsTotal` | `integer` The total number of threads in the mailbox. |\n| `historyId` | `string` The ID of the mailbox's current history record. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://mail.google.com/`\n- `\n https://www.googleapis.com/auth/gmail.modify`\n- `\n https://www.googleapis.com/auth/gmail.compose`\n- `\n https://www.googleapis.com/auth/gmail.readonly`\n- `\n https://www.googleapis.com/auth/gmail.metadata`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]