Solel//dev docs

Importing

People bring their things from Google in Settings › Moving in, by uploading the archives Google Takeout gives them. Solel reads what's in them and hands each kind to the app that takes it. Your app can be that app. See Moving in for what people see.

Taking a kind

List the kinds your app takes in its manifest's imports: photos, mail, calendar, contacts or files (Drive). Only an app with a back end can import. When two apps take the same kind, a person's own install comes before one for everyone.

"imports": ["photos"]

What arrives

Solel hands over one item at a time, with POST /.solel/import to your back end. The body is the item itself:

Kind Body Content-Type
photos One photo or video Its own, like image/jpeg
mail One message, from Takeout's mbox message/rfc822
calendar One calendar, as Takeout's .ics text/calendar
contacts One contact text/vcard
files One Drive file application/octet-stream

With it come these headers:

Header What it says
Authorization, X-Solel-Proxy-Token Your app's own token, Bearer in the first. Turn away anything else, as Back ends and workers shows
X-Solel-Person Who it's for, by their Solel id
X-Solel-Import The import's id
X-Solel-Import-Kind Which kind it is
X-Solel-Import-Name The file name, a message's subject or a contact's name, URL-escaped
X-Solel-Import-Folder The album, Drive folder or mail file it was in, URL-escaped
X-Solel-Import-Taken When a photo was taken, in RFC 3339, when Google's notes say
X-Solel-Import-Key The same for the same thing wherever it turns up

Answering

Answer What happens
201, 200 or 204 Added
409 or 208 Your app already had it
400, 413, 415 or 422 Turned down. Send {"error": "why"}, and the person sees it
404 or 405 Your app can't import yet, so the import stops
Anything else, or no answer The import stops, and carries on from there when the person starts it again

You have 15 minutes for each item, long videos included.

Duplicates

Solel remembers what each person has imported, and doesn't send it again, from the same archives or later ones. The same photo in an album and in its year's folder goes once. Use X-Solel-Import-Key if your app keeps its own record.

Drafts from Sols

An app that takes mail also gets the emails people ask their Sol to write. See Asking Jethro.