Was this article helpful?

Raw API Share

Last modified 07:57, 27 Jul 2014

Sites can leverage a wide range of share APIs that are available on the Gigya platform. These APIs include:

  • Publish User Action - publish feed items to social network newsfeeds.
  • Set Status - set the user's social network status. The status is also published to the user's newsfeed.
  • Send Notifications - send a user-to-user message.
  • Post Bookmark - serves as an end point with a UI for posting a bookmark on a bookmarking destination.
  • Facebook's Open Graph Actions - create Open Graph Actions and post them to users' timelines, tickers, and news feeds on Facebook.
     

How it Works

After a user connects to a social network once and authorizes sharing (if required) your site can leverage Gigya's API calls to share content to social networks on the user's behalf. Each network has a different set of sharing options that can be utilized. Gigya's API aggregate and optimize these sharing tools.
 

Publishing User Actions

The Publish User Action API is available both online and offline (via REST API), and enables site owners to build their own share to social network custom user interfaces. This is especially helpful for custom fitting the sharing experience or implementing a different user flow. Examples include:

  • Building a popup or dialog in your site that prompts users to share an action after a user comments on an article or watches a video. If the user approves you can call the publishUserAction API to share the content to social networks.
  • Add a checkbox or radio selection that enables users to confirm sharing to social networks when they perform an action in your site.
  • During site registration (or in the user's site profile) users can confirm which actions they want or don't want to automatically share to social networks. According to the user's selection, items will be published using the API calls. Note: using this method does not conform with LinkedIn policy; LinkedIn requires the site to get the user's consent per item that is shared.

Note: Some social networks require getting a general user consent to publishing newsfeed items to his wall. You can learn more about getting user's authorization in our Site Setup section.


Setting the User's Social Network Status

The Set Status API is available both online and offline (via REST API) and enables sites to offer users to update their social network status. Examples of using this API call include:

  • A user updates his status on your site and is prompted to share his new status with social network friends. If he approves a setStatus API call is made to update his social network status.
  • Some of Gigya's plugins, such as the activity feed event plugin, update the user's social network status using the setStatus API call. 
     

Sending a Notification to Social Network Friends

Notification are common in platform social network messaging, much like email. They can't be used to send user-to-user or application/site-to-user messages. The Send Notification API is available both online and offline (via REST API) and enables to send notifications on behalf of users or directly from the site to users.

Examples of using this API call include:

  • Sending an invitation to friends to visit a site
  • Storing a user's birthday date (after getting the user's consent and assuming it's available on the specific network) and sending a happy birthday message from your site to users who have a birthday today.
  • Enable users to send a personal message to a friend while visiting your site.

See a live example showing a notification inviting friends to visit here.
 

Facebook's Open Graph Actions

Open Graph helps people tell stories about their lives with the apps they use. Any action a user can perform in your app can be posted as an open graph action. You can implement one of Facebook's predefined built-in actions or create custom actions that represent the unique things people do in your app. For more information, please refer to the Facebook Open Graph documentation

Note that custom actions require review from Facebook before publishing. Read more on how to submit an action for review on Facebook.
The following steps need to be taken:

  1. Permission - Before your application can publish Open Graph actions to the user Timeline, ticker & News feed, the user must grant your application the Open Graph Permissions. Please make sure you have checked the "Enable publishing user activity" check box in the Site Setup > Permissions page on Gigya's website.
    During the Social Login process, the user will be presented with a Facebook UI in which she can authorize your application to perform Open Graph actions on her behalf.
    Learn more in the Facebook Setting - Permissions section.
  2. Define Objects, Actions and Aggregations through your Facebook Developer App. Please refer to the corresponding Facebook tutorial.
    Tip: Before submitting a new action for Facebook approval, you must publish at least one action to your Timeline using this action type.  Use the Graph API Explorer at https://developers.facebook.com/tools/explorer/<Your-App-ID>
  3. Define Open Graph Meta Tags.
  4. Publish Actions -  use socialize.facebookGraphOperation API method to publish Open Graph Actions.

Implementation Guide

To implement the share APIs, please refer to the following pages:

Was this article helpful?
Page statistics
4886 view(s) and 9 edit(s)
Social share
Share this page?

Tags

This page has no custom tags set.

Comments

You must to post a comment.

Attachments