Skip to content

Latest commit

 

History

History
110 lines (74 loc) · 5.09 KB

File metadata and controls

110 lines (74 loc) · 5.09 KB

Telnyx.net MMS and SMS Getting Started

Telnyx

Sample application demonstrating Telnyx.net SMS and MMS attachments

Documentation & Tutorial

The full documentation and tutorial is available on developers.telnyx.com

Pre-Reqs

You will need to set up:

What you can do

  • Send an SMS or MMS and recieve a copy of the attachments back to your phone number
  • Upload a file to AWS S3
  • Send those file as an MMS via Telnyx

Usage

The following environmental variables need to be set

Variable Description
TELNYX_API_KEY Your Telnyx API Key
TELNYX_PUBLIC_KEY Your Telnyx Public Key
TELNYX_APP_PORT Defaults to 8000 The port the app will be served
AWS_PROFILE Your AWS profile as set in ~/.aws
AWS_REGION The region of your S3 bucket
TELNYX_MMS_S3_BUCKET The name of the bucket to upload the media attachments

.env file

This app uses the excellent dotenv.net package to manage environment variables.

Make a copy of .env.sample and save as .env and update the variables to match your creds.

TELNYX_API_KEY=
TELNYX_PUBLIC_KEY=
TENYX_APP_PORT=8000
AWS_PROFILE=
AWS_REGION=
TELNYX_MMS_S3_BUCKET=

Callback URLs For Telnyx Applications

Callback Type URL
Inbound Message Callback {ngrok-url}/messaging/inbound
Outbound Message Status Callback {ngrok-url}/messaging/outbound

Install

Run the following commands to get started

$ git clone https://github.com/team-telnyx/demo-dotnet-telnyx.git

Ngrok

This application is served on the port defined in the runtime environment (or in the .env file). Be sure to launch ngrok for that port

./ngrok http 8000

Terminal should look something like

ngrok by @inconshreveable                                                                                                                               (Ctrl+C to quit)

Session Status                online
Account                       Little Bobby Tables (Plan: Free)
Version                       2.3.35
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://your-url.ngrok.io -> http://localhost:8000
Forwarding                    https://your-url.ngrok.io -> http://localhost:8000

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00

At this point you can point your application to generated ngrok URL + path (Example: http://{your-url}.ngrok.io/messaging/inbound).

Run

Open your IDE and run the application

API Docs

Next Steps