How to call SMS gateway for Android API

rwb4 years ago

Installed SMS Gateway on my phone and can get http://192.168.42.129:8082/ up in me browser which says to POST some JSON to the same URL.

However:

$ wget http://192.168.42.129:8082 --post-data='{"to":"+447950...", "message": "Test from wget."}'
--2020-11-01 12:24:38--  http://192.168.42.129:8082/
Connecting to 192.168.42.129:8082... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.
$

How do I get it to work? Is there any documentation?

Anton Tananaev4 years ago

You have to pass the API key.

rwb4 years ago

How?

Anton Tananaev4 years ago

You have to pass it in the authorization header.

rwb4 years ago

After a couple of guesses this has got it:

$ wget http://192.168.42.129:8082 --post-data='{"to":"+447950...", "message": "wget"}' --header "Authorization: fd1176dc"

where the header value is from the Android app.

henry beltran4 years ago

The API key it is in the app, be sure are installed the last version