Sharing API

 

Overview

ShareThis enables site publishers a simple one-button solutions for users to share site content with others through social bookmarking destinations. ShareThis promotes sharing of interesting content among users connected by a social graph and shared interests. Publisher's benefit from insights on how their content is shared and disseminated among the user community.

The Sharing API can be integrated with any JavaScript, Flash, or mobile application which accesses the Internet.

 

Setup

  1. Register a ShareThis Account and get a secret access key. See Usage for details.
  2. Visit the Get Button Page. Don't worry about configuring the widget at this point.
  3. Place the generated code in the <head> tag of your page. The code snippet should include your Publisher ID (e.g. publisher=997248ff-83e6-48e9-a00f-97c75abcff93). Your code snippet will look similar to the example below.
 
 
<script type="text/javascript" src="http://w.sharethis.com/button/button.js
#publisher=YOUR_PUBLISHER_ID&amp;type=website&amp;button=false"></script>

Note: Be sure to include your own Publisher ID when implementing the code.

 
 

Base Endpoint URL

ShareThis provides endpoints that allow developers and sites to customize the sharing experience for their users while leveraging the ShareThis infrastructure for sharing, tracking, and analytics of a users sharing behavior.

All endpoints are accessed from:

 
http://rest.sharethis.com/share/

Sharing Through Social Destinations

We recommend icons be placed within an <a> tag on the page. A list of supported social services can be found here.

 
 
 

Supported Social Destinations

For the updated list of sharing destinations that we support, click here.

 

User Authentication (OAuth)

ShareThis allows users to authenticate using their social identity, access their address books, and link these social identities. Presently, users may login using Facebook, Twitter, and Yahoo through OAuth and link multiple accounts to their primary login. OAuth is an open standard for user authentication (see Oauth Overview) and is now adopted by most major social networks. A primary benefit of this approach is allowing 3rd party applications to leverage user credentials to access social network services without requiring login/passwords from users. Users permit selective access to data on these social networks (e.g. list of friends, address book) based on opt-in.

Once logged in, ShareThis maintains basic user information such as their connected services, and identity strings as provided by these services. This information is accessible by client applications to customize the user experience. An example of usage is to allow users to directly post to their social stream without leaving the client application (e.g. video player) through ShareThis provided APIs (see below). Applications focus on delivering personalized user experiences leaving ShareThis to manage access to various social credentials of the user. ShareThis returns a unique token for each such user along with a list of social identities (e.g. facebook, twitter, etc) that user has already linked. Client applications may store this token locally and use it in subsequent requests. Applications can request additional information about users (through token) so long as that user has agreed to make that data available to ShareThis (and 3rd party applications in general).

 
 
 
 
 
 

Direct Sharing to Social Services via API

Direct posting allows users to share content without leaving their current site or application. Users must grant OAuth permissions for this capability. Direct posting is supported for the following social platforms:

  1. 1. Facebook
  2. 2. Twitter



To get started, follow these steps:

  1. 1. Determine if User is signed-in by looking up the user token for the user. If no user token is available, initiate user authentication (see User Authentication). This will return a user token
  2. 2. Shorten the URL
  3. 3. Post to the social service