مشكوة المصابيح Mishkat al-Masabih كتاب المناقب The Book of Merits
(دُعَاءُ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لِشِفَاءِ حَضْرَةِ عَلِيٍّ رَضِيَ اللَّهُ عَنْهُ)

(The supplication of the Messenger of Allah, peace be upon him, for the recovery of Hazrat Ali, may Allah be pleased with him)

1 hadith
Hadith 6107
وَعَنْهُ قَالَ: كُنْتُ شَاكِيًا فَمَرَّ بِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَأَنَا أَقُولُ: اللَّهُمَّ إِنْ كَانَ أَجَلِي قَدْ حَضَرَ فَأَرِحْنِي وَإِن كَانَ متأخِّراً فارفَعْني وَإِنْ كَانَ بَلَاءً فَصَبِّرْنِي. فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «كَيْفَ قُلْتَ؟» فَأَعَادَ عَلَيْهِ مَا قَالَ فَضَرَبَهُ بِرِجْلِهِ وَقَالَ: «اللَّهُمَّ عَافِهِ-أَوِ اشْفِهِ-» شَكَّ الرَّاوِي قَالَ: فَمَا اشْتَكَيْتُ وَجَعِي بَعْدُ. رَوَاهُ التِّرْمِذِيُّ وَقَالَ: هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ
He said: God's messenger came upon me when I had a complaint and was saying, "O God, if my appointed time has come grant me rest, if it is to be delayed grant me abundant means of subsistence, but if this is a testing grant me endurance." God's messenger asked him how he had expressed himself, and when he repeated to him what he had said, he gave him a kick and said, "O God, heal him," or, "cure him. The transmitter was doubtful about the exact words. He said that he did not afterwards complain of his pain. Tirmidhi transmitted it, saying this is a hasan sahih tradition.
Hadith Reference Mishkat al-Masabih / The Book of Merits / Hadith: 6107
Hadith Grading الألبانی: ضَعِيف  |  زبیر علی زئی: إسناده حسن
Hadith Takhrij ´تحقيق و تخريج: محدث العصر حافظ زبير على زئي رحمه الله` «إسناده حسن، رواه الترمذي (3564)»