Collections and share links
A collection groups itineraries and zones, like a folder. A share link opens one collection, or one itinerary, to whoever holds the link, as a read-only map in Mountaya. Share links need Map Publishing in your agreement.
Writes act as a member, so mint a session token that names one, as in the quickstart:
The examples file $ITINERARY_ID, a published itinerary of yours.
A collection takes a name and whether it is private.
Add itineraries by id. Zones are filed the same way, at /zones with zone_ids.
POST on the collection's share link mints one, or returns the one it already has.
The link opens a read-only map of the collection's published itineraries, and of its published public zones. Anyone who holds it can open it, with no account.
Your own code reads the shared content with the token in X-Share-Token, and no key.
POST /v1/collections/{collection_id}/share-link/rotatereplaces the token. The old URL stops working.DELETE /v1/collections/{collection_id}/share-linkremoves the link.
An itinerary has its own link at /v1/itineraries/{itinerary_id}/share-link, with the same calls. A zone has none: share it through a collection.