Bulugh al-Maram, Book 16, Hadith 1603 (English)

Buraidah (RAA) narrated, ‘The Messenger of Allah heard a man saying: ‘O Allah! I ask you by virtue that I testify that you are Allah; there is no God but You, the one —· the Self Sufficient Master, Who did not beget, and was not begotten, and to whom no one is equal.’ Allah’s Messenger then said, “He has asked Allah by His Name by which when asked, He gives, and by which when supplicated, He answers.” Related by the four Imams and Ibn Hibban graded it as Sahih.

وَعَنْ بُرَيْدَةَ ‏- رضى الله عنه ‏- قَالَ: { سَمِعَ اَلنَّبِيُّ ‏- صلى الله عليه وسلم ‏-رَجُلاً يَقُولُ: اَللَّهُمَّ إِنِّي أَسْأَلُكَ بِأَنِّي أَشْهَدُ أَنَّكَ أَنْتَ اَللَّهُ لَا إِلَهَ إِلَّا أَنْتَ, اَلْأَحَدُ اَلصَّمَدُ, اَلَّذِي لَمْ يَلِدْ, وَلَمْ يُولَدْ, وَلَمْ يَكُنْ لَهُ كُفُوًا أَحَدٌ.‏ فَقَالَ" لَقَدْ سَأَلَ اَللَّهُ بِاسْمِهِ اَلَّذِي إِذَا سُئِلَ بِهِ أَعْطَى, وَإِذَا دُعِيَ بِهِ أَجَابَ } أَخْرَجَهُ اَلْأَرْبَعَةُ, وَصَحَّحَهُ اِبْنُ حِبَّانَ.‏ (2024)‏.‏ ‏3 ‏- صحيح.‏ رواه أبو داود (1493)‏، والنسائي في" الكبرى" (4 / 394‏- 395)‏.‏ والترمذي (3475)‏، وابن ماجه (3857)‏، وابن حبان (2383)‏.‏

sunnah.com

also referenced under: Book 16, Hadith 1560 (In-Book)