Wordpress templates are PHP files. So you just have to write the API requests. The request looks like a an HTTP GET, so you can try using the regular filesystem functions if your server allows it
if you want to run it independently, you can just make a PHP file with a file_get_contents statement to your API URL in it and upload it to a server with PHP enabled. If you want to integrate it into Wordpress, you have to find a point where PHP is executed and proceed the same way.
did you test it? does it work? do you get any errors? do you get the expected output? do you get a sms? as i do not know what a valid result of this action may be, it’s up to you answering this.
As this isn’t a school project, so you’re not required to do this, might I suggest you stop trying to run before you can walk and take time to learn things properly. Work on HTML and CSS until you are comfortable with those, then move on to the basics of PHP and / or JavaScript. Continually trying to make things work using copied code you don’t understand will, in the end, take longer and teach you less than if you put some time into learning the basics.