The Prophet ﷺ sent Khalid bin Walid to the people of Yemen calling them to Islam, but they did not respond to him. Then the Prophet ﷺ sent Ali bin Abu Talib and ordered him to bring Khalid back, along with those who were with him, except that any man who had been with Khalid and wished to remain with Ali could do so.Bara said, "I was among those who stayed on with him. When we drew near the people, they came out to meet us. Ali led us in prayer, arranging us in a single row, then he stepped forward in front of us and recited to them the letter of the Messenger of Allah ﷺ. The whole tribe of Hamdan accepted Islam. Ali wrote to the Messenger of Allah ﷺ informing him of their acceptance of Islam. When the Messenger of Allah ﷺ read the letter, he fell down in prostration. Then he raised his head and said, 'Peace be upon Hamdan, peace be upon Hamdan.'"
بعث النبي ﷺ خالد بن الوليد إلى أهل اليمن يدعوهم إلى الإسلام فلم يجيبوه، ثم إن النبي ﷺ ما بعث علي بن أبي طالب وأمره أن يقفل خالدا ومن كان معه إلا رجل ممن كان مع خالد أحب أن يعقب مع على فليعقب معه قال البراء: فكنت ممن عقب معه، فلما دنونا من القوم خرجوا إلينا، فصلى بنا علي وصفنا صفا واحدا، ثم تقدم بين أيدينا، فقرأ عليهم كتاب رسول الله ﷺ، فأسلمت همدان جميعا، فكتب علي إلى رسول الله ﷺ، بإسلامهم، فلما قرأ رسول الله ﷺ الكتاب خر ساجدا، ثم رفع رأسه، فقال: السلام علي همدان، السلام علي همدان.
Bayhaqi narrated it in Al-Kubra (2/369) through two routes from Abu Ubayda bin Abu Sifr, who said, I heard Ibrahim bin Yusuf bin Abu Ishaq, from his father, from Abu Ishaq, from Bara bin Azib, who said, then he related it. Bayhaqi said, "Bukhari (4349) related the beginning of the hadith from Ahmad bin Uthman, who said, Shurayh bin Maslama told us, from Ibrahim bin Yusuf bin Abu Ishaq, but he did not relate it in full, and the prostration of gratitude in the full version of the hadith is sahih according to his standard." End of quote.I say, the hadith of Bukhari to which Bayhaqi referred is found in the chapters on military expeditions and raiding parties.