Blac Chyna got the restraining order she sought against Rob Kardashian ... and she celebrated outside court with her attorneys.

Chyna was flanked by Lisa Bloom and Walter Mosley as they laid out the terms of the restraining order. Rob is now barred from any further cyberbullying of Chyna -- including posting photos or videos of her, or making any personal comments about her. He also has to stay away from her.

Rob was not in court, but his attorney, Robert Shapiro, was ... and also spoke briefly to the media after the hearing. As we first reported, Shapiro did not contest the restraining order ... and said Rob is just interested in doing what's best for their daughter, Dream.

HE'S SORRY
TMZ.com