We use rational formality of configuration spaces and the bar construction to study the cohomology of the space of braids in dimension four or greater. We provide a diagram complex for braids and a quasi-isomorphism to the de Rham cochains on the space of braids. The quasi-isomorphism is given by a configuration space integral followed by Chens iterated integrals. This extends results of Kohno and of Cohen and Gitler on the cohomology of the space of braids to a CDGA suitable for integration. We show that this integration is compatible with Bott-Taubes configuration space integrals for long links via a map between two diagram complexes. As a corollary, we get a surjection in cohomology from the space of long links to the space of braids. We also discuss to what extent our results apply to the case of classical braids.