Rib'i bin Hirash (May Allah be pleased with him) reported:
A man of Banu 'Amir tribe has told us that he had asked the Prophet (ﷺ) for permission to enter when he was at home. He said: "May I enter?" Messenger of Allah (ﷺ) said to the servant, "Go out and instruct him about the manner of seeking permission. Tell him to say: As-Salamu 'Alaikum (may you be safe from evil). May I come in?" The man heard this and said: "As-Salamu 'Alaikum (may you be safe from evil). May I come in?" The Prophet (ﷺ) then accorded permission to him and he entered in.[Abu Dawud].
App reference: Book 6, Hadith 28
Arabic/English book reference: Book 6, Hadith 872