Share

/share/{channel_id}/{share_response}

Multi purpose function for sharing channels with other users:

GET w/ no arguments will return a list of all pending channels shared with you (utility function)

GET w/ channel_id and share_response will respond to a pending channel and either add it or remove it according to share_response (typically used when clicking on links in email)

POST w/ the JSON object below will share your channel with the given user (typically used in GUI when sharing channels)


Note: any shared channels that aren't responded to in 31 days will be removed.

Possible Methods

GET POST

Arguments

channel_id: (optional)
Channel_id of shared channel you are responding to

share_response: (optional)
true or false for if you want to accept or deny the given shared channel

Json Object
{
    String channel_id; //id of channel you want to share
    String user_email; //email (or id) of user you want to share with
}

 

Example
curl -b cookies.txt -X GET "http://localhost:8185/share" > response.txt
curl -b cookies.txt -X GET "http://localhost:8185/share/12345/true" > response.txt
curl -b cookies.txt -X POST -d '{"channel_id":"12345", "user_email":"sterling_archer@isis.com"' "http://localhost:8185/share" > response.txt

 

Example Response
curl -b cookies.txt -X GET "http://localhost:8185/share" > response.txt

 

{
    "response": {
        "action": "Share",
        "success": true,
        "message": "Returned all pending channels, response to them with /share/{channel_id}/true|false",
        "time": 0
    },
    "data": [
        {
            "channel_id": "5366765cb8e06a28b089254d",
            "name": "sharetest3",
            "locations": [],
            "events": [
                {
                    "event_id": "5339b24ae4b0486192fa825c",
                    "liked": false,
                    "timestamp": "May 4, 2014 05:06:25 PM UTC"
                }
            ],
            "created_date": "May 4, 2014 05:06:03 PM UTC",
            "index": 4
        }
    ]
}