By the 1870s it had become the standard way for telegraph operators to acknowledge receiving a transmission, and it was well on its way to becoming the greatest American word.
Allan Metcalf, the author of OK: The Improbable Story of America's Greatest Word, puts it, is that it was “born as a lame joke perpetrated by a newspaper editor in 1839.