All Collections
Share & embed maps
Using URL signature in shared maps
Using URL signature in shared maps

Learn how to generate and use URL signatures in shared maps to prevent unauthorized changes of a shared map's URL parameters

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

In some cases, you may want to use shared maps with URL parameters. For example, to embed a shared map into a customer portal, so that when a customer logs into your portal and the customer's id becomes known, you can show on the embedded map only records assigned to this particular customer while hiding all others. To achieve this, you may add customer_id URL parameters to the shared map's link while using this URL parameter in a Map layer's formula to filter records by the customer id:

  • Map layer's formula: Customer ID equals to {{url.customer_id}}

  • Shared map's link:
    https://app.mapsly.com/sharedmap/5f329d3e01d740ea8/?customer_id=58472

In this case you're effectively using a URL parameter to restrict visibility to certain records so it's essential that the customer cannot alter the customer_id in order to see records assigned to another customer.

To prevent such an unauthorized alteration, check the Request URL signature checkbox in the Shared map configuration and add the URL signature generated for this particular link including the customer_id value. In this case, before loading the shared map Mapsly will check validity of the URL signature and will load the map only if the signature matches the link with all its URL parameters for which it was generated.

How to generate URL signature

There are several ways to do it: in the shared map configuration popup, using the automation suite, or through the API.

1- Sign a static link in 'Shared map configuration' popup

For a static link, which doesn't contain record-specific URL parameters like the customer_id, you may generate a signature right in the Shared map configuration popup.

2- Generating record-specific signed shared maps links using automation

For links with dynamic URL parameters, like the customer_id in the example above, you may create a Workflow triggered when a new customer is created with the Update field action that will generate a signed URL using the SignUrl() system function and store it in a custom field on the Account record:

Here, we're using the following target value for the Map link field that stores the shared map link that will be embedded into the customer portal:

{{SignUrl('https://app.mapsly.com/sharedmap/g6r4551fgHg6f57?customer_id=' + record.id)}}

Sign a URL via Mapsly API

[This feature is coming soon - please contact support for the current ETA.]

If you're using dynamic URL parameters that become known only immediately before a shared link is loaded, use the /signurl Mapsly API endpoint with your Mapsly API key to generate a signature for an link with URL parameters at any moment.

Did this answer your question?