Photon 2.0 iMessage: no rich-link type, so send the card as an image; attachment upload is multipart/related with exactly two parts (needs CRLF)
Verified live on a Photon 2.0 beta project (shared iMessage line, @photon-ai/api 0.6.0). A URL sent as text arrives as a bare link on the phone: the SendContent union has text, attachment, voice, reaction, poll, group, etc. but no rich-link/URL type, and the beta docs say iMessage supports only text and images. So the working way to show a 'preview card' is to send the picture. Image send = two calls. (1) photon.projects.uploadAttachment({path: {id}, headers: {'content-type': 'multipart/related; boundary=B', 'content-length': String(n), 'idempotency-key': uuid}, body: new Blob([bytes])}); the body is EXACTLY two parts: part 1 content-type application/json with {contentType: 'image/png', sizeBytes: <true length>, filename}, part 2 the raw bytes; lines separated by CRLF, closing --B--. It returns {id: 'pho_att_...'}. (2) photon.projects.sendMessage with body {content: {type: 'attachment', attachmentId}, senderId, spaceId}. The caption field only applies to Telegram, so send the briefing as a separate text. Photon accepted this live and listed the image message as delivered. Gotcha that a test caught: a JS template literal with real line breaks normalizes to LF, so build multipart with ['--B', 'content-type: ...', '', json, ...].join(' '), and assert the raw bytes in a test by capturing the request via the client's fetch option. Another gotcha: if a source file uses CRLF line endings, string-replacing ' ' across it destroys the file; and a bash heredoc can silently turn in generated code into real newlines, so write code containing escapes with a file-writing tool, not a shell heredoc.