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 listGET api/v2/crm/org
Get CRM organization dataGET api/v2/crm/org/{id}
Create or update CRM organizationPOST api/v2/crm/org
Delete CRM organizationDELETE api/v2/crm/org/{id}




Get CRM organizations list

URL & Method & Description

GET api/v2/crm/org

Retrieves CRM organizations list.

Request:

Request (sample)
GET https://eldoc.domain.com/api/v2/crm/org
ParamTypeDescriptionSample 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 paramNumber of documents to be retrieved per request. Default value is 10. Allowed range [1, 100]1, 5, 10, 20, 100

Response:

Response headers
Content-Type: application/json
X-Total-Count: 10
Response body (sample)
[
  {
    "_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

URL & Method & Description

GET api/v2/crm/org/{id}

Retrieves CRM organization entry.

Request:

Request (sample)
GET https://eldoc.domain.com/api/v2/crm/org/{id}
ParamTypeDescriptionSample values (comma separated)
{id}Path param

Id of the entry, can be one of the following:

  • Full id (_id, 24 hex-character)
  • External Id (_id_ext)
  • Government Id (govId)

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:

Response headers
Content-Type: application/json
Response body (sample)
{
    "_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

URL & Method & Description

POST api/v2/crm/org

Creates or updates CRM organization entry.

Access rights requirement

Method requires [elAdminCrmRW] role

Request:

Request (sample)
POST https://eldoc.domain.com/api/v2/crm/org
Request body (sample)
{
    "_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:

Response headers
Content-Type: application/json
Response body (sample)
{
    "_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

URL & Method & Description

DELETE api/v2/crm/org/{id}

Deletes CRM organization entry.

Access rights requirement

Method requires [elAdminCrmRW] role

Request:

Request (sample)
DELETE https://eldoc.domain.com/api/v2/crm/org/{id}
ParamTypeDescriptionSample values (comma separated)
{id}Path param

Id of the entry, can be one of the following:

  • Full id (_id, 24 hex-character)
  • External Id (_id_ext)
  • Government Id (govId)

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:

Response headers
Content-Type: application/json
Response body (sample)
null



Last modified: April 28, 2023