G4 Doorbell Pro capture image and send it in a notification

I am trying to grab an image from my doorbell and attach it to the notification. But I received a 404.

This is how I grab it

  - service: camera.snapshot
    data:
      filename: >-
        /media/snapshots/{{ trigger.to_state.last_changed | as_timestamp | 
        timestamp_custom("%Y-%m-%d_%H-%M-%S") }}-frontdoor.jpg
    target:
      entity_id: camera.g4_doorbell_pro_high
    enabled: true

this is how I pass to the phone:

  - service: notify.mobile_app_iphone
    data:
      title: Frontdoor Notification
      message: Person detected at {{ now().strftime('%H:%M:%S') }}
      data:
        image: >-
          /media/snapshots/{{ trigger.to_state.last_changed |              
          as_timestamp | timestamp_custom("%Y-%m-%d_%H-%M-%S") }}-frontdoor.jpg

But I got a 404

Hi were you able to resolve this? I’m getting the same error.

Yes.
I used this code:

service: notify.mobile_app_iphone
data:
  title: Frontdoor Detection
  message: UniFi Person Detected at {{ now().strftime('%H:%M:%S') }}
  data:
    image: >-
      /api/unifiprotect/thumbnail/{{ config_entry_id(trigger.entity_id) }}/{{
      state_attr(trigger.entity_id, 'event_id') }}