Solution to the Ward identities for superamplitudes