Machiavelli's first post was that of Clerk in the Second Chancery of the Commune and in I498 he was promoted as a Second Chancellor and Secretary. He continued in this office till the year 15I2. While thus employed he undertook a large number of diplomatic missions both to the petty courts of Italy and to other countries, and it was the experience of these missions which was largely responsible for forming the views which he subsequently expounded in his political writings. He was specially influenced by his mission to the camp of Cesare Borgia, Duke of Valentinois, in 1502. Although Machiavelli had undertaken this mission unwillingly, he soon conceived an intense admiration for Cesare's resourcefulness in resorting alternatively to diplomacy and force as instruments of government and for his firm administration of conquered provinces. Machiavelli idealised Cesare's achievements and thought that Cesare had attained, more than any other public figure of the time; the embodiment of a perfect ruler.