William Frederick "Buffalo Bill" Cody (February 26, 1846 - January 10, 1917) was an American scout, bison hunter, and showman. He was born in Le Claire, Iowa Territory (now the U.S. state of Iowa), but he lived for several years in his father's hometown in Toronto Township, Ontario, Canada, before the family returned to the Midwest and settled in the Kansas Territory. Buffalo Bill started working at the age of eleven, after his father's death, and became a rider for the Pony Express at age 14. During the American Civil War, he served the Union from 1863 to the end of the war in 1865.

After his mother recovered, Cody wanted to enlist as a soldier in the Union Army during the American Civil War, but was refused because of his young age. He began working with a freight caravan that delivered supplies to Fort Laramie, in present-day Wyoming. In 1863, at age 17, he enlisted as a teamster with the rank of private in Company H, 7th Kansas Cavalry, and served until discharged in 1865.  The next year, Cody married Louisa Frederici. They had four children. Two died young, while the family was living in Rochester, New York. They and a third child are buried in Mount Hope Cemetery, in Rochester.  Cody went back to work for the Army in 1868 and was Chief of Scouts for the Third Cavalry during the Plains Wars. Part of the time, he scouted for Indians and fought in 16 battles; at other times, he hunted and killed bison to supply the Army and the Kansas Pacific Railroad. In January 1872, Cody was a scout for the highly publicized hunting expedition of the Grand Duke Alexei Alexandrovich of Russia.  Cody was awarded the Medal of Honor in 1872 for gallantry as an Army scout in the Indian Wars. It was revoked in 1913, along with medals of many other recipients, when Congress decided to create a hierarchy of military awards to replace the patchwork which had evolved over time. The result was that the Medal of Honor became the highest military decoration, with its award restricted to "officers or enlisted" personnel who demonstrated bravery "above and beyond the call of duty." The law also allowed the government to retroactively change the honor rolls, resulting in civilian scouts who met neither criterion having their awards rescinded. Cody was one of five scouts affected, whose medals were stripped shortly after Cody died in 1917.  Cody's relatives objected, and over a number of years they wrote repeatedly to Congress seeking reconsideration. All efforts failed, including a 1988 letter to the US Senate from Cody's grandson. A year later the office of Senator Alan K. Simpson of Wyoming took up the cause. Its brief, which argued for the retroactive elevation of these civilian scouts' status to meet the Medal's standards, persuaded the Army Board for Correction of Military Records to restore their medals. To this day, they are the only honorees who were civilians at the time of their award to regain the Medal of Honor.

Using a quote from the above article, answer the following question: Was he in the military?
In 1863, at age 17, he enlisted as a teamster with the rank of private in Company H, 7th Kansas Cavalry, and served until discharged in 1865.