Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
/social/share/{id}
Info

An all inclusive share API call to handle all the other API calls in one.

GET - With an ID returns a single share share/get
GET - Without an ID does a share/search
POST - Create a share - does a share/add json ref Social - Share - Add - Referencebinary and then handles comms via share/add/comm share/remove/comm
PUT - Update a share - does a share/update json

...

Info

Add a shared object (JSON document) to the share collection. Note: Can be called via post or get.ref Social - Share - Update - Referencebinary and then handles comms via share/add/comm share/remove/comm
DELETE - Remove a share - does a share/remove

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, unless POST in which case the share JSON should be the body)
JSON object

Example

...

id (optional)
Id of share to try and get/delete (only useful for those 2 calls)

Parameters

id (optional)
Id param of search

skip (optional)
Skip param of search

limit (optional)
limit param of search

searchby (optional)
searchby param of search

type (optional)
type param of search or type param for POST/PUT (usually reserved for submitting binary requests this way so the payload can be just the data)

title (optional)
title param for POST/PUT (usually reserved for submitting binary requests this way so the payload can be just the data)

description(optional)
description param for POST/PUT (usually reserved for submitting binary requests this way so the payload can be just the data)

communityIds(optional)
communities param for POST/PUT (usually reserved for submitting binary requests this way so the payload can be just the data), takes a comma separated list of commIds e.g. 12345, 23456 to set the comms for that source

ignoreAdmin(optional)
ignoreAdmin param of search

nocontent (optional)
nocontent param of get/search

nometa (optional)
nometa param of get

searchParent (optional)
searchParent param of search

readWrite (optional)
readWrite param of search

Body

In the body/payload of a request you can send a share object, will pull out the necessary fields, e.g. can be used when sending a new JSON share on a POST request e.g. {"title":"new share","type":"test type", "description":"desc","share":"{\"data\":\"some data here\"}"}

Example

Method.GET - 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%7DMethod.Post/get/53ff2cd5e230ed94d3a15975

Method.GET - search

http://infinite.ikanow.com/api/social/share?type=test1

Method.POST

Example using curl:

Code Block
curl \-XPOST 'http://infinite.ikanow.com/api/social/share/add/json/type/title/description' \-d '{"userid    "title":"t7",    "description":"nothin",    "type":"4f5e189ada7f00000000510ftest1","settings    "communities":[{"_id":"53e638f8e4b0e2d48e35c92a"}],    "documentLocation":{"maximized":false,"lastTabOpen":2"database":"doc_metadata","collection":"metadata","_id":"53d96f67e4b0ac9d0bec66be"}}'

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

Method.PUT

Code Block
curl \-XPUT 'http://infinite.ikanow.com/api/social/share' \-d '{    "_id": "53fcd218e2303160fd6b6d24",    "title":"t8",    "description":"nothin",    "type":"test1",    "communities":[{"_id":"53e638f8e4b0e2d48e35c92a"}],    "documentLocation":{"database":"doc_metadata","collection":"metadata","_id":"53d96f67e4b0ac9d0bec66be"}}'

Method.DELETE

Code Block
curl \-XDELETE 'http://infinite.ikanow.com/api/social/share/53fcd218e2303160fd6b6d24'
Example Response
Info
Code Block
{
	response: {
		action: "New Share"
		success: true
		message: "New share added successfully."
		time: 10
	},
    data: "4e175bfeb8ed6403f48ea7e2"
 }