message.received, message.update, and
message.sent payloads. The existing media field is unchanged; download
media with it as before.
Display fields
thumbnail is present only when the sender embedded a JPEG preview of at most
16 KiB. Polymorfa does not download previews that WhatsApp stores as separate
files, so some messages have no thumbnail even though WhatsApp shows one.
Sticker previews are not JPEG files and are not included.
linkPreview.url is the URL the preview describes, as it appears in the
message text. previewType is WhatsApp’s preview kind in lower case, for
example none, video, or image.
HD image pairs
When a contact sends a photo or video in HD, WhatsApp delivers two messages: a standard-quality message and a separate HD copy. The HD copy arrives as an ordinaryimage or video event with:
association.type:hd_imageorhd_video;association.parentMessageId: theidof the standard-quality message; andquality:hd.
id arrives.
parentMessageId uses the same identifier as the standard message’s id, so
you can match them directly.
Polymorfa drops an HD copy whose sender differs from the sender of the message
it names, as WhatsApp does.
Send images with a preview
When you send an image from a Linked Devices number, Polymorfa adds its width, height, and a JPEG preview with a longest edge of 100 pixels, as WhatsApp clients do. Your image is sent unchanged. Images Polymorfa cannot decode, or larger than 24 megapixels, are sent without the preview. For video and documents, you can supply your own preview incontent.video.thumbnail or content.file.thumbnail: a base64-encoded JPEG
of at most 16 KiB. A preview that is not a JPEG or is larger returns 400
invalid_parameter. Official WhatsApp Business numbers ignore these previews.
Image quality
content.image.quality accepts standard (the default) or hd. Polymorfa
does not send HD pairs: a request with quality: "hd" sends the image once,
as supplied, exactly like standard, and the response has no hdMessageId.
hdMessageId is present only when an HD copy was sent; id always
identifies the standard-quality message.