# Ignition Edge and Twilio

**URL:** <https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [November 11, 2024, 3:20pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469 "2024-11-11T15:20:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arlen\_Irvin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@Arlen\_Irvin](https://forum.inductiveautomation.com/u/Arlen_Irvin)\
**Post date:** [November 11, 2024, 3:20pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/1 "2024-11-11T15:20:48Z")

</div>

I'm using Ignition edge, has anyone successfully sent text messages using "system.net.httpPost"

---

<div class="post-metadata">

**Author:** ![Arlen\_Irvin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@Arlen\_Irvin](https://forum.inductiveautomation.com/u/Arlen_Irvin)\
**Post date:** [November 13, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/2 "2024-11-13T17:03:08Z")

</div>

Crickets??

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 13, 2024, 5:05pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/3 "2024-11-13T17:05:47Z")

</div>

The silence could mean that nobody has tried to manually interact with Twilio via `system.net.http*` methods.

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [November 13, 2024, 8:55pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/4 "2024-11-13T20:55:20Z")

</div>

I haven't interacted with Twilio using `system.net.http*` methods but I do use Twilio in one of my projects.

FWIW it should definitely work. Twilio offers an API specifically for this.

I know this is not Jython, but asking the AI assistant on the Twilio website yields the following result in python:

```python
import requests
from requests.auth import HTTPBasicAuth

# Your Account SID and Auth Token
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# The URL for the Twilio API endpoint
url = 'https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json'.format(account_sid)

# The data payload for the request
data = {
    'From': '+15017250604', # Twilio phone number
    'To': '+15558675309', # Destination phone number
    'Body': 'Hello, this is a test message!'
}

# Make the POST request
response = requests.post(url, data=data, auth=HTTPBasicAuth(account_sid, auth_token))

# Check the response
print(response.status_code)
print(response.json())

```

You'd just have to replace the requests.post part with `system.net.httpPost` (although @paul-griffith might recommend using `system.net.httpClient` then use the post method from what I've read recently) and format your payload accordingly (probably the HTTPBasicAuth part too, you'll have to experiment).

Some more related documentation here:

> **[How to Use Our REST APIs | Twilio](https://www.twilio.com/docs/usage/api)**
>
> Twilio’s REST APIs power a robust platform for programmatically adding communications to your applications. Learn about Twilio’s API authentication, webhooks, see the SMS API in action and explore Twilio’s API offerings.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 13, 2024, 11:00pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/5 "2024-11-13T23:00:25Z")

</div>

`system.net.httpClient` is a near drop in replacement for `requests`; the API was pretty directly inspired by it:

```python
# Your Account SID and Auth Token
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# The URL for the Twilio API endpoint
url = 'https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json'.format(account_sid)

# The data payload for the request
data = {
    'From': '+15017250604', # Twilio phone number
    'To': '+15558675309', # Destination phone number
    'Body': 'Hello, this is a test message!'
}

# Make the POST request
client = system.net.httpClient()
response = client.post(url, data=data, username=account_sid, password=auth_token)

# Check the response
print response.statusCode
print response.json

```

---

<div class="post-metadata">

**Author:** ![Arlen\_Irvin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@Arlen\_Irvin](https://forum.inductiveautomation.com/u/Arlen_Irvin)\
**Post date:** [November 14, 2024, 3:43pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/6 "2024-11-14T15:43:01Z")

</div>

I think my issue may be related to government regulations. I found somewhere that 1 Jan 2024 a 'requirement' to have the sending number verified as toll free. I am pretty sure that includes the one issued by Twilio. (correct me if I'm wrong) I've tried that httpClient() method six ways to Sunday and keep getting the same "[https://www.twilio.com/docs/errors/21604](https://www.twilio.com/docs/errors/21604)". I realize this says the "To" number is missing but all evidence to the contrary. Printing the 'data' shows correctly formatted "To" number. So my struggle continues.

The responses are much appreciated. I'll post if and when I find my problem.

---

<div class="post-metadata">

**Author:** ![hhbauss](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hhbauss](https://forum.inductiveautomation.com/u/hhbauss)\
**Post date:** [December 9, 2024, 3:46pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/7 "2024-12-09T15:46:43Z")

</div>

Have you been able to successfully get your account verified since their new verification? I am having a nightmare time getting any support to even get an account verified to even try sending a test message.

---

<div class="post-metadata">

**Author:** ![dgary](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@dgary](https://forum.inductiveautomation.com/u/dgary)\
**Post date:** [May 28, 2026, 1:42pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-and-twilio/98469/8 "2026-05-28T13:42:27Z")

</div>

Tried this and keep getting code: 21604L and 400 with message 'To' phone number is required. Used this code exactly (change phone numbers and account sid and auth token. Machine and network should be ok as a python script works.
