WORK IN PROGRESS. NOT IMPLEMENTED YET!!

Advanced Data Modules (ADM)

You can get more details about an ADM data structure from here

Queries

List all modules

Fetches the list of modules enabled for this company

Resource URL

GET /companies/<company_uuid>/adms

Example Request

curl "https://api.metroleads.com/companies/74dc3d24-7d56-453c-9c9f-fd2ca8e77237/adms"

Example Response

[
  {
    "display_name": "Invoice",
    "adm_id": "0a90b797-e68f-4628-867a-3c318e8a9d94",
    "type": "built-in"
  },
  {
    "display_name": "Prescription",
    "adm_id": "9c9414d4-2d4f-4433-a752-14cf52bf9a96",
    "type": "custom"
  }
]

Module Meta

Returns the meta data for a specific module

Resource URL

GET /companies/<company_uuid>/adms/<adm_uuid>/meta

Example Request

curl "https://api.metroleads.com/companies/74dc3d24-7d56-453c-9c9f-fd2ca8e77237/adms/4a93bb55-621e-4046-80fb-c511ed157089/meta"

Example Response

{
   "display_name":"Prescriptions",
   "adm_id":"4a93bb55-621e-4046-80fb-c511ed157089",
   "type":"built-in",
   "custom_fields":[
      {
         "name":"manufacturer",
         "choices":[
            "Cipla",
            "Ranbaxy",
            "Lupin"
         ],
         "label":"Manufacturer",
         "type":"dropdown",
         "is_identifier":false,
         "auto_generated": false
      },
      {
         "name":"transaction_id",
         "label":"Transaction Id",
         "type":"number",
         "is_identifier":true,
         "auto_generated": true
     }
   ],
   "i18n":{
      "lead_title_singular":"Lead",
      "lead_sentence_singular":"lead",
      "lead_sentence_plural":"leads",
      "lead_title_plural":"Leads"
   },
   "restrictions": {}
}

List records

Lists records in a module based on filters. Refer to ADM data structure from here for list values

Resource URL

GET /companies/<company_uuid>/adms/<adm_uuid>/records

Example Request

curl "https://api.metroleads.com/companies/74dc3d24-7d56-453c-9c9f-fd2ca8e77237/adms/4a93bb55-621e-4046-80fb-c511ed157089/records"

Example Response

{
  "count": 6759,
  "records": [
    {}, {}, {}
  ]
}

Create a record

Creates a record. Refer to ADM data structure from here. Returns the newly created record.

Resource URL

POST /companies/<company_uuid>/adms/<adm_uuid>/records

Example Request

curl "https://api.metroleads.com/companies/74dc3d24-7d56-453c-9c9f-fd2ca8e77237/adms/4a93bb55-621e-4046-80fb-c511ed157089/records" -d '{}'

Example Response

{}

Get single record

Returns a single record. Refer to ADM data structure from here

Resource URL

GET /companies/<company_uuid>/adms/<adm_uuid>/records/<record_uuid>

Example Request

curl "https://api.metroleads.com/companies/74dc3d24-7d56-453c-9c9f-fd2ca8e77237/adms/4a93bb55-621e-4046-80fb-c511ed157089/records/74585bc0-ecae-4569-8060-9103a550c249"

Example Response

{}

Update single record

Update a single record. Refer to ADM data structure from here

Resource URL

POST /companies/<company_uuid>/adms/<adm_uuid>/records/<record_uuid>

Example Request

curl "https://api.metroleads.com/companies/74dc3d24-7d56-453c-9c9f-fd2ca8e77237/adms/4a93bb55-621e-4046-80fb-c511ed157089/records/74585bc0-ecae-4569-8060-9103a550c249" -d '{}'

Example Response

{}