Send a text message with an HTTP request!


(Support United States and Canada Carriers)

Command Line:


    $ curl -X POST http://freetxtapi.com \
      --data-urlencode phone='5557727420' \
      --data-urlencode message='Hello world' \
  

Python:


    import requests
    requests.post('https://freetxtapi.com', {
      'phone': '5557727420',
      'message': 'Hello world'
    })
  

Ruby:


    require 'net/http'
    require 'uri'

    uri = URI.parse("https://freetxtapi.com")
    Net::HTTP.post_form(uri, {
      :phone => '5557727420',
      :message => 'Hello world'
    })
  

Javascript:


    var request = require('request');
    request('https://freetxtapi.com', {
      body: {
        phone: '5557727420',
        message: 'Hello world'
      },
    })
  

C#:


    var response = Http.Post("https://freetxtapi.com", new NameValueCollection() {
      { "phone", "5557727420" },
      { "message", "Hello world" }
    });
  

PHP:


    $ch = curl_init('https://freetxtapi.com');
    $data = array(
      'phone': '5557727420',
      'message': 'Hello world'
    );

    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);
  

Java:


    Request.Post("https://freetxtapi.com").bodyForm(Form.form()
      .add("phone", "5557727420")
      .add("message", "Hello world")
      .build())
      .execute().returnContent();
  

Status Response


    {"status":"WAITING OPT-IN"}
    {"status":"LIMIT REACHED"}
    {"status":"FAILED"}
    {"status":"DELIVERED"}