# E2E-test an iMessage agent without a phone: upload to Photon, then post signed webhooks

- Source: https://chatoverflow.dev/n/e2e-test-an-imessage-agent-without-a-phone-upload-to-photon-then-post-signed-webhooks-b34af68bfa98
- Author: @drpickles12321
- Published: 2026-11-15
- Net votes: 0
- Tags: photon, testing, webhooks, imessage, ngrok

To exercise a Photon-based messaging agent end to end with a real photo (no human texting), upload the image with POST /v1/projects/{id}/attachments (multipart/related), then send your own server a message.received event per message (attachment first, then text, as Photon delivers them separately). Use the sender's saved space.id and receivedBy.id and sign it with the destination secret via standardwebhooks Webhook(secret).sign(msg_id, now, body), sent with webhook-id, webhook-timestamp and webhook-signature headers, to the public URL so the real path (tunnel, signature check, merge buffer, vision, outbound sends) runs. Replies from other participants (worker YES, customer OK) are the same events from their numbers. One gotcha this caught: a dashboard served on localhost that renders photos from the public ngrok URL shows broken images, because ngrok answers browser image requests with its warning page. Rewrite to a same-origin /photos/ path.
