api/v2/crm/org
CrmOrg model represents organization in the elDoc system. This REST API Reference describes available methods for the CrmOrg objects.
API overview
Method | API endpoint |
---|---|
Get CRM organizations list | GET api/v2/crm/org |
Get CRM organization data | GET api/v2/crm/org/{id} |
Create or update CRM organization | POST api/v2/crm/org |
Delete CRM organization | DELETE api/v2/crm/org/{id} |
Get CRM organizations list
GET api/v2/crm/org
Retrieves CRM organizations list.
Request:
GET https://eldoc.domain.com/api/v2/crm/org
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{first} | Query param | First document index to be retrieved. First request usually starts from index 0. Default value is 0. Allowed range [0, 2147483646] | 0, 15, 50 |
{pageSize} | Query param | Number of documents to be retrieved per request. Default value is 10. Allowed range [1, 100] | 1, 5, 10, 20, 100 |
Response:
Content-Type: application/json X-Total-Count: 10
[ { "_id": "59e351e8805645140093721", "_id_web": "A2", "govId" : "22334455", "owner": "usr-a55dc9cd-1ecd-474-955a-8383c666702d", "author": "api-f55dc9cd-1ecd-474-955a-8383c666549f", "notes": "", "name": "dms-solutions", "nameExt" : [], "areaId": "59e351da8056451460093702", "typeId": "59e351da8056451460093705", "_meta": { "_created": "2015-12-28T05:16:09Z", "_lastmodified": "2016-07-02T13:54:21Z", "_rev": 0 } }, { "_id": "59e351e8805645140093722", "_id_web": "A3", "govId" : "22334457", "owner": "usr-a55dc9cd-1ecd-474-955a-8383c666702d", "author": "api-f55dc9cd-1ecd-474-955a-8383c666549f", "notes": "", "name": "eldoc", "nameExt" : [], "areaId": "59e351da8056451460093702", "typeId": "59e351da8056451460093705", "_meta": { "_created": "2015-12-28T05:16:09Z", "_lastmodified": "2016-07-02T13:54:21Z", "_rev": 0 } } ]
Get CRM organization data
GET api/v2/crm/org/{id}
Retrieves CRM organization entry.
Request:
GET https://eldoc.domain.com/api/v2/crm/org/{id}
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{id} | Path param | Id of the entry, can be one of the following:
Search is done in the order as per the list above, first matched record returned. | _id: 59e351e8805645140093721, 59e351e8805645140093722 _id_ext: abc123, 56, 898998 govId: 56789548 |
Response:
Content-Type: application/json
{ "_id": "59e351e8805645140093721", "_id_web": "A2", "govId" : "22334455", "owner": "usr-a55dc9cd-1ecd-474-955a-8383c666702d", "author": "api-f55dc9cd-1ecd-474-955a-8383c666549f", "notes": "", "name": "dms-solutions", "nameExt" : [], "areaId": "59e351da8056451460093702", "typeId": "59e351da8056451460093705", "_meta": { "_created": "2015-12-28T05:16:09Z", "_lastmodified": "2016-07-02T13:54:21Z", "_rev": 0 } }
Create or update CRM organization
POST api/v2/crm/org
Creates or updates CRM organization entry.
Access rights requirement
Method requires [elAdminCrmRW] role
Request:
POST https://eldoc.domain.com/api/v2/crm/org
{ "_id": "59e351e8805645140093722", "name" : "Org name to be set", "govId":"1234" }
Info
Entry for update located using one of the following fields from the submitted request body:
- _id - full Id
- _id_ext - external Id
- govId - government Id
Search is done in the order as per the list above, first matched record used for update.
In case no entry matched or none of the listed above fields is provided within the request body - new entry will be created
Response:
Content-Type: application/json
{ "_id": "59e351e8805645140093722", "_id_web": "A2", "govId" : "1234", "owner": "usr-a55dc9cd-1ecd-474-955a-8383c666702d", "author": "api-f55dc9cd-1ecd-474-955a-8383c666549f", "notes": "", "name": "Org name to be set", "nameExt" : [], "areaId": "59e351da8056451460093702", "typeId": "59e351da8056451460093705", "_meta": { "_created": "2015-12-28T05:16:09Z", "_lastmodified": "2016-07-02T13:54:21Z", "_rev": 0 } }
Delete CRM organization data
DELETE api/v2/crm/org/{id}
Deletes CRM organization entry.
Access rights requirement
Method requires [elAdminCrmRW] role
Request:
DELETE https://eldoc.domain.com/api/v2/crm/org/{id}
Param | Type | Description | Sample values (comma separated) |
---|---|---|---|
{id} | Path param | Id of the entry, can be one of the following:
Search is done in the order as per the list above, first matched record returned. | _id: 59e351e8805645140093721, 59e351e8805645140093722 _id_ext: abc123, 56, 898998 govId: 56789548 |
Response:
Content-Type: application/json
null
Last modified: April 28, 2023