Forward SMS To A URL or API

api to forward sms to URL

NOTICE: Google has decided to remove all apps which contain automatic SMS forwarding to another phone number. So we are removing that feature.

GOOD NEWS:
This WILL NOT affect the POST functions on this current app, but Google has removed our app from Playstore.


But we are launching a vastly improved Auto Fwd SMS PRO app with better code and better reporting.
The NEW Auto Forward SMS app should be ready early March. This will be a monthly subscription (around 70-99 cents per month. Cheap!).
But if you already have the app installed, please continue to use the app for as long as you can.
If you have any questions, please email us: support@autoforwardsms.com

NEW CUSTOMERS: We can let you know when the NEW app with Fwd To Email & Fwd to URL is ready (no obligation). Simply add your email to the form below:




..and in the meantime, please continue to read on for info about the POST function...


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


raw JSON

When you select "Raw", the body will be pre-generated as below:
data:{
phoneNumber: [PHONE_NUMBER],
sms: [SMS_CONTENT]
}

You can include any key-value you want. As long as Auto Forward SMS finds the [PHONE_NUMBER], it will be replaced by the sender's phone number. Similar to that, [SMS_CONTENT] will be replaced with the SMS message content.


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