HTTP Share Create


Required Fields


paths

A JSON Object of Paths to Permissions. This represents the Paths (and hence, Flows) within a namespace that can be accessed by the Share.

The values of this map are "Permissions", which is a JSON Object:

read (boolean)
Objects at or below this path can be read
write (boolean)
Objects at or below this path can be created, updated, deleted
dropRead (boolean)
Drops can be read from Flows with this path and all child Flows
dropWrite (boolean)
Drops can be written to Flows with this path and all child Flows
issuedTo

The Identity or group that will be the recipient of this Share

To issue to a Identity, supply the Identity ID ("i....."). To issue to a Group, supply the Group ID ("g.....")

Optional Fields


duration
The length of time the share will be active (in milliseconds), after which it will expire. If unspecified, the Share will never expire

POST https://api.flowthings.io/v0.1/<account_id>/share/

Creates a new Share object

Request


Headers

NameDescription
Content-Typeapplication/json
X-Auth-TokenAuthentication Token

Example

 {
      "issuedTo": "i548b1c1bd4c607c7716e4ac2",
      "paths": {
            "/alice/homesecurity": {
                "read": true,
                "write": true,
                "dropRead": true,
                "dropWrite": true
            },
            "/alice/ideas": {
                "read": true,
                "write": false,
                "dropRead": true,
                "dropWrite": false
            }
       },
       "duration": 60000

  }

Response


HTTP Codes

CodeDescription
201Resource Created
400Bad Request
401Unauthorized
503Service Unavailable

Example Response Body

{
  "head": {
    "status": 201,
    "ok": true,
    "messages": [
      "Your request has been processed successfully. A new resource has been created."
    ],
    "errors": []
  },
  "body": {
    "id": "s548b20f1d4c63c0634ad3bc9",
    "creationDate": 1409455732680,
    "issuedTo": "i548b1c1bd4c607c7716e4ac2",
    "paths": {
      "/alice/homesecurity": {
        "read": true,
        "write": true,
        "dropRead": true,
        "dropWrite": true
      },
      "/alice/ideas": {
        "read": true,
        "write": false,
        "dropRead": true,
        "dropWrite": false
      }
     },
     "duration": 60000,
     "expiresInMs": 59326
  }
}