Compatibility Libraries and SDKs
SignalWire has clients in a number of different languages that make using the SignalWire Compatibility API possible with your existing application. They are also built to make migrating from other service providers to SignalWire quick and easy.
The Compatibility SDK has two primary components:
-
REST Client: The REST client is used to make API calls for initiating outbound calls and messages, managing phone numbers, retrieving call logs, and other operations. See the REST API documentation for the complete API reference.
-
cXML Builders: The cXML builders do not make API calls directly. Instead, they are helper libraries that enable you to easily generate cXML responses within your language of choice. The SDK provides three response builders for the different channel types:
VoiceResponse— Build XML for handling voice callsMessagingResponse— Build XML for handling SMS/MMS messagesFaxResponse— Build XML for handling faxes
See the cXML Specification for technical reference on the XML format and available verbs.
Getting started with the SDKs
Node.js
Python
Ruby
C#
Installing the SDK
Install the package using NPM:
Initializing the Client
In order to use the NodeJS client, you must get your Space URL, Project ID, and API Token
from your SignalWire Dashboard and initialize the client:
Using Environment Variables
Alternatively, you can use an environment variable to pass the Space URL:
With this approach, signalwireSpaceUrl will be pulled from the .env file instead of having to be passed as an argument:
Migrating from Twilio
You can easily migrate from Twilio with minimal changes.
To get started, you will need to replace the Twilio client with the SignalWire client and update the from number
to a valid SignalWire number.
Make sure to change the 'From' number!
When migrating to SignalWire, make sure to replace the from numbers with a valid SignalWire number.