<@U04S8PLJWMT> for gmail connector message_details...
# replication-ask-ai
s
@kapa.ai for gmail connector message_details stream gives Full message payloads, headers, snippet, and labels. Substream of messages. where can i get the entire email body, snippet has only part of a email and is getting cutoff
k
Getting the Full Email Body from Gmail Connector You're right that
snippet
is just a short preview. The full email body is available in the
payload
field of the
messages_details
stream. Where to find the body The
messages_details
stream returns the full message payload from the Gmail API (
users.messages.get
), which includes: [Gmail streams] •
payload.body.data
— the raw body content (base64url-encoded) for simple (non-multipart) messages •
payload.parts
— an array of MIME parts for multipart messages (e.g., emails with both plain text and HTML versions, or attachments) ◦ Each part has its own
body.data
field containing the base64url-encoded content ◦
mimeType
on each part tells you whether it's
text/plain
,
text/html
, etc. Schema reference From the
messages_details
schema: [manifest.yaml]
Copy code
payload:
  body:
    data: string (base64url-encoded body)
    size: number
  headers: array  ← sender, recipient, subject, date, etc.
  mimeType: string
  parts:
    - body:
        data: string (base64url-encoded part body)
      mimeType: string  ← e.g. "text/plain" or "text/html"
      headers: array
Key points 1. Decode the content: The
data
fields are base64url-encoded, so you'll need to decode them to get the readable text. 2. Multipart emails: Most modern emails are multipart. You'll need to iterate through
payload.parts
and find the part with
mimeType: "text/plain"
or
mimeType: "text/html"
for the full body. 3. Nested parts: Some emails have nested multipart structures (e.g.,
multipart/mixed
containing
multipart/alternative
), so you may need to recurse through
parts
within
parts
. 4. Headers:
payload.headers
contains the full email headers (From, To, Subject, Date, etc.). So in summary — the full email body is in
messages_details.payload.body.data
(simple emails) or `messages_details.payload.parts[].body.data`* (multipart emails), not in
snippet
. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.