Was this article helpful?

socialize.postBookmark

Last modified 07:43, 24 Jun 2014

Description

This method serves as an end point with a UI for posting a bookmark on a bookmarking destination. The method redirects the user to the specified bookmarking destination. This method has no response.

Supporting Providers

The following providers currently support this operation: Facebook, Twitter, Googleplus, Messenger, LinkedIn, Digg, Del.icio.us, Google Bookmarks, My AOL, Baidu, StumbleUpon, Orkut, Skyrock, Tencent QQ, Sina Weibo, Kaixin, Renren, mixi, VZnet, FriendFeed, Reddit, Box.net, Tumblr, Plaxo, Technorati, Faves, Newsvine, Fark, Mixx, Bit.ly, Hatena, Mister Wong, Amazon, Gmail, NetLog, Evernote, AOL Mail, Current TV, Yardbarker, BlinkList, Diigo, DropJack, Segnalo, LinkaGoGo, Kaboodle, Skimbit, Formspring, V Kontakte, Pinterest, Spiceworks, Viadeo, nk.pl, Xing, Tuenti, Odnoklassniki, Douban.

Notes:
In addition to the above automatic destinations, Gigya supports numerous more destinations. These destinations should be explicitly requested. Please contact your Gigya account manager or contact us by filling in a support form on our site. You can also access the support page by clicking "Support" on the upper menu of Gigya's site. Check out the list of additional destinations here
Selection of a Google provider, should conform to Google's Buttons Policy at https://developers.google.com/+/web/buttons-policy.

 

Syntax

gigya.socialize.postBookmark(params)

 

Method Parameters

The following table lists the params object members:

Required Name Type Description
Required provider string The provider to which to post the bookmark. The optional values for this parameter are:
'facebook', 'twitter', 'googleplus', 'messenger', 'linkedin', 'digg', 'delicious', 'googlebookmarks', 'myaol', 'baidu', 'stumbleupon', 'orkut', 'skyrock', 'qq', 'sina', 'kaixin', 'renren', 'mixi', 'vznet', 'friendfeed', 'reddit', 'boxnet', 'tumblr', 'plaxo', 'technorati', 'faves', 'newsvine', 'fark', 'mixx', 'bitly', 'hatena', 'misterwong', 'amazon', 'gmail', 'netlog', 'evernote', 'aolmail', 'currenttv', 'yardbarker', 'blinklist', 'diigo', 'dropjack', 'segnalo', 'linkagogo', 'kaboodle', 'skimbit', 'formspring', 'vkontakte', 'pinterest', 'spiceworks', 'viadeo', 'nkpl', 'xing', 'tuenti', 'odnoklassniki', 'douban'.
  url URL The URL of the bookmark to post. This parameter is Required only if the linkback field of the UserAction is not specified.
Optional actionAttributes JSON object In Gamification your users receive points for actions they perform on your site, in this case posting a bookmark grants the user points. Action Attributes may be used to annotate actions with additional information, such as the section of the web site that generated the action. If you set here the actionAttributes, each time a user posts a bookmark, the action also receives an attribute, for example "tv-show":"glee", which can mean that the action was performed on the "Glee" page of the site. 
These action attributes are later used to display the GM Plugins filtered according to a certain attribute. For example, you can show the Leaderboard plugin only for top users on the "Glee" page. 
actionAttributes contain a JSON object comprised of a series of attribute keys (categories) with associated values. You can also use a generic "tags" key. No more than three values can be given, they can be with a single key or each have their own key. For more information see Variants and Action Attributes. Action attributes are later used to filter GM Plugins by a certain attribute.
Example:  {"<attribute key1>": ["<attribute value1>", "<attribute value2>"],  "<attribute key2>": "<attribute value3>" }
  cid string A string of maximum 100 characters length. The CID sets categories for transactions that can be used later for filtering reports generated by Gigya in the "Context ID" combo box. The CID allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. You should not define more than 100 different context IDs.
  description string The description of the bookmark. Note: some of the bookmark destinations do not support assigning a description to the bookmark.
  providerKey string The provider-specific API Key. This parameter is used when calling this method for providers that require an API key.
  shortURLs string Using this parameter you may determine whether to use Gigya's URL shortening service for URLs passed in the status parameter. The optional values for this parameter are:
  • 'always' (default): always try to shorten URLs. Where providers permit, URLs are shortened to the fw.to domain. Customers using the European data center are shortened to the shr.gs domain.This setting does not affect 'reddit', 'pinterest' and 'pinterestpinit'
  • 'whenRequired': URLs longer than 139 characters are shortened in accordance with provider preferences. The URL will not be shortened for 'delicious', 'digg', 'stumbleupon', 'technorati' and 'mixx', as they do not support this functionality.
  • 'never' - never shorten URLs. Where providers permit, URLs are left untouched.
  tags string A comma separated list of tags that are used to identify the share operation.
  target string The user ID in the social network. Used to enable opening FB feed dialog to allow a user to post to a friend(s) wall. Currently only Facebook is supported.
  thumbnailURL string The URL of the thumbnail image. Note: this parameter is required for Pinterest in order to work.
  title string The title to assign to the bookmark. Note: some of the bookmark destinations do not support assigning a title to the bookmark.
  userAction UserAction object
When specified, the parameters of the bookmark will be taken from this object, but they may be overridden by the other (existing) explicit parameters if those are specified. The default values of the userAction fields (if not overridden) are:
  • Title - the UserAction title.
  • Link Back - the URL of the bookmark to post. If the url parameter is not specified, this parameter is Required.
  • Description - the UserAction description.
  • thumbnailURL -  the first media item of type "image" in the UserAction object.

 

Code Sample

var params = 
{
	url: "http://www.gigya.com/"
	,provider:'pinterest'
	,title: "Gigya"
	,thumbnailURL :'http://www.gigya.com/wp-content/themes/gigyatm/images/gigya-logo.gif'
};
gigya.socialize.postBookmark(params);

Notes:
  • This sample is not meant to be fully functional code. For brevity's sake, only the code required for demonstrating the API call itself is presented.
  • To run the code on your own domain, add your Gigya API key to the socialize.js URL. A Gigya API key can be obtained on the Site Dashboard page on Gigya's website. Please make sure that the domain from which you are loading the page is the same domain name that you used for generating the API key.
  • In some cases it is necessary to connect/login the user to a provider? prior to calling the API method. You can learn more in the Social Login guide.

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

Tags

This page has no custom tags set.

Comments

You must to post a comment.

Attachments