Was this article helpful?

socialize.postBookmark

Modified 15:13, 17 Mar 2013 by Tanya

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, MySpace, Messenger, Google, LinkedIn, Digg, Del.icio.us, Google Bookmarks, My AOL, Hyves, 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.

Note: 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

 

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', 'myspace', 'messenger', 'google', 'linkedin', 'digg', 'delicious', 'googlebookmarks', 'myaol', 'hyves', '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 title string The title to assign to the bookmark. Note: some of the bookmark destinations do not support assigning a title to the bookmark.
  description string The description of the bookmark. Note: some of the bookmark destinations do not support assigning a description 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.
  cid string A string of maximum 100 characters length. This string is associated with each transaction and will later appear on 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. The "Context ID" combo box lets you filter the report data by site/application context.
  providerKey string The provider-specific API Key. This parameter is used when calling this method for providers that require an API key.
  thumbnailURL string The URL of the thumbnail image. Note: this parameter is required for Pinterest in order to work.
  tags string A comma separated list of tags that are used to identify the share operation.
  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. 

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.

This parameter receives a JSON object, comprised of a set or sets of a key (category) and a value or values, i.e.:
    {
        "<attribute1 name>": ["<attribute1 value1>", "<attribute1 value2>", ...],
        "<attribute2 name>": "<attribute2 value>",
        ...
    }
For example:
    {

        "tv-show": ["glee", "30rock"],
        "music": "pop"
    }
In this example the action receives three attributes: {"tv-show":"glee"}, {"tv-show":"30rock"}, and {"music":"pop"}. This parameter may receive a list of up to three sets of key and value entries per call. If more values are entered, only the first three will count and the rest will be ignored. The three sets of key and value can be one key with three values, or three keys with one value each, or two keys, one with two values and the other with one value. 
You can also choose to input attributes using a generic "Tags" key, with no category name, for example: {"tags": ["glee", "house", "pop"]}. In this case the action receives these three attributes: {"tags":"glee"}, {"tags":"house"}, and {"tags":"pop"}.

 

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
1291 view(s) and 2 edit(s)
Social share
Share this page?

Tags

This page has no custom tags set.

Comments

You must to post a comment.

Attachments