Method: users.threads.list
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
उपयोगकर्ता के मेलबॉक्स में मौजूद थ्रेड की सूची बनाता है.
एचटीटीपी अनुरोध
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/threads
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
userId |
string
उपयोगकर्ता का ईमेल पता. पुष्टि किए गए उपयोगकर्ता की जानकारी देने के लिए, खास वैल्यू me का इस्तेमाल किया जा सकता है.
|
क्वेरी पैरामीटर
पैरामीटर |
maxResults |
integer (uint32 format)
लौटाए जाने वाले थ्रेड की ज़्यादा से ज़्यादा संख्या. यह फ़ील्ड डिफ़ॉल्ट रूप से 100 पर सेट होता है. इस फ़ील्ड के लिए ज़्यादा से ज़्यादा वैल्यू 500 है.
|
pageToken |
string
सूची में नतीजों के किसी खास पेज को वापस लाने के लिए पेज टोकन.
|
q |
string
सिर्फ़ उस क्वेरी से मैच होने वाली थ्रेड दिखाएं. यह Gmail के खोज बॉक्स की तरह ही क्वेरी फ़ॉर्मैट के साथ काम करता है. उदाहरण के लिए, "from:someuser@example.com rfc822msgid:<somemsgid@example.com>
is:unread" . gmail.metadata स्कोप का इस्तेमाल करके, एपीआई को ऐक्सेस करते समय पैरामीटर का इस्तेमाल नहीं किया जा सकता.
|
labelIds[] |
string
सिर्फ़ उन थ्रेड को दिखाता है जिनमें बताए गए सभी लेबल आईडी से मैच करने वाले लेबल हैं.
|
includeSpamTrash |
boolean
नतीजों में SPAM और TRASH की थ्रेड शामिल करें.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य भाग
अगर एपीआई सही से जुड़ जाता है, ताे जवाब के मुख्य भाग में नीचे दिए गए स्ट्रक्चर शामिल होता है.
JSON के काेड में दिखाना |
{
"threads": [
{
object (Thread )
}
],
"nextPageToken": string,
"resultSizeEstimate": integer
} |
फ़ील्ड |
threads[] |
object (Thread )
थ्रेड की सूची. ध्यान दें कि हर थ्रेड रिसॉर्स में messages की सूची शामिल नहीं होती. किसी थ्रेड के लिए messages की सूची, threads.get तरीके का इस्तेमाल करके फ़ेच की जा सकती है.
|
nextPageToken |
string
सूची में नतीजों का अगला पेज पाने के लिए पेज टोकन.
|
resultSizeEstimate |
integer (uint32 format)
नतीजों की अनुमानित कुल संख्या.
|
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.metadata
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,["# Method: users.threads.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListThreadsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nLists the threads in the user's mailbox.\n\n### HTTP request\n\n`GET https://gmail.googleapis.com/gmail/v1/users/{userId}/threads`\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### Query parameters\n\n| Parameters ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxResults` | `integer (`[uint32](https://developers.google.com/discovery/v1/type-format)` format)` Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500. |\n| `pageToken` | `string` Page token to retrieve a specific page of results in the list. |\n| `q` | `string` Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid:\u003csomemsgid@example.com\u003e is:unread\"`. Parameter cannot be used when accessing the api using the gmail.metadata scope. |\n| `labelIds[]` | `string` Only return threads with labels that match all of the specified label IDs. |\n| `includeSpamTrash` | `boolean` Include threads from `SPAM` and `TRASH` in the results. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"threads\": [ { object (/workspace/gmail/api/reference/rest/v1/users.threads#Thread) } ], \"nextPageToken\": string, \"resultSizeEstimate\": integer } ``` |\n\n| Fields ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `threads[]` | `object (`[Thread](/workspace/gmail/api/reference/rest/v1/users.threads#Thread)`)` List of threads. Note that each thread resource does not contain a list of `messages`. The list of `messages` for a given thread can be fetched using the [`threads.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/threads/get) method. |\n| `nextPageToken` | `string` Page token to retrieve the next page of results in the list. |\n| `resultSizeEstimate` | `integer (`[uint32](https://developers.google.com/discovery/v1/type-format)` format)` Estimated total number of results. |\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.readonly`\n- `\n https://www.googleapis.com/auth/gmail.metadata`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]