Skip to main content

Share Sheet API

Introduction​

The Share Sheet API allows users to easily share URLs with their friends on Snapchat’s desktop experience: Snapchat for Web. This documentation provides a comprehensive guide on how to implement the Share Sheet feature for applications.

Overview​

By integrating the Share Flow, users can seamlessly send links, such as www.snapchat.com, via Snapchat to their friends. This document outlines the steps necessary to encode and share a URL, and how the user experience unfolds depending on their login status.

Step-by-Step Instructions​

  1. Select the URL: Choose the website or page URL you wish to share.
  2. Encode the URL: Use encodeURIComponent to encode the selected URL.
  3. Generate the Share Link: Append the encoded URL to www.snapchat.com/share?link=.
  4. Share the Link: Distribute the generated share link to allow users to share content via Snapchat.

Implementation Guide by Example​

Example: Sharing www.snapchat.com

Step 1: URL Encoding​

Before sharing a URL, it must be properly encoded. For example, encode www.snapchat.com as follows:

Encoded URL: https%3A%2F%2Fwww.snapchat.com%2F

Once the URL is encoded, append it to the base URL for sharing:

Share link format: www.snapchat.com/share?link=<encoded_url>

For the example URL, it would look like:

www.snapchat.com/share?link=https%3A%2F%2Fwww.snapchat.com%2F

Step 3: User Navigation and Experience​

  1. Users click on the constructed share link.
  2. User Login Status:
    • Logged-In Users: They are redirected to the Snapchat Desktop Web page.
      • share-sheet-1.png
    • Non-Logged-In Users: They are directed to the login page. After successfully logging in, they are redirected to the Snapchat Desktop Web app with the same Logged-In Users view showing above.
      • share-sheet-2.png
  3. Users click and choose which friends to share and click the Send button.
    • If sent to one single user, it will navigate to the conversation view with the link and the comment sent to the user.
      • share-sheet-3.pngshare-sheet-4.png
    • If sent to multiple users, it will navigate to the main view.

URL Format​

https://www.snapchat.com/share?link={the url to share}

URL Parameters​

ParameterTypeRequiredDescription
linkStringYesThe URL that the user wants to share on Snapchat. It should be a properly encoded, fully qualified URL.

URL Encoding​

URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). This process replaces unsafe ASCII characters with a '%' followed by two hexadecimal digits representing the character's ASCII code. Following is an example:

Before
https://www.snapchat.com/

After
https%3A%2F%2Fwww.snapchat.com%2F

HTML Code Example​

When a user navigates to a link such as https://www.snapchat.com/

<a href="https://www.snapchat.com/share?link=https%3A%2F%2Fwww.snapchat.com%2F">
<img src="snap_icon.png" alt="Snapchat logo" /> Share to Snapchat
</a>

Note: ensure your Snap icon adheres to our Brand Guidelines.

Was this page helpful?
Yes
No