Versions
Versions this documentation is relevant for:
- 8.7.0+
List
The Document Version – List API call reads existing document versions from Eyelit MES-M. The data can be filtered based on the parameters passed in the body/payload of the JSON packet giving the flexibility to search for one or multiple documents.
Using the Document Version – List API call has no impact on the data within the given Eyelit MES-M application, it is read-only.
Figure 1 shows the logic used within the Document Version – List API call.
Figure 1 - Logic within Document Version/List API Call
Data Prerequisites
There is no data required in Eyelit MES-M to act as a pre-requisite to make the API call to list documents. If parameters are passed in through the body that return no valid results, an empty payload will be returned.
Request
Table 1 shows the method and endpoint required to make the API call to list documents.
Table 1 - Outbound Message Detail for Document Version- List
Method | URL Structure | Endpoint |
POST | https://[environment].mestec.net | /api/DocumentVersion/List |
The body of the payload should follow the format below.
JSON Structure for Document Version List
See Table 2 for information on which fields are optional, the appropriate data types and the mappings to fields in Eyelit MES-M.
Table 2 – Parameter Information for Document Version – List
Parameter Name | Data Mapping | Data Type | Mandatory | Case Sensitive | Match Type |
id | DOCUMENTVERSION.ID | Integer | No | N/A | Exact |
document | DOCUMENT.NAME | String | No | N/A | Exact |
version | DOCUMENTVERSION.MAJORVERSION DOCUMENTVERSION.MINORVERSION | String | No | N/A | Exact |
url | DOCUMENTVERSION.URL | String | No | N/A | Exact |
externalVersionRef | DOCUMENVERSION.EXTERNALVERSIONREF | String | No | N/A | Exact |
note | DOCUMENTVERSION.NOTE | String | No | N/A | Exact |
status | DOCUMENTSTATUS.NAME | String | No | N/A | Exact |
Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string.
Sample Request
See below for sample use cases with examples of the JSON payload format required.
To list all document versions for a particular document:
JSON Structure for Document Version List – list all document versions for a particular document
To list all document versions of a particular document with the status “Obsolete”:
JSON Structure for Document Version List – list all document versions for a particular document and status
Response
When using the Document Version – List API call, a JSON payload will be returned containing data in the following structure:
JSON Sample for Document Version List
Sample Response
See below for sample use cases with examples of the JSON payload format returned.
No results were found that matched the given parameters:
Document version found that matched the given parameters:
Upsert
When document version ID is provided, the Document Version – Upsert API call checks if a document version with the given ID already exists. If it does, the appropriate fields are updated in the matching document in Eyelit MES-M.
When the document version ID is omitted, a new document version will be created.
Figure 2 - Logic within Document Version/Upsert API Call
Data Prerequisites
There is no data required in Eyelit MES-M to act as a pre-requisite to make the API call to upsert document versions. If parameters are passed in through the body that return no valid results a new document will be created, otherwise the tool identified will be updated.
Request
Table 3 shows the method and endpoint required to make the API call to upsert document versions.
Table 3 - Outbound Message Detail for Document - Upsert
Method | URL Structure | Endpoint |
POST | https://[environment].mestec.net | /api/DocumentVersion/Upsert |
The body of the payload should follow the format below.
JSON Structure for Document Version Upsert
See Table 4 for information on which fields are optional, the appropriate data types and the mappings to fields in Eyelit MES-M.
Table 4 – Parameter Information for Document Version – Upsert
Parameter Name | Data Mapping | Data Type | Mandatory |
| Case Sensitive | Match Type |
|
|
| Create | Update |
|
|
id | DOCUMENTVERSION.ID | Integer | No | Yes | N/A | Exact |
document | DOCUMENT.NAME | String | Yes | No | N/A | Exact |
version | DOCUMENTVERSION.MAJORVERSION DOCUMENTVERSION.MINORVERSION | String | No | No | N/A | N/A |
url | DOCUMENTVERSION.URL | String | No | No | N/A | N/A |
externalVersionRef | DOCUMENTVERSION.EXTERNALVERSIONREF | String | No | No | N/A | N/A |
note | DOCUMENTVERSION.NOTE | String | No | No | N/A | N/A |
status | DOCUMENTSTATUS.NAME | String | Yes | No | N/A | Exact |
Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string.
Sample Request
See below for sample use cases with examples of the JSON payload format required.
To create a document version:
JSON Sample for Document Version Upsert to create a new document version
To update a document version’s note:
JSON Sample for Document Version Upsert to update a document version

Response
When using the Document Version – Upsert API call, a JSON payload will be returned containing data in the following structure:
JSON Structure for Document Version Upsert
Sample Response
See below for sample use cases with examples of the JSON payload format returned.
JSON Sample for Document Version Upsert