The first service url is “https://api.txtlocal.com/send/”, so you should use the fetch API to send a request to that url, with the data that they specify in the documentation.
In order to send data in various ways, add request headers (needed in the second service) etc. you can read the following article which explains more about how to use the fetch API:
fetch API
Also, if the SMS service documentation is not clear to you, I would maybe contact them and ask for examples in JavaScript (I didn’t see any listed in their docs).