Connections Object

Connection enable access to objects. Once connected, each Object has a number of feeds that can be read and posted to, depending on configured access. Each object property has a minimum required CRUD access level. These are listed in the property table for each object.

Those with Share access to an object can invite others to connect. The level of access you can grant to those you invite depends on the type of object and the level of access you have. We call this the Share Chain.

To disconnect from an object, simply call the Delete route. To remove others from a context, the caller must have Share access to the context for which the connection was created and have more access than the user you are removing. These basic rules apply across all objects.

For more details on using connections, see Using Connections

_id
String
The connection identifier
access
Number
The access level granted by the connection. In the case of an ownership transfer, the access level is the object’s default owner access. An objects share chain or share ACL defines what access levels can be granted and by whom.
roles
ObjectId Array
The instance roles granted by the connection. An objects share ACL defines what roles can be granted and by whom.
context
Reference
The connection context. When expanded, imparts the connection’s access level to the caller.
contextSource
String
A dot syntax property path context in the invitation context. For example, when the account property of the Patient File is set, the resulting Connection “contextSource” is set to “account”. This enables clients to discern the nature of the Connection. In the case of Patient File, “account” means the target is being asked to act as the patient.
created
Date
The date the connection was initiated.
creator
Reference
The account id of the connection creator. Expansion paths are fixed at name an image; The caller can only retrieve the connection creator’s name and profile image.
expiresAt
Date
For pending connections. the time at which the connection request will expire.
object
String
The context’s object name.
state
Number
The connection state (Pending: 0, Active: 1).
target
Document
The connection target recipient. The email property will only be present if the connection was created using an email address. Conversely, the account property will only be present if the connection was created using an account id. The name property will only be present if the connection creator added one.
account
Reference
Optional account identifier. A connection can be created using the account identifier is it is known.
token
String
The connection token, only visible to the target.
usesRemaining
Number
Defaults to null. The number of times the connection can be loaded before it expires.
"_id": "5524165d65a7158820f4c022",
"access": 4,
"context": {
  "_id": "5519c01aae2fd2b02915c81f",
  "object": "c_example",
  "path": "/c_examples/5519c01aae2fd2b02915c81f"
},
"created": "2015-04-07T17:39:41.000Z",
"creator": {
  "_id": "5516ee2634d8d93428169c0e",
  "object": "account",
  "path": "/accounts/5516ee2634d8d93428169c0e"
},
"expiresAt": "2015-04-14T17:39:41.246Z",
"object": "connection",
"state": 0,
"target": {
  "email": "[email protected]",
  "name": {
    "first": "Frederick",
    "last": "Banting"
  }
}