Endpoint
Overview
Adds a photo or video to each phone’s photo library, where apps on the phone can pick it. On an Android it goes into the gallery’s camera folder; on an iPhone it goes into the camera roll (Recents). The photo or video comes from your media library or from a link. The request returns once the item is in each phone’s photo library and visible to apps. An import that has not finished returnsstatus: "importing": its job is still running when the request’s time limit nears, or the provider’s answer left its outcome unknown. Read Import Status until it is imported or failed.
Requires an active session on each phone.
Platforms: Android and iPhone. An iPhone with iCloud Photos turned on gets the phone error unsupported.
Supported formats: JPEG and PNG images, MP4 and MOV videos. An Android takes any photo or video the phone can show. An iPhone takes H.264 video with optional AAC audio up to 40 megapixels; a file outside that gets the phone error unsupported with the reason. A file over 1 GiB is refused with file_too_large before the phone is touched.
Request Body
Provide exactly one ofmediaId or url.
One phone, instead of
phoneIds. The answer’s data is then that phone’s result itself, not a list, and a failure on the phone is the request’s ok: false with the phone’s error (at the HTTP status of its code). Give phoneId or phoneIds, not both.The
id of a photo or video in your media library.Response
One Result per phone, in the order of
phoneIds. When ok is true, the result also has:status: "imported" means the item is in that phone’s photo library; status: "importing" means the import has not finished: its job is still running, with bytesTransferred and totalBytes, or the provider’s answer left its outcome unknown. Read Import Status until it is imported or failed.
Errors
Phone errors on a result: