Organization
Last updated
Last updated
Represents the Organization itself
All Organization properties requiring Public access are exposed through GET to the public.
{
"_id": "5516ee1b34d8d934281699e3",
"access": 1,
"code": "example",
"favicon": {
"ETag": "31074002db56d2d6fc8fee5b05caee1c",
"creator": "5516ee2634d8d93428169c0e",
"location": 4,
"mime": "image/x-icon",
"name": "content",
"path": "/orgs/5516ee1b34d8d934281699e3/favicon/content",
"size": 15086,
"state": 2
},
"locale": "en_US",
"logo": {
"ETag": "594b69d035ac27c2e69ef053082eb6a3",
"creator": "5516ee2634d8d93428169c0e",
"facets": [
{
"ETag": "5046104d05edf82e2a2c0d72118ca15b",
"creator": "5516ee2634d8d93428169c0e",
"height": 241,
"location": 4,
"mime": "image/jpeg",
"name": "thumbnail",
"path": "/orgs/5516ee1b34d8d934281699e3/logo/thumbnail",
"size": 16495,
"state": 2,
"width": 300
}
],
"height": 500,
"location": 4,
"mime": "image/jpeg",
"name": "content",
"path": "/orgs/5516ee1b34d8d934281699e3/logo/content",
"size": 52586,
"state": 2,
"width": 622
},
"name": "Example",
"object": "org",
"schemasETag": "b7fa703927702d09ada85150f475d88c"
}
GET
https://api.dev.medable.com/{your_org_name}/v2
{
"_id": "5516ee1b34d8d934281699e3",
"access": 1,
"code": "example",
"favicon": {
"ETag": "31074002db56d2d6fc8fee5b05caee1c",
"creator": "5516ee2634d8d93428169c0e",
"location": 4,
"mime": "image/x-icon",
"name": "content",
"path": "/orgs/5516ee1b34d8d934281699e3/favicon/content",
"size": 15086,
"state": 2
},
"locale": "en_US",
"logo": {
"ETag": "594b69d035ac27c2e69ef053082eb6a3",
"creator": "5516ee2634d8d93428169c0e",
"facets": [
{
"ETag": "5046104d05edf82e2a2c0d72118ca15b",
"creator": "5516ee2634d8d93428169c0e",
"height": 241,
"location": 4,
"mime": "image/jpeg",
"name": "thumbnail",
"path": "/orgs/5516ee1b34d8d934281699e3/logo/thumbnail",
"size": 16495,
"state": 2,
"width": 300
}
],
"height": 500,
"location": 4,
"mime": "image/jpeg",
"name": "content",
"path": "/orgs/5516ee1b34d8d934281699e3/logo/content",
"size": 52586,
"state": 2,
"width": 622
},
"name": "Example",
"object": "org",
"schemasETag": "b7fa703927702d09ada85150f475d88c"
}
{}
$.ajax({
url: "https://api.dev.medable.com/example/v2/",
method: "GET",
dataType : "json",
xhrFields: {
withCredentials: true
},
headers: {
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
}
}).done(function(data) {
// ...
});
[[MDAPIClient sharedClient] getOrgInfoWithCallback:^(MDOrg *org, MDFault *fault)
{
// Handle fault or process results
}];
APIClient.sharedInstance().getPublicOrgInfo(new ObjectFaultCallback<JsonObject>()
{
@Override
public void call(JsonObject object, Fault fault)
{
// Public org's info in Json format
}
});
--
GET
https://api.dev.medable.com/{your_org_name}/v2/orgs/org_id
{
"_id": "5516ee1b34d8d934281699e3",
"access": 1,
"code": "example",
"favicon": {
"ETag": "31074002db56d2d6fc8fee5b05caee1c",
"creator": "5516ee2634d8d93428169c0e",
"location": 4,
"mime": "image/x-icon",
"name": "content",
"path": "/orgs/5516ee1b34d8d934281699e3/favicon/content",
"size": 15086,
"state": 2
},
"locale": "en_US",
"logo": {
"ETag": "594b69d035ac27c2e69ef053082eb6a3",
"creator": "5516ee2634d8d93428169c0e",
"facets": [
{
"ETag": "5046104d05edf82e2a2c0d72118ca15b",
"creator": "5516ee2634d8d93428169c0e",
"height": 241,
"location": 4,
"mime": "image/jpeg",
"name": "thumbnail",
"path": "/orgs/5516ee1b34d8d934281699e3/logo/thumbnail",
"size": 16495,
"state": 2,
"width": 300
}
],
"height": 500,
"location": 4,
"mime": "image/jpeg",
"name": "content",
"path": "/orgs/5516ee1b34d8d934281699e3/logo/content",
"size": 52586,
"state": 2,
"width": 622
},
"name": "Example",
"object": "org",
"schemasETag": "b7fa703927702d09ada85150f475d88c"
}
{}
$.ajax({
url: "https://api.dev.medable.com/example/v2/orgs/5516ee1b34d8d934281699e3",
method: "GET",
dataType : "json",
xhrFields: {
withCredentials: true
},
headers: {
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
}
}).done(function(data) {
// ...
});
[[MDAPIClient sharedClient]
orgWithId:self.Id
parameters:parameters
callback:^(MDOrg* updatedOrg, MDFault *fault)
{
if ( [updatedOrg isKindOfClass:[wSelf class]] && fault == nil )
{
[wSelf updateWithInstance:updatedOrg];
}
if ( callback )
{
callback(updatedOrg, fault);
}
}];
Org org = APIClient.sharedInstance().getCurrentOrg();
// or:
APIClient.sharedInstance().getOrg(
new ObjectId("orgId here"),
null,
new ObjectFaultCallback<Org>()
{
@Override
public void call(Org org, Fault fault)
{
// Handle fault or process results
}
}
);
PUT
https://api.dev.medable.com/{your_org_name}/v2
The Organization settings can only be updated by an Administrator. Because the Org is public, it is possible to add a custom property to allow those with other roles (or no roles) to update it. To demonstrate, the following property has been added to the Organization in the example request to the right, and all Providers given access to push elements onto the c_4providers array.
{
"hasMore": false,
"object": "list",
"data": [-4, -3, -2, -1, 0, 11, 22, 33, 44, 55]
}
{}
$.ajax({
url: "https://api.dev.medable.com/example/v2/orgs/5516ee1b34d8d934281699e3/c_4providers",
method: "PUT",
dataType : "json",
xhrFields: {
withCredentials: true
},
headers: {
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
},
data: [
-5,
-4,
-3,
-2,
-1,
0,
11,
22,
33,
44,
55
]
}).done(function(data) {
// ...
});
NSDictionary *body = @{ @"c_providers": @{ @"data": @[ @(-5), @(-4), @(-3), @(-2), @(-1), @(0), @(11), @(22), @(33), @(44), @(55) ] } };
[[MDAPIClient sharedClient]
updateOrgWithId:[MDObjectId objectIdWithString:@"5516ee1b34d8d934281699e3"]
body:body
callback:^(MDOrg * _Nullable editedObject, MDFault * _Nullable fault)
{
}];
Body body = new Body();
JsonObject jsonContent = APIClient.sharedInstance().getGsonParser()
.parse("{ \"c_providers\": { \"data\": [ -5, -4, -3, -2, -1, 0, 11, 22, 33, 44, 55 ] } }")
.getAsJsonObject();
FastBodyProperty fastProp = new FastBodyProperty(jsonContent);
body.addProperty(fastProp);
APIClient.sharedInstance().updateOrg(
new ObjectId("5516ee1b34d8d934281699e3"),
body,
new ObjectFaultCallback<Org>()
{
@Override
public void call(Org editedOrg, Fault fault)
{
}
}
);
PATCH
https://api.dev.medable.com/{your_org_name}/v2
{
"hasMore": false,
"object": "list",
"data": [-4, -3, -2, -1, 0, 11, 22, 33, 44, 55]
}
{}
$.ajax({
url: "https://api.dev.medable.com/example/v2/orgs/586eb9ef64129a5f3631a0ca",
method: "PATCH",
dataType : "json",
xhrFields: {
withCredentials: true
},
headers: {
"Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
},
data: {
"op": "push",
"path": "/configuration/email/locationBypass",
"value": "john@medable.com"
}
}).done(function(data) {
// ...
});
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|