How to automate the incoming SMS message and assert the message using Appium and Rest Assured

I have the below scenario but not sure if we can implement/integrate Rest Assured with Appium. Can anyone please help letting me know if this scenario is possible.

Step 1: I have a payload with all required data along with my phone number. Upon posting this payload using RestAssured library, SMS will be triggered to my phone number from 10020 (Short Code/Phone Number)

Step 2: Now, using Appium, I need to open the Emulator and see the Incoming message from 10020 and get the text and assert it with expected text message.

Step 3: After validation, delete the message so that next time when we run the script, we get to validate the latest message from 10020.

Is this really doable? Please advice.

Hardly SMS will come to emulator. With real phone you have chances. With emulator you need to get sms from some other real phone or better ask for some API/DB call that gives you last SMS code by phone number.

Thanks for your response Aleksei.

As a part of Step 1: I will be triggering an SMS through an API Request only. After it triggers, I will have to grab the content of the message from the particular Short code and assert.

where is it? and what is it?