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 23 Next »

/social/share/{id}

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

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/get/53ff2cd5e230ed94d3a15975

Method.GET - search

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

Method.POST

Example using curl:

curl \-XPOST 'http://infinite.ikanow.com/api/social/share' \-d '{    "title":"t7",    "description":"nothin",    "type":"test1",    "communities":[{"_id":"53e638f8e4b0e2d48e35c92a"}],    "documentLocation":{"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

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

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