Recently the head legal council for BioTrackTHC wrote an article extolling the virtues of their API. We’ve been using this API for over a year and have to say, it’s a flaming pile of junk.

They Get the Basics Wrong

It’s kind of known that REST style APIs, while not the best, are very operable for simple data object sharing, which is what we have a lot of here. The marijuana inventory tracking system is simply Plants and Inventory, with some simple properties controlling the owner, or state of the plant. Here we have a single endpoint (/serverjson.asp), with ‘Actions’ that must be taken. Modern developers (since at least 2000) have been using Object endpoints, like /plants or /inventory. Not here.

The system uses the incorrect MIME type for the requests. Their specification indicates we have to submit the data using ‘text/JSON’ and their system replies with ‘text/plain’. The proper MIME type for JSON is ‘application/json’. Everyone else knows this, yet somehow BioTrackTHC who claims to be the most advanced product, cannot even get this little detail correct.

Inconsistent Date Handling

Dates are handled in the US specific ‘MM/DD/YYYY’ format – but only sometimes. Other times the date/time values are represented as a UNIX timestamp and sometimes is three discrete fields for Year, Month and Day. And a fourth option of ‘YYYYMMDD’ is also used. Four different ways to represent times!? Doesn’t consistency matter anymore? What the hell is going on over there?

No Unit of Measure

When submitting data to the system one can specify a unit of measure. When the data comes out of the system there is no unit of measure provided. It’s assumed that the unit is grams. However, many times submitting the data as ‘2.2 lb’ yields later a value of ‘2.2 grams’. We brought this up with BioTrack and eight days later they responded, telling us it was not possible to duplicate the issue. We re-ran our test case and can confirm this one was fixed.

Not Real Time

There is no method to query the status of an individual item. That is, you’d expect to be able to query via this API to get details on a specific Plant or Inventory or Manifest or Employee? The only method is to query via a relic of design the ‘sync’ system. Consumers of the BioTrackTHC API must fetch object in bulk in full or in part by requesting a range of objects based on state system internal transaction identifiers. Total crap.

Overloaded Fields

For some inventory types, the field ‘_usableweight’ doesn’t mean usable weight, it means original weight recorded and ‘_remainingquantity’ field represents the values currently on hand. And Yet, using the States own WebUI to create products many times this field is left empty, so the original values are not even known!

Bottom Line

If your State is going to be implementing a traceability system for marijuana then it’s critical to have a system you can trust. What has been deployed in Washington just simply does not satisfy these requirements.