After the deaths of his wife Pauline and infant son Alfred in mid-1876, Mosby decided to move his family to Washington, D.C., but had difficulty finding enough legal business to support them. He thus spent much time campaigning for the Republican candidate, Rutherford B. Hayes. Scandals had rocked the Grant Administration as it ended, but Hayes became the next President, and Mosby hoped for a patronage appointment. He also courted powerful Ohio Congressman James Garfield, telling him his desire for a government position, preferably in the Justice Department. He was instead offered a position as trade representative to Canton, but ultimately confirmed by the Senate as United States consul to Hong Kong (a position he held from 1878 to 1885).