Barton entered the Diplomatic Service in the Chinese Consular Service on 16 September 1895 and was posted to the legation in Peking as a student interpreter. From 1899 to 1901 he was posted on special service to the British territory of Weihaiwei. When the Boxer Rebellion erupted in 1900 culminating in the siege of the foreign legations, Barton took part in the Eight-Nation Alliance relief efforts as an interpreter and assistant political officer and was awarded the China War Medal for his actions. On 14 November 1901 he was appointed Vice-Consul to the Consul in Tienstin, Lionel Charles Hopkins.