All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The story is authentic, and the chain of narration of the Hadeeth is authentic as well and was cited in the Musnad of Imam Ahmad, may Allaah have mercy upon him. ‘Abdullaah ibn Ja‘far narrated: “The Messenger of Allah seated me behind him (on his ride) one day and told me a secret which I shall disclose to no one. It happens that the Prophet preferred to take cover behind a hillock or a thicket of date-palm trees when relieving himself. He once entered a thicket that belonged to a man from the Ansaar when suddenly a camel came towards him weeping tenderly with its eyes welling with tears. (Bahz and ‘Affaan said:) When it saw the Prophet it began to groan and its eyes flowed. He patted it on its hump and the base of its head until it quieted down. Then, he, said: ‘Who is the owner of this camel?’ A young man from the Ansaar came and said, ‘It is mine, O Messenger of Allah!’ He said: ‘Do you not fear Allah with regard to this beast which He has placed in your possession? It complained to me that you starve it and put it to toil.’”
This Hadeeth was cited by Imam Ahmad in his Musnad, and Al-Arnaa’oot, said about it in his authenticating revision of the book: “Its chain of narration is authentic according to the conditions stipulated by Muslim.” The full version was cited by Al-Bayhaqi in his book Dalaa’il An-Nubuwwah, and a brief version of it was cited by Muslim and others.
Based on the above, you can find the Hadeeth in Musnad Ahmad and Dalaa’il An-Nubuwwah by Al-Bayhaqi.
Allah Knows best.