The XYZ affair is what the diplomatic controversy was better known as.
It was the perjury and then the obstruction of justice.
The Three requirements one must meet before becoming a member of the Senate are one you have to be at least 30 years old. Second, a U.S. citizen for at least nine years at the time of election to the Senate. And third, a resident of the state one is elected to represent in the Senate.