Search…
Object Definition

Introduction

You can extend the API by creating new custom objects and extending the standard objects with custom properties, You can do this via the API if you have the Administrator or Developer roles, or via the admin UI. For details on how to create and extend objects using the admin UI, see Data Model Setup.
At every level, custom objects and properties are prefixed with c_ to differentiate them from standard properties that may be placed alongside in a document. For example, retrieving a custom property from a custom object might look like GET /c_records/551ebec0f6b25fd828742de1/c_info
Although a standard object's standard properties cannot be modified, custom properties can be added to extensible standard object classes.
Also some of the standard object’s properties can either be overridden or extended, including the createAcl, defaultAcl and shareAcl.

Object Definition

_id ObjectId
The object definition identifier.
label String
The object label.
name String
The object name.
pluralName String
Based on the name, this is the name used in API routes. For example, to retrieve a list of c_thing objects, use GET /c_things
description String
The object description.
defaultAcl Document
All contexts objects of this type will have this ACL merged with their instance ACL.
createAcl Document
These ACL targets are able to create context objects of this type.
shareAcl Document
These ACL targets are able to share context objects of this type. The entries defined which access levels and roles can be assigned by which targets.
shareChain Number
A caller can create a connection granting any level of access in the share chain, as long as it is less than his own.
allowTransfers Boolean
Allow ownership transfer for this context's objects.
allowConnections Boolean
Set to enable/disable sharing of contexts for this object.
connectionOptions Document
Options around connection requests, such as whether to auto-accept and send-notification.
properties Document Array
All of the properties defined in this object class.
object String
The context’s object name.
objectTypes Array
The object's types. For more info, see Object Types.
hasETag Boolean
If true, an ETag property is made available and is (re)generated on an instance whenever it is updated.
1
{
2
"_id": "576870f71d0c03a53cd665cd",
3
"access": 7,
4
"allowConnections": true,
5
"allowTransfers": true,
6
"connectionOptions": {
7
"requireAccept": true,
8
"requiredAccess": 5,
9
"sendNotifications": true
10
},
11
"createAcl": [
12
{
13
"_id": "576870f71d0c03a53cd665ce",
14
"allow": 1,
15
"target": "000000000000000000000003",
16
"type": 1
17
}
18
],
19
"created": "2016-06-20T22:40:55.523Z",
20
"creator": {
21
"_id": "575f58281d0c03a53ccc3ac6",
22
"object": "account",
23
"path": "/accounts/575f58281d0c03a53ccc3ac6"
24
},
25
"defaultAcl": [
26
{
27
"_id": "57b1ebac14e8971b6add7c66",
28
"allow": 7,
29
"type": 4
30
},
31
{
32
"_id": "57b1ebac14e8971b6add7c67",
33
"allow": 4,
34
"target": "578483dc46b010416571393d",
35
"type": 3
36
}
37
],
38
"label": "Prescription",
39
"lookup": "576870f71d0c03a53cd665cd",
40
"name": "c_prescription",
41
"object": "object",
42
"objectTypes": [],
43
"pluralName": "c_prescriptions",
44
"properties": [
45
{
46
"_id": "576d71d01d0c03a53cde6e88",
47
"acl": [],
48
"auditable": false,
49
"autoCreate": false,
50
"cascadeDelete": false,
51
"creatable": false,
52
"expandable": true,
53
"grant": 2,
54
"indexed": true,
55
"label": "Patient",
56
"name": "c_patient",
57
"optional": false,
58
"pacl": [],
59
"paths": [],
60
"readAccess": 4,
61
"readable": true,
62
"referenceAccess": 0,
63
"removable": false,
64
"sourceObject": "account",
65
"type": "Reference",
66
"unique": false,
67
"validators": [],
68
"writable": true,
69
"writeAccess": 6
70
},
71
{
72
"_id": "576d72a41d0c03a53cde7144",
73
"acl": [],
74
"array": false,
75
"auditable": false,
76
"canPull": true,
77
"canPush": true,
78
"creatable": false,
79
"indexed": true,
80
"label": "Rx",
81
"lowercase": false,
82
"maxItems": 100,
83
"maxShift": false,
84
"minItems": 0,
85
"name": "c_rx",
86
"optional": false,
87
"readAccess": 4,
88
"readable": true,
89
"removable": false,
90
"trim": false,
91
"type": "String",
92
"unique": false,
93
"uniqueValues": false,
94
"uppercase": false,
95
"validators": [
96
{
97
"_id": "57914b65356ff1a73d2db0cf",
98
"definition": {
99
"max": 10000000000,
100
"min": 0
101
},
102
"name": "printableString"
103
},
104
{
105
"_id": "57914b65356ff1a73d2db0d0",
106
"name": "required"
107
}
108
],
109
"writable": true,
110
"writeAccess": 6,
111
"writeOnCreate": true
112
}
113
],
114
"shareChain": [
115
5,
116
4,
117
2
118
],
119
"updated": "2017-05-26T04:08:39.488Z",
120
"updater": {
121
"_id": "5771495a1d0c03a53ce83f1a",
122
"object": "account",
123
"path": "/accounts/5771495a1d0c03a53ce83f1a"
124
}
125
}
Copied!
get
https://api.dev.medable.com/
your_org_name/v2/objects
List
1
$.ajax({
2
url: "https://api.dev.medable.com/example/v2/objects",
3
method: "GET",
4
dataType : "json",
5
xhrFields: {
6
withCredentials: true
7
},
8
headers: {
9
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
10
}
11
}
12
}).done(function(data) {
13
// ...
14
});
Copied!
get
https://api.dev.medable.com
/your_org_name/v2/objects/object_id
Read
1
$.ajax({
2
url: "https://api.dev.medable.com/example/v2/objects/594da5c0cfc40501006d2d33",
3
method: "GET",
4
dataType : "json",
5
xhrFields: {
6
withCredentials: true
7
},
8
headers: {
9
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
10
}
11
}
12
}).done(function(data) {
13
// ...
14
});
Copied!
post
https://api.dev.medable.com
/your_org_name/v2/objects
Create
1
$.ajax({
2
url: "https://api.dev.medable.com/example/v2/objects",
3
method: "POST",
4
dataType : "json",
5
xhrFields: {
6
withCredentials: true
7
},
8
headers: {
9
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
10
},
11
data: {
12
"label": "pulse",
13
"name" : "pulse",
14
"defaultAcl": [
15
{
16
"target": "000000000000000000000003",
17
"type": 1
18
}
19
],
20
"createAcl": [
21
{
22
"target": "000000000000000000000003",
23
"type": 1
24
}
25
]
26
}
27
}).done(function(data) {
28
// ...
29
});
Copied!
put
https://api.dev.medable.com
/your_org_name/v2/objects/object_id
Update
1
$.ajax({
2
url: "https://api.dev.medable.com/example/v2/objects/594da5c0cfc40501006d2d33",
3
method: "PUT",
4
dataType : "json",
5
xhrFields: {
6
withCredentials: true
7
},
8
headers: {
9
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
10
},
11
data: {
12
"allowConnections": "false"
13
}
14
}).done(function(data) {
15
// ...
16
});
Copied!
delete
https://api.dev.medable.com/
your_org_name/v2/objects/object_class_id
Delete
1
$.ajax({
2
url: "https://api.dev.medable.com/example/v2/objects/594da5c0cfc40501006d2d33",
3
method: "DELETE",
4
dataType : "json",
5
xhrFields: {
6
withCredentials: true
7
},
8
headers: {
9
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
10
}
11
}).done(function(data) {
12
// ...
13
});
Copied!

Last modified 1mo ago