Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Organization Location API

jay-lee00 edited this page Aug 7, 2019 · 10 revisions

Get organizations by current user's hospital.


GET v2/organizations

Request
Headers
X-Developer-Id developer id
X-Api-Key api key
Authorization Bearer {{access_token}}
 
 
URI Parameters
includeLocations boolean

Default value is True

includeDeleted boolean

Default value is False

idsToLoadLocations string

Space separated organization ids. Default value is empty string


sample request
GET /api/v2/organizations HTTP/1.1
Host: api.sandbox.connectedcare.md
X-Developer-Id:  {{apiDeveloperId}}
X-Api-Key:  {{apiKey}}
Authorization:  Bearer {{accessToken}}
cache-control: no-cache
Postman-Token: 5738c8d8-7872-4ecb-b256-d584c8f711ed

sample response:
{
    "data": [
        {
            "addresses": [],
            "hospitalId": 126,
            "locations": [
                {
                    "name": "O1L2",
                    "organizationId": 72,
                    "id": 83,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T21:13:36.54Z",
                    "modifiedDate": "2019-01-02T23:57:06.8266667Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                },
                {
                    "name": "O1L3",
                    "organizationId": 72,
                    "id": 84,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T23:57:06.8266667Z",
                    "modifiedDate": "2019-01-02T23:57:06.8266667Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                },
                {
                    "name": "O1Loc1",
                    "organizationId": 72,
                    "id": 82,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T21:13:36.54Z",
                    "modifiedDate": "2019-01-02T23:57:06.8266667Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                }
            ],
            "name": "Org1-1",
            "organizationTypeId": 2,
            "id": 72,
            "statusCode": 1,
            "createdDate": "0001-01-01T00:00:00Z",
            "createdByUserId": 0
        },
        {
            "addresses": [],
            "hospitalId": 126,
            "locations": [
                {
                    "name": "O2L1",
                    "organizationId": 73,
                    "id": 85,
                    "statusCode": 1,
                    "createdDate": "2019-01-03T00:07:20.2033333Z",
                    "modifiedDate": "2019-01-03T00:07:20.2033333Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                },
                {
                    "name": "O2L2",
                    "organizationId": 73,
                    "id": 86,
                    "statusCode": 1,
                    "createdDate": "2019-01-03T00:07:20.2033333Z",
                    "modifiedDate": "2019-01-03T00:07:20.2033333Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                }
            ],
            "name": "Org2",
            "organizationTypeId": 2,
            "id": 73,
            "statusCode": 1,
            "createdDate": "0001-01-01T00:00:00Z",
            "createdByUserId": 0
        }
    ],
    "total": 2
}

Create a new organization along with its locations.


POST v2/client/organizations

Request
Headers
X-Developer-Id developer id
X-Api-Key api key
Authorization Bearer {{access_token}}
 
 
Body Parameters
HospitalId integer
Name string
OrganizationTypeId 2
StatusCode StatusCode
Locations Collection of Location

sample request
POST /api/v2/client/organizations HTTP/1.1
Host: api.sandbox.connectedcare.md
X-Developer-Id:  {{apiDeveloperId}}
X-Api-Key:  {{apiKey}}
Authorization:  Bearer {{accessToken}}
cache-control: no-cache
Content-Type: application/json; charset=UTF-8
Postman-Token: c0acb400-6f5b-4685-b10e-1fa94f1fbbbd
{
    "hospitalId": 126,
    "locations": [
        {
            "name": "Loc1",
            "statusCode": 1
        },
        {
            "name": "O2L2",
            "statusCode": 1
        }
    ],
    "name": "Org1",
    "organizationTypeId": 2,
    "statusCode": 1
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--

sample response:
{
    "data": [
        {
            "addresses": [],
            "hospitalId": 126,
            "locations": [
                {
                    "name": "Loc1",
                    "organizationId": 72,
                    "id": 82,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T21:13:36.5383856Z",
                    "modifiedDate": "2019-01-02T21:13:36.5383856Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                },
                {
                    "name": "O2L2",
                    "organizationId": 72,
                    "id": 83,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T21:13:36.5383856Z",
                    "modifiedDate": "2019-01-02T21:13:36.5383856Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                }
            ],
            "name": "Org1",
            "organizationTypeId": 2,
            "id": 72,
            "statusCode": 1,
            "createdDate": "2019-01-02T21:13:36.5383856Z",
            "modifiedDate": "2019-01-02T21:13:36.5383856Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        }
    ],
    "total": 1
}

Update a organization and its locations (optional if syncLocations == true).


PUT v2/client/organizations

Request
Headers
X-Developer-Id developer id
X-Api-Key api key
Authorization Bearer {{access_token}}
 
 
URI Parameters
syncLocations boolean

Default value is False


Body Parameters
Id integer
Name string
OrganizationTypeId 2
StatusCode StatusCode
Locations Collection of Location

sample request
PUT /api/v2/client/organizations?syncLocations=true HTTP/1.1
Host: api.sandbox.connectedcare.md
X-Developer-Id:  {{apiDeveloperId}}
X-Api-Key:  {{apiKey}}
Authorization:  Bearer {{accessToken}}
cache-control: no-cache
Content-Type: application/json; charset=UTF-8
Postman-Token: c0acb400-6f5b-4685-b10e-1fa94f1fbbbd
{
    "id": 72,
    "name": "Org1-1",
    "organizationTypeId": 2,
    "statusCode": 1,
    "locations": [
        {
            "id": 82,
            "name": "O1Loc1",
            "statusCode": 1
        },
        {
            "id": 83,
            "name": "O1L2",
            "statusCode": 1
        },
        {
            "name": "O1L3",
            "statusCode": 1
        }
    ]
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--

sample response:
{
    "data": [
        {
            "addresses": [],
            "hospitalId": 126,
            "locations": [
                {
                    "name": "O1Loc1",
                    "organizationId": 72,
                    "id": 82,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T21:13:36.54Z",
                    "modifiedDate": "2019-01-02T23:57:06.8276704Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                },
                {
                    "name": "O1L2",
                    "organizationId": 72,
                    "id": 83,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T21:13:36.54Z",
                    "modifiedDate": "2019-01-02T23:57:06.8276704Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                },
                {
                    "name": "O1L3",
                    "organizationId": 72,
                    "id": 84,
                    "statusCode": 1,
                    "createdDate": "2019-01-02T23:57:06.8276704Z",
                    "modifiedDate": "2019-01-02T23:57:06.8276704Z",
                    "createdByUserId": 31630,
                    "modifiedByUserId": 31630
                }
            ],
            "name": "Org1-1",
            "organizationTypeId": 2,
            "id": 72,
            "statusCode": 1,
            "createdDate": "2019-01-02T21:13:36.54Z",
            "modifiedDate": "2019-01-02T23:57:06.8276704Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        }
    ],
    "total": 1
}

Get locations for logged in user's hospital.


GET v2/locations

Request
Headers
X-Developer-Id developer id
X-Api-Key api key
Authorization Bearer {{access_token}}


sample request
GET /api/v2/locations HTTP/1.1
Host: api.sandbox.connectedcare.md
X-Developer-Id:  {{apiDeveloperId}}
X-Api-Key:  {{apiKey}}
Authorization:  Bearer {{accessToken}}
cache-control: no-cache
Postman-Token: 5738c8d8-7872-4ecb-b256-d584c8f711ed

sample response:
{
    "data": [
        {
            "name": "O1L3+1",
            "organizationId": 72,
            "id": 84,
            "statusCode": 1,
            "createdDate": "2019-01-02T23:57:06.827Z",
            "modifiedDate": "2019-01-03T00:24:48.227Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        },
        {
            "name": "O1Loc1-1",
            "organizationId": 72,
            "id": 82,
            "statusCode": 1,
            "createdDate": "2019-01-02T21:13:36.54Z",
            "modifiedDate": "2019-01-03T00:24:48.227Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        },
        {
            "name": "O2L1",
            "organizationId": 73,
            "id": 85,
            "statusCode": 1,
            "createdDate": "2019-01-03T00:07:20.203Z",
            "modifiedDate": "2019-01-03T00:07:20.203Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        },
        {
            "name": "O2L2",
            "organizationId": 73,
            "id": 86,
            "statusCode": 1,
            "createdDate": "2019-01-03T00:07:20.203Z",
            "modifiedDate": "2019-01-03T00:07:20.203Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        }
    ],
    "total": 4
}

Create a new location.


POST v2/client/locations

Request
Headers
X-Developer-Id developer id
X-Api-Key api key
Authorization Bearer {{access_token}}
 
 
Body Parameters
OrganizationId integer
Name string
StatusCode StatusCode

sample request
POST /api/v2/client/locations HTTP/1.1
Host: api.sandbox.connectedcare.md
X-Developer-Id:  {{apiDeveloperId}}
X-Api-Key:  {{apiKey}}
Authorization:  Bearer {{accessToken}}
cache-control: no-cache
Content-Type: application/json; charset=UTF-8
Postman-Token: c0acb400-6f5b-4685-b10e-1fa94f1fbbbd
{
    "organizationId": 73,
    "name": "O2Loc3",
    "statusCode": 1
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--

sample response:
{
    "data": [
        {
            "name": "O2Loc3",
            "organizationId": 73,
            "id": 87,
            "statusCode": 1,
            "createdDate": "2019-01-03T19:00:54.4878473Z",
            "modifiedDate": "2019-01-03T19:00:54.4878473Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        }
    ],
    "total": 1
}

Update a location name and status.


PUT v2/client/locations

Request
Headers
X-Developer-Id developer id
X-Api-Key api key
Authorization Bearer {{access_token}}
 
Body Parameters
OrganizationId integer
Id integer
Name string
StatusCode StatusCode

sample request
PUT /api/v2/client/locations HTTP/1.1
Host: api.sandbox.connectedcare.md
X-Developer-Id:  {{apiDeveloperId}}
X-Api-Key:  {{apiKey}}
Authorization:  Bearer {{accessToken}}
cache-control: no-cache
Content-Type: application/json; charset=UTF-8
Postman-Token: c0acb400-6f5b-4685-b10e-1fa94f1fbbbd
{
    "organizationId": 73,
    "id": 87,
    "name": "O2Loc3-1",
    "statusCode": 1
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--

sample response:
{
    "data": [
        {
            "name": "O2Loc3-1",
            "organizationId": 73,
            "id": 87,
            "statusCode": 1,
            "createdDate": "2019-01-03T19:00:54.487Z",
            "modifiedDate": "2019-01-03T19:20:00.1017855Z",
            "createdByUserId": 31630,
            "modifiedByUserId": 31630
        }
    ],
    "total": 1
}

Clone this wiki locally