The Coke Machine, rather amusingly, has its own website with a bit more information on its history.
The Ancient History document explains how the original Coke Machine operated:
The final piece of the puzzle was needed to let people check Coke
status when they were logged in on some other machine than CMUA. CMUA's
Finger server was modified to run the Coke status program whenever
someone fingered the nonexistent user "coke". (For the uninitiated,
Finger normally reports whether a specified user is logged in, and if
so where.) Since Finger requests are part of standard ARPANET (now
Internet) protocols, people could check the Coke machine from any CMU
computer by saying "finger coke@cmua". In fact, you could discover the
Coke machine's status from any machine anywhere on the Internet! Not
that it would do you much good if you were a few thousand miles away...
For the first generation Coke Machine, in the 70s and 80s, the
finger command was (ab)used while connecting through ARPANET, the precursor of the Internet. Not exactly a complex protocol, but it worked well enough to indicate the state of the coke machine without being overly difficult to set up.
If you're interested in exactly how the
finger command worked, here is an extract from Wikipedia detailing how it operates:
The finger daemon runs on TCP port 79. The client will (in the case of remote hosts) open a connection to port 79. An RUIP (Remote User Information Program) is started on the remote end of the connection to process the request. The local host sends the RUIP one line query based upon the Finger query specification, and waits for the RUIP to respond. The RUIP receives and processes the query, returns an answer, then initiates the close of the connection. The local host receives the answer and the close signal, then proceeds closing its end of the connection.
finger command can also provide some custom information, such as full name, email address, and some custom text. Presumably the custom text was used to send the state of the Coke Machine and the coldness of the Cokes inside.