Forward SMS To A URL or API

api to forward sms to URL

POST URL function

Post Body example:

{"phoneNumber":"222333444","sms":"Hello sms - From 222333444"}

Post Options:

Auto Forward SMS app offers you 3 options for forwarding incoming SMS to a URL via POST: form-data or x-www-form-urlencoded or raw (JSON) .

Both the FWD ALL INCOMING SMS and CREATE TASK screens have this function.

form-data

For multipart/form-data, the body is separated by a particular string boundary.

A form using form-data content type:
HttpResponse response = Unirest.post("http://ptsv2.com/t/1x8ve-1542263550/post")
.header("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
.header("cache-control", "no-cache")
.header("Postman-Token", "5d3c2fb9-7113-4e2a-b9ad-319ce66ef60a")
.body("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"phoneNumber\"\r\n\r\nxxxxxx\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"sms\"\r\n\r\nzzzzzzz\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--")
.asString();


x-www-form-urlencoded

For x-www-form-urlencoded, the body of the HTTP message is sent as a long query string, contains name-value pair separated by "&" character.

An example of a simple form using the application/x-www-form-urlencoded content type:
HttpResponse response = Unirest.post("http://ptsv2.com/t/1x8ve-1542263550/post")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("cache-control", "no-cache")
.header("Postman-Token", "0146a6af-b9da-429d-b2e2-68e70137fbbc")
.body("phoneNumber=zzzzzzz&sms=xxxxxxx%20")
.asString();

Useful info: Stack Overflow has info about these functions and what they mean. Click here to view Stack Overflow page


api to forward sms to URL

raw JSON

Add application/json to content type.

If content has [PHONE_NUMBER] sent data should have phone number of sender.

If content has [SMS_CONTENT] sent data should have SMS content message.








We want to further develop this feature, so if you have any special requests or need a different function, please get in touch with our manager Kerryn.

Our Contact Details

Our head office is in Australia, and our office hours are Melbourne time: 9am-6pm Monday to Friday. But we do monitor emails regularly.

support@autoforwardsms.com