It has been claimed that three schoolboys, all aged 15, attacked the 21-year-old man while filming and taking pictures of the assault using a mobile camera phone.
The incident is alleged to have taken place outside a builders' yard in Eyre Place, Canonmills, in broad daylight. It is believed that the man was assaulted as he turned into Eyre Place.
Passers-by are understood to have gone to his aid before the police and ambulance crews arrived.
The man was treated for cuts and bruises to his body and face at the city's Royal Infirmary.
A report has been sent to the procurator fiscal following the alleged incident, which happened around 9.50am on Tuesday.
Teresa Kershaw, of AA Pets and Supplies on Rodney Street, said she saw the boys threatening the victim shortly before he was attacked.
She said: "The first I knew of it was when someone came into the shop to say this guy had been attacked."
Police are understood to be studying CCTV footage from the Builder Center , adjacent to where the alleged attack took place.
Another shopkeeper, who asked not to be named, said: "The guy had earphones in and just seemed to be minding his own business.
"I never thought that it would develop into something like this."
A spokesman for Lothian and Borders Police said: "Three teenagers, all aged 15, have been arrested and charged in connection with an incident on Eyre Place just before 10am on Tuesday morning. A report has been sent to the procurator fiscal."
Happy slapping is a violent trend that first emerged last year in which attackers get a thrill from recording their victim's suffering on a camera phone and sending the pictures to friends. The trend has been linked to prank TV shows such as Jackass and Dirty Sanchez.
The majority of new mobile phones have a built-in camera that allows still images and video footage to be captured.
In one of the more serious incidents, Becky Smith, 16, was knocked unconscious and suffered temporary paralysis after she was attacked by fellow pupils at Plant Hill High, Manchester.
John Prescott, the Deputy Prime Minister, also revealed that he nearly fell victim to an attack by a gang of youths at a motorway service area.
And David Smolinski and Benjamin Mortenson, both 18, were jailed for six years last year after filming themselves setting fire to a homeless man near Manchester.