Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

/social/share/add/json/{type}/{title}/{description} (POST)

Add a shared object (JSON document) to the share collection. Note: Can be called via post or get.

Shares are just entries in our database where you can save any information you want.  Currently our application uses the shares to store things like query history (JSON), map reduce jars(BINARY), widget swfs (BINARY), among other things.  To create a share you can either call this call to add a JSON string entry or share/add/binary to insert a byte stream (such as a file).  Once you have added a share only you have access to it (via your personal community).  If you want others to have access to the share you can add their communities via share/add/community.

A simple web-based utility is available for performing many share management activities.

Authentication

Required, see Auth - Login

Arguments

type (required)
Type of share: dataset, query, etc.

title (required)
Arbitrary display title for the share

description (required)
Arbitrary display description for the share

json (required)
JSON object

Example

Method.Get
http://infinite.ikanow.com/api/social/share/add/json/type/title/description?json=%7B%22userid%22%3A%224f5e189ada7f00000000510f%22%2C%22settings%22%3A%7B%22maximized%22%3Afalse%2C%22lastTabOpen%22%3A2%7D%7D

Method.Post

Example using curl:

curl \-XPOST 'http://infinite.ikanow.com/api/social/share/add/json/type/title/description' \-d '{"userid":"4f5e189ada7f00000000510f","settings":{"maximized":false,"lastTabOpen":2}}'

A detailed example of adding a jar file to the share db and then accessing it to schedule a map reduce job in JAVA can be found here: Java Share Example

Example Response
{
	response: {
		action: "New Share"
		success: true
		message: "New share added successfully."
		time: 10
	}
     data: {
        _id: "4e175bfeb8ed6403f48ea7e2"
        created: "Jul 8, 2011 11:35:26 AM"
        modified: "Jul 10, 2011 9:27:36 AM"
        owner: 
        {
            _id: "4d88d0f1f9a624a4b0c8bd71"
            email: "jdoe@ikanow.com"
            displayName: "John Doe"
        }
        type: "test"
        title: "Test Share"
        description: "Just a test of share functionality"
        share: "random stuff that gets put in share"
        communities: [
            {
                _id: "4d88d0f1f9a624a4b0c8bd71"
                name: "John Doe's Personal Community"
            }
        ]
    }
 }
  • No labels