Connect to vendOS websocket
This documentation is ordered by actions that you can perform on the API, they all have an introduction that explains the purpose of the resource. All examples are in vanilla JS with possible error codes listed at the bottom in a table.
FieldCommand is the local server running on our PC within the machine. It is composed of 3 parts, FieldCommand Server, FieldCommand View, and FieldCommand UI.
The server is what you will be using to connect to the hardware and our servers. You will primarily be using it to issue vends and save data. The connection is established via a local websocket, however we have abstracted that away and provide a simple promise based library to get you up and running with ease.
This is where your app gets shown, all thats required is an index.html in the directory you upload to get going. You can use the entirety of the screen (1080 x 1920px Portrait) apart from the bottom left 100 x 100px which is used to access FieldCommand UI. The browser your code is running in is Chromium (v). Your files are downloaded, saved to disk on the machine, and then served from a simple local http server allowing the app to keep running regardless of internet connection.
FieldCommand UI is accessed by clicking the bottom left hand 100 x 100px 4 times within 3 seconds (button smash it!). Once this is opened you enter a passcode (default: 123456) and have access to the UI. In here you can test the vending of channels, set up useful SMS notifications and configure the settings.
If you would like to skip past the tutorial and just grab an example repo with every action you can do on the API then just clone this and have a dig through the internal directories.
Open up your terminal and clone the repo
git clone https://github.com/vendOS-io/vendOS-js
There are multiple directories contained within the repo, it will be updated whenever we have a new endpoint.
We know that learning a new technology can sometimes be overwhelming, and it's totally normal to get stuck. If that happens, we recommend emailing [email protected] for help.
If something in the tutorial seems confusing, contains an error, or you would just like a new feature, we'd love to help! Just send and email to [email protected] and we will be sure to jump on it at the next opportunity.