Coder Social home page Coder Social logo

iezed / restsms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xcreen/restsms

0.0 0.0 0.0 548 KB

RestSMS starting a Rest-API-Service on your Android-Device for sending SMS

Home Page: http://xcreen.dev

License: MIT License

Java 1.97% Kotlin 98.03%

restsms's Introduction

RestSMS

The RestSMS-App allows you to send SMS via Webservice from your Android-Device.

Architecture

Requirements:

  • Android Version 6.0 or higher
  • Android-Device which is able to send SMS

Android-Limit:

Android´s default SMS-Limit are 30 SMS to a single phonenumber within 30 minutes.
You can change your SMS-Limit for your device (root-permission is not required).

How to change Android-Limit:

  1. Make sure you have enabled USB-Debugging on your device and you are ready to use ADB.
  2. Connect your device to the pc and open the terminal.
  3. Open the adb-shell via the command: adb shell
  4. Change the value of the SMS-Limit to the number of SMS you want to send within the 30 minutes timeframe. Via the command:
    settings put global sms_outgoing_check_max_count 100
    This command allows you to send 100 SMS to a phonenumber within the 30 minutes timeframe.
  5. If you want to also change the timeframe, you can use the command:
    settings put global sms_outgoing_check_interval_ms 900000
    This command reduces the timeframe to 15 minutes.
    If you entered both commands, you would be able to send 100 SMS to a phonenumber within 15 minutes.

API-Usage

The default server-url is http://127.0.0.1:8080/.
You can change the port in the settings-menu. The ip can be changed via the public network address, so you can access the api from anywhere.
To send a SMS you can point to your address and use the /send-Endpoint (eg. http://127.0.0.1:8080/send).
You have to send phoneno and message and if you enable authentication also token as post-parameter (you can use form-data and also x-www-form-urlencoded).
A response you get a JSON with a success and a message variable.

Example Curl (x-www-form-urlencoded)

message = "Hello World"
phoneno = "+4915100000000"
token = "123"

curl -X POST http://127.0.0.1:8080/send -H 'Cache-Control: no-cache' -H 'Content-Type: application/x-www-form-urlencoded' -d 'message=Hello%20World&phoneno=%2B4915100000000&token=123'

Successful Response

{
    "success": true
}

⚠️ That means the SMS got forwarded to your default SMS-App (packagename can be found under App-Information). The SMS still can get stuck in your default SMS-App. For example on a Emulator, you will get success = true, but the default SMS-App cant send the SMS, because the SIM-Card is just emulated. So success = true, does not mean that the SMS was already successful sent.

Failed Response

{
    "message": "message or phoneno parameter are missing!",
    "success": false
}

The message variable holds the error-message, so you can adjust your request.

restsms's People

Contributors

abolfazlsamini avatar keczejo avatar xcreen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.