What is the MEX OData API?
The MEX OData API provides RESTful access to MEX using the Open Data Protocol (OData). It enables external software and applications to integrate directly with your MEX system and access data such as work orders, assets, and purchase orders in a simple, standardized way. The API is built into MEX 15 and does not require additional licensing.
This makes it straightforward to build custom integrations that extend MEX functionality. The API also supports real-time data access, allowing users and systems to quickly retrieve up-to-date information from MEX.
How can I use the MEX OData API?
A .NET client for the MEX OData API is available on GitHub, with documentation provided alongside it. For more detailed guidance on using the API, the Open Data Protocol specification may also be helpful. The API is accessible on your MEX site at the relative path /OData.svc/, for example: https://trial.mex.com.au/MEX/OData.svc/. Learn how to authorise with the API on this page.
By default, the API uses XML for serialization, so it is recommended to set the ‘Content-Type’ and ‘Accept’ headers to “application/json” to send and receive data in JSON format, respectively.
While examples are provided using curl, Postman is a convenient tool for testing HTTP requests. If your MEX site has security enabled, an 'Authorization' header can be setup in Postman by inputting your MEX username and password under the Authorization tab, as seen below.
Example Usage
Get resources
curl -L "https://trial.mex.com.au/MEX/OData.svc/" \
--header "Accept: application/json"
Get resources with authentication
curl -L "https://trial.mex.com.au/MEX/OData.svc/" \
-u admin:admin \
--header "Accept: application/json"
Get resources metadata
curl "https://trial.mex.com.au/MEX/OData.svc/\$metadata"
Get all assets
curl "https://trial.mex.com.au/MEX/OData.svc/Assets" \
--header "Accept: application/json"
Get an asset by ID
curl "https://trial.mex.com.au/MEX/OData.svc/Assets(75)" \
--header "Accept: application/json"
Get an asset by number
curl -G "https://trial.mex.com.au/MEX/OData.svc/Assets" \
--data-urlencode "\$filter=AssetNumber eq 'ADMIN'" \
--header "Accept: application/json"
Get work order IDs and descriptions raised after 2026-01-01 00:00:00
curl -G "https://trial.mex.com.au/MEX/OData.svc/WorkOrders" \
--data-urlencode "\$select=WorkOrderID,WorkOrderDescription" \
--data-urlencode "\$filter=RaisedDateTime gt DateTime'2026-01-01T00:00:00'" \
--header "Accept: application/json"
Create an asset
curl "https://trial.mex.com.au/MEX/OData.svc/Assets" \
--json '{ "ParentAssetID": 17, "AssetNumber": "RM104", "AssetDescription": "Office No 4 Admin Building 1st Floor", "IsAsset": true, "IsActive": true, "CreatedByContactID": 1, "CreatedDateTime": "2026-01-05T10:15:48" }'
Update an asset
curl -X PATCH "https://trial.mex.com.au/MEX/OData.svc/Assets(201)" \
--json '{ "AssetTypeID": 26, "AccountCodeID": 9 }'
Delete an asset
curl -X DELETE "https://trial.mex.com.au/MEX/OData.svc/Assets(201)"
Troubleshooting
Here are the common issues we have seen customers face:
- Misspelt resource name; refer to base URL /OData.svc/ for a list of resources names.
- Missing ‘Authorization’ header; most MEX sites have security enabled, where MEX user credentials must be supplied to use the API. More information is here.
- Getting more readable data; to make data more readable, set the headers “Accept: application/json” to receive JSON and “Content-Type: application/json” when sending data.