Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Add feature request board
Acho Arnold255e02bdda09
diff --git a/web/layouts/website.vue b/web/layouts/website.vueindex 48dede94..a3cbc6d7 100644--- a/web/layouts/website.vue+++ b/web/layouts/website.vue@@ -202,6 +202,18 @@</a></v-hover></li>+ <li class="mb-2">+ <v-hover v-slot="{ hover }">+ <a+ href="https://httpsms.featurebase.app"+ class="text--primary text-decoration-none"+ :class="{ 'text-decoration-underline': hover }"+ >+ Request Feature+ <v-icon small color="yellow">{{ mdiLightbulbOn50 }}</v-icon>+ </a>+ </v-hover>+ </li></ul></v-col><v-col cols="12" md="3">@@ -261,6 +273,7 @@ import {mdiTwitter,mdiHeart,mdiShieldStar,+ mdiLightbulbOn50,mdiCreation,mdiEyeOffOutline,mdiPost,@@ -287,6 +300,7 @@ export default Vue.extend({mdiPost,mdiCircle,mdiShieldStar,+ mdiLightbulbOn50,mdiBookOpenVariant,}},diff --git a/web/pages/blog/end-to-end-encryption-to-sms-messages.vue b/web/pages/blog/end-to-end-encryption-to-sms-messages.vueindex 82361133..11299584 100644--- a/web/pages/blog/end-to-end-encryption-to-sms-messages.vue+++ b/web/pages/blog/end-to-end-encryption-to-sms-messages.vue@@ -21,14 +21,17 @@except you.</p><p>- The way it works is that you set up an encryption key which you use to- encrypt your messages before making an API request to httpSMS and you- also use the same key to decrypt the messages you receive from httpSMS- via our- <a href="https://docs.httpsms.com/webhooks/introduction"+ You setup an encryption key which you use to encrypt your messages+ before making an API request to httpSMS and you also use the same key+ to decrypt the messages you receive from httpSMS via our+ <a+ class="text-decoration-none"+ href="https://docs.httpsms.com/webhooks/introduction">webhook events</a>. We are using the- <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard"+ <a+ class="text-decoration-none"+ href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES 265</a>encryption algorithm to encrypt and decrypt the messages.@@ -73,22 +76,43 @@initialization vector and encoding the payload yourself.</p><v-tabs v-model="selectedTab" show-arrows>+ <v-tab href="#javascript">+ <v-icon color="#efd81d" class="mr-1">{{+ mdiLanguageJavascript+ }}</v-icon>+ Javascript+ </v-tab><v-tab href="#go">- <v-icon color="#efd81d" class="mr-1">{{ mdiLanguageGo }}</v-icon>+ <v-icon color="#00aed8" class="mr-1">{{ mdiLanguageGo }}</v-icon>Go</v-tab></v-tabs><v-tabs-items v-model="selectedTab">+ <v-tab-item value="javascript">+ <pre v-highlight class="javascript w-full mb-n12">+<code>import HttpSms from "httpsms"++const client = new HttpSms("" /* API Key from https://httpsms.com/settings */);++const key = "Password123";++const encryptedMessage = client.cipher.encrypt(key, "This is a sample text message");++// The encrypted message looks like this, note that you will get a different encrypted message when you run this code on your computer+// Qk3XGN5+Ax38Ig01m4AqaP6Y0b0wYpCXtx59sU23uVLWUU/c7axF7LozDg==+</code>+ </pre>+ </v-tab-item><v-tab-item value="go"><pre v-highlight class="go w-full mb-n12"><code>import "github.com/NdoleStudio/httpsms-go"-client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/settings */))+client := htpsms.New(htpsms.WithAPIKey(""/* API Key from https://httpsms.com/settings */))key := "Password123" // use the same key on the Android appencryptedMessage := client.Cipher.Encrypt(key, "This is a test text message")-// The encrypted message looks like this+// The encrypted message looks like this, note that you will get a different encrypted message when you run this code on your computer// Qk3XGN5+Ax38Ig01m4AqaP6Y0b0wYpCXtx59sU23uVLWUU/c7axF7LozDg==</code></pre>@@ -103,12 +127,33 @@ encryptedMessage := client.Cipher.Encrypt(key, "This is a test text message")the Android app before sending to your recipient.</p><v-tabs v-model="selectedTab" show-arrows>+ <v-tab href="#javascript">+ <v-icon color="#efd81d" class="mr-1">{{+ mdiLanguageJavascript+ }}</v-icon>+ Javascript+ </v-tab><v-tab href="#go">- <v-icon color="#efd81d" class="mr-1">{{ mdiLanguageGo }}</v-icon>+ <v-icon color="#00aed8" class="mr-1">{{ mdiLanguageGo }}</v-icon>Go</v-tab></v-tabs><v-tabs-items v-model="selectedTab">+ <v-tab-item value="javascript">+ <pre v-highlight class="javascript w-full mb-n12">+<code>import HttpSms from "httpsms"++client.messages.postSend({+ content: encryptedMessage,+ from: '+18005550199',+ encrypted: true,+ to: '+18005550100',+})+.then((message) => {+ console.log(message.id); // log the ID of the sent message+});</code>+ </pre>+ </v-tab-item><v-tab-item value="go"><pre v-highlight class="go w-full mb-n12"><code>import "github.com/NdoleStudio/httpsms-go"@@ -149,12 +194,54 @@ client.Messages.Send(context.Background(), &httpsms.MessageSendParams{></p><v-tabs v-model="selectedTab" show-arrows>+ <v-tab href="#javascript">+ <v-icon color="#efd81d" class="mr-1">{{+ mdiLanguageJavascript+ }}</v-icon>+ Javascript+ </v-tab><v-tab href="#go">- <v-icon color="#efd81d" class="mr-1">{{ mdiLanguageGo }}</v-icon>+ <v-icon color="#00aed8" class="mr-1">{{ mdiLanguageGo }}</v-icon>Go</v-tab></v-tabs><v-tabs-items v-model="selectedTab">+ <v-tab-item value="javascript">+ <pre v-highlight class="javascript w-full mb-n12">+<code>import HttpSms from "httpsms"++const client = new HttpSms("" /* API Key from https://httpsms.com/settings */);++// The payload in the webhook HTTP request looks like this+/*+{+ "specversion": "1.0",+ "id": "8dca3b0a-446a-4a5d-8d2a-95314926c4ed",+ "source": "/v1/messages/receive",+ "type": "message.phone.received",+ "datacontenttype": "application/json",+ "time": "2024-01-21T12:27:29.1605708Z",+ "data": {+ "message_id": "0681b838-4157-44bb-a4ea-721e40ee7ca7",+ "user_id": "XtABz6zdeFMoBLoltz6SREDvRSh2",+ "owner": "+37253920216",+ "encrypted": true,+ "contact": "+37253920216",+ "timestamp": "2024-01-21T12:27:17.949Z",+ "content": "bdmZ7n6JVf/ST+SoNlSaOGUL1DcL5705ETw8GAB4llYBgE9HOOL+Pu/h+w==",+ "sim": "SIM1"+ }+}+*/++const encryptedMessage = "bdmZ7n6JVf/ST+SoNlSaOGUL1DcL5705ETw8GAB4llYBgE9HOOL+Pu/h+w==" // get the encrypted message from the request payload+const encryptionkey = "Password123" // use the same key on the Android app+const decryptedMessage = client.cipher.decrypt(encryptionkey, encryptedMessage)++// This is a test text message+</code>+ </pre>+ </v-tab-item><v-tab-item value="go"><pre v-highlight class="go w-full mb-n12"><code>import "github.com/NdoleStudio/httpsms-go"@@ -184,8 +271,8 @@ client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/setti*/encryptedMessage = "bdmZ7n6JVf/ST+SoNlSaOGUL1DcL5705ETw8GAB4llYBgE9HOOL+Pu/h+w==" // get the encrypted message from the request payload-key := "Password123" // use the same key on the Android app-decryptedMessage := client.Cipher.Decrypt(key, encryptedMessage)+encryptionkey := "Password123" // use the same key on the Android app+decryptedMessage := client.Cipher.Decrypt(encryptionkey, encryptedMessage)// This is a test text message</code>@@ -213,7 +300,7 @@ decryptedMessage := client.Cipher.Decrypt(key, encryptedMessage)</template><script lang="ts">-import { mdiLanguageGo, mdiTwitter } from '@mdi/js'+import { mdiLanguageGo, mdiTwitter, mdiLanguageJavascript } from '@mdi/js'export default {name: 'EndToEndEncryptionToSmsMessages',layout: 'website',@@ -221,7 +308,8 @@ export default {return {mdiTwitter,mdiLanguageGo,- selectedTab: 'go',+ mdiLanguageJavascript,+ selectedTab: 'javascript',authorImage: require('@/assets/img/arnold.png'),authorName: 'Acho Arnold',postDate: 'January 21, 2024',@@ -244,7 +332,7 @@ export default {hid: 'og:description',property: 'og:description',content:- 'Configure your Android phone as an SMS gateway to automate sending text messages with the Python programing language.',+ 'We have added support for end-to-end encryption for SMS messages so that no one can see the content of the messages you send using httpSMS except you.',},],}diff --git a/web/pages/index.vue b/web/pages/index.vueindex a93b8590..b18d1a66 100644--- a/web/pages/index.vue+++ b/web/pages/index.vue@@ -21,8 +21,9 @@Convert your Android phone into an SMS gateway.</h1><h2 class="text--secondary text-h5 mt-8 mb-8">- <b>Save money</b> by using your phone to send and receive SMS- messages via a simple programmable API with end-to-end encryption.+ <span class="gradient-underline">Save money</span> by using your+ phone to send and receive SMS messages via a simple programmable API+ with end-to-end encryption.</h2><div :class="{ 'text-center': $vuetify.breakpoint.mdAndDown }"><v-btn@@ -260,11 +261,17 @@feature. Safeguard your messages from prying eyes, ensuringabsolute confidentiality using the military grade<a+ class="text-decoration-none"href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES-256 encryption</a>algorithm.</h5>+ <v-btn+ to="/blog/end-to-end-encryption-to-sms-messages"+ class="primary"+ >Setup end-to-end encryption</v-btn+ ></div></v-col><v-col cols="12" md="6" :order-lg="1">@@ -395,23 +402,18 @@<v-tabs-items v-model="selectedTab"><v-tab-item value="javascript"><pre v-highlight class="javascript w-full mt-n2 mb-n13">-<code>let apiKey = "Get API Key from https://httpsms.com/settings";+<code>import HttpSms from 'httpsms'++const client = new HttpSms('' /* Get the API Key from https://httpsms.com/settings */);-fetch('https://api.httpsms.com/v1/messages/send', {- method: 'POST',- headers: {- 'x-api-key': apiKey,- 'Accept': 'application/json',- 'Content-Type': 'application/json'- },- body: JSON.stringify({- "content": "This is a sample text message",- "from": "+18005550199",- "to": "+18005550100"- })+client.messages.postSend({+ content: 'This is a sample text message',+ from: '+18005550199', // Put the correct phone number here+ to: '+18005550100', // Put the correct phone number here+})+.then((message) => {+ console.log(message.id); // log the ID of the sent message})-.then(res => res.json())-.then((data) => console.log(data));</code></pre></v-tab-item>@@ -611,7 +613,7 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());<v-icon color="primary" class="mt-n1" left>{{mdiCheckCircle}}</v-icon- >Forward received messages to your server+ >Forward received messages via webhook</p><p class="subtitle-1 mt-n4"><v-icon color="primary" class="mt-n1" left>{{@@ -660,13 +662,13 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());<v-icon color="primary" class="mt-n1" left>{{mdiCheckCircle}}</v-icon- >Forward received messages to your server+ >Forward received messages via webhook</p><p class="subtitle-1 mt-n4"><v-icon color="primary" class="mt-n1" left>{{mdiCheckCircle}}</v-icon- >Priority email support+ >Priority support</p></v-card-text></v-card>@@ -708,13 +710,13 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());<v-icon color="primary" class="mt-n1" left>{{mdiCheckCircle}}</v-icon- >Forward received messages to your server+ >Forward received messages via webhook</p><p class="subtitle-1 mt-n4"><v-icon color="primary" class="mt-n1" left>{{mdiCheckCircle}}</v-icon- >Priority email support+ >Priority support</p></v-card-text></v-card>@@ -858,15 +860,6 @@ export default Vue.extend({substackLoaded: false,}},- mounted() {- setTimeout(() => {- const s = document.createElement('script')- s.type = 'text/javascript'- s.src = 'https://substackapi.com/widget.js'- document.getElementsByTagName('head')[0].appendChild(s)- this.substackLoaded = true- }, 5000)- },})</script>@@ -890,4 +883,8 @@ export default Vue.extend({-webkit-background-clip: text;-webkit-text-fill-color: transparent;}++.gradient-underline {+ color: white;+}</style>