Constructing scattering amplitudes from their formal properties