API for LSM (v2) - LabCollector

Knowledge Base

Search Knowledge Base by Keyword

API for LSM (v2)

You are here:
← All Topics

 Available methods in LSM web service for API v2.0:-

1.1. Jobs

  •  Method: GET
  •  URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  •  Optional parameters:
    datefrom    jobid    assayid    samplename    samplestatusdatefrom    dateto    sampleid    status    samplestatus    samplestatusdateto
    Note: if you use the status parameter, by default only job in progress are returned, use status=all for view all jobs\

1.2. Equipment

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getEquipmentList=1
  • Optional parameters: id

1.3. Assays

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getAssayList=1
  • Optional parameters: id

1.4. Categories

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getCategoryList=1
  • Optional parameters: id

1.5. Sample Types

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getSampleTypeList=1
  • Optional parameters: id

1.6. Parameters

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getParameterList=1
  • Optional parameters: id  level
    Note: level=J returns job parameters, level=S returns sample parameters, and level=A returns test parameters

1.7. Requesters

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getRequesterList=1
  • Optional parameters: id

1.8. Create requesters

  • Method: POST
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Required parameters: create
  • Example: 
    <requesters> 
    
    <requester code='R01' name='Requester from API' taxNumber='12346789'> 
    
    <billing address='One street' city='City' state='State' country='US' zip='99999' phone='555123123' fax='555123123' contactFirstName='Jane' contactLastName='Doe' contactEmail='[email protected]' ></billing> 
    
    <shipping address='One street' city='City' state='State' country='US' zip='99999' phone='555123123' fax='555123123' contactFirstName='Jane' contactLastName='Doe' contactEmail='[email protected]' ></shipping> 
    
    </requester> 
    
    </requesters>

1.9. Create job

  • Method: POST
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Required parameters: create
  • Example of create:
    <jobs>
    <job number='job-api-006' requester='21' project="109">
    <parameter id='242' value='text'></parameter>
    <sample name='job-api-006-sample1' type='1' comment='notes1'>
    <parameter id='247' value='Female'></parameter>
    <assay id='1'></assay>
    <assay id='2'></assay>
    </sample>
    <sample name='job-api-006-sample2' type='1' comment='notes2'>
    <parameter id='247' value='Male'></parameter>
    <assay id='1'></assay>
    <assay id='2'></assay>
    </sample>
    </job>
    <job number='job-api-007' requester='21' project="Test new project code">
    <parameter id='242' value='text'></parameter>
    <sample name='job-api-007-sample1' type='1' comment='notes1'>
    <parameter id='247' value='Female'></parameter>
    <assay id='1'></assay>
    <assay id='2'></assay>
    </sample>
    <sample name='job-api-007-sample2' type='1' comment='notes2'>
    <parameter id='247' value='Male'></parameter>
    <assay id='1'></assay>
    <assay id='2'></assay>
    </sample>
    </job>
    </jobs>

Multiple jobs and multiple samples are allowed.
Attribute Requester supports id or text.
Attribute project supports id or text

1.10. Save results

  • Method: POST
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Required parameters: result
  • Example of result:
    <assays><assay uniqueid=”1223″><result><parameter id=”34″ unit=”mg” value=”123″/><parameter id=”35″ unit=”ml” value=”456″/></result></assay></assays>

1.11. Invoices

  • Method: GET
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2&getInvoiceList=1
  • Optional parameters: id    dateto    Format (CSV | IIF)    datefrom    status

1.12. Upload files

  • Method: PUT
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Parameters:
  • REQUIRED: upload  file  uniqueid (identifier of job-sample-assay)
  • OPTIONAL  id  name
  • Response: OK 200

1.13. Link sample to module

  • Method: PUT
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Parameters REQUIRED: sampleid (identifier of sample) or samplename      module (module name or short name)     recordid (identifier of record in the module)
  • Response: OK 200

1.14. Update sample ¡New!

  • Method: PUT
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Parameters:
    REQUIRED: sampleid (identifier of sample) or samplename
    OPTIONAL: shipmentstatus    name     type    batch
    * Note: sampleid supports multiple ids separated by a comma.
    ** Note: shipmentstatus supports the following numbers or labels: 0|Submitted, 1|In transit, 2|Received, 3|Returned

1.15. Update sample status ¡New!

  • Method: PUT
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Parameters:
  • REQUIRED   sampleid (identifier of sample) or samplename
  • OPTIONAL  status      startedby (valid User ID in LSM)     startedon     completedby      completedon     validatedby       validatedon
  • Response: OK 200
    * Note: sampleid supports multiple ids separated by a comma.
    ** Note: status supports the following value: started | completed | approved
    *** Note: the datetime fields are in the form of YYYY-MM-DD hh:mm:ss.
    **** Note: If the status is set to ‘started’ and the parameters Startedby, startedon, completedby, completedon, validatedby, validatedon are not received, the default operator selected in API settings or the current date will be used instead.

1.16. Start a batch ¡New!

  • Method: PUT
  • URL: http://[my_labcollector_url]/extra_modules/lsm/webservice/index.php?v=2
  • Parameters:
    REQUIRED:   batch (batch name)      startedby (user id valid in LSM (or 1 for super admin)
    OPTIONAL:   startedon