The Useless Digest A Free Weekly dose of Facts, Quotes, History and more - direct to your inbox. The term appears in the phrase get the rap as early as 1865. In this sense it refers to the punishment of a crime or action. In all likelihood the term derives from the sense meaning a blow or strike. To take the rap is to take the blow.
Rap is also a term used to mean a counterfeit or false coin.
Swift first uses it in 1724. This sense is archaic, dying out in the 19th century. This sense may be related to the first, particularly in the idea that a rap is undeserved. But the use of bum in front of the term to indicate a false charge indicates that a rap is not necessarily false, so perhaps they are unrelated. The rap sheet is a term for any listing of a person's past criminal charges and convictions.