SignalWire Developer’s Portal

Integrate SignalWire in your Instance

# Sending an SMS

curl "https://$SPACE.signalwire.com/api/laml/2010-04-01/Accounts/$PROJECT_ID/Messages" \
  -X POST \
  -u "$PROJECT_ID:$API_TOKEN" \
  --data-urlencode "From=+15559825061" \
  --data-urlencode "To=+15559446570" \
  --data-urlencode 'Body=Hello'
import { RestClient } from "@signalwire/compatibility-api";
const client = RestClient(
  PROJECT_ID,
  API_TOKEN,
  { signalwireSpaceUrl: SPACE_URL }
);

// Sending an SMS
client.messages
  .create({ from: "+15559825061", to: "+15559446570", body: "Hello" })
  .then((message) => console.log(message.sid))
  .done();
from signalwire.rest import Client as signalwire_client

client = signalwire_client(PROJECT_ID, API_TOKEN, signalwire_space_url = SPACE_URL)

message = client.messages.create(
  from_="+15559825061",
  to="+15559446570",
  body='Hello'
)

print(message.sid)
<?php
use SignalWire\Rest\Client;

$client = new Client($PROJECT_ID, $API_TOKEN, array("signalwireSpaceUrl" => $SPACE_URL));

$message = $client->messages
    ->create("+15559446570", array(
		"from" => "+15559825061",
		"body" => "Hello"
	));

print($message->sid);

Our Products

Learn how to get started with tailored guides and examples.

  • Voice

    Dial phone numbers or answer phone calls

  • Messaging

    Send and receive SMSs

  • Video

    Fully customizable audio/video conferencing apps

  • Chat

    Provide seamless chat functionality to the browser

  • SWML

    SignalWire Markup Language

  • AI

    Incorporate AI functionality in minutes

Our APIs and SDKs

Go straight to the technical reference you are looking for.

Compatibility APIs (REST, XML)

Ease the transition from other providers using a familiar and compatible interface. Use the REST interface for handling phone numbers, messages, faxes, recordings, and more. Or, use the XML interface for programming how your phone numbers should answer phone calls or messages.

curl --request GET \
     --url https://example.signalwire.com/api/laml/2010-04-01/Accounts/{id}/Calls \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic dGVzdDp0ZXN0'
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Welcome to SignalWire!</Say>
</Response>

RELAY REST APIs

Use our RELAY REST APIs to create, list, update, or delete your SignalWire Resources (video rooms, phone numbers, access tokens, etc).

curl --request GET \
     --url https://example.signalwire.com/api/video/rooms \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic ZGVtbzpkZW1v'
const fetch = require('node-fetch');  // npm install node-fetch --save

const url = 'https://example.signalwire.com/api/video/rooms';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', Authorization: 'Basic ZGVtbzpkZW1v'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

RELAY Browser SDK

The RELAY Browser SDK transforms your standard browser into a realtime media engine, enabling developers to directly make audio and video calls to other browsers.

const roomSession = new SignalWire.Video.RoomSession({
  token: '<YourJWT>',
  rootElement: document.getElementById('myRoot') // an html element to display the video
})

try {
  await roomSession.join();
} catch (error) {
  console.error('Error', error)
}
const roomSession = new SignalWire.Video.RoomSession({
  token: '<YourJWT>',
  rootElement: document.getElementById('myRoot') // an html element to display the video
})

roomSession.join().then(() => {
  // Use roomSession ...
}).catch(error => {
  console.error('Error', error)
})

RELAY Realtime SDK

Use the RELAY Realtime SDK to receive events from resources (phone calls, video rooms, chat channels) and control them server-side (mute users, start recordings, change layouts, transfer calls, etc).

import { Video } from '@signalwire/realtime-api'

const video = new Video.Client({
  project: '<project-id>',
  token: '<project-token>'
})

video.on('room.started', (roomSession) => {
  console.log("Room started")

  roomSession.on('member.joined', (member) => {
    console.log(member)
  })
});

RELAY SDKs

You can use our RELAY technology from a large number of SDKs, each for a different programming language. Not using JavaScript? Explore our SDKs for .NET, Go, Ruby, Python, PHP, and other languages.

using SignalWire.Relay;
using SignalWire.Relay.Calling;
using System;
using System.Collections.Generic;

namespace Example
{
    class ExampleConsumer : Consumer
    {
        protected override void Setup()
        {
            Project = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
            Token = "PTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
            Contexts = new List<string> { "test" };
        }

        protected override void OnIncomingCall(Call call)
        {
            AnswerResult resultAnswer = call.Answer();
            if (!resultAnswer.Successful) return;

            call.PlayTTS("Welcome to SignalWire!");

            call.Hangup();
        }
    }

    class Program
    {
        public static void Main()
        {
            new ExampleConsumer().Run();
        }
    }
}
require "signalwire"

class MyConsumer < Signalwire::Relay::Consumer
  contexts ['incoming']

  def on_incoming_call(call)
    call.answer
    call.play_tts 'the quick brown fox jumps over the lazy dog'
    call.hangup
  end
end

MyConsumer.new.run

from signalwire.relay.consumer import Consumer

class CustomConsumer(Consumer):
  def setup(self):
    self.project = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    self.token = 'PTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
    self.contexts = ['home', 'office']

  async def ready(self):
    # Consumer is successfully connected with Relay.
    # You can make calls or send messages here..

  async def on_incoming_call(self, call):
    result = await call.answer()
    if result.successful:
      print('Call answered..')

# Run your consumer..
consumer = CustomConsumer()
consumer.run()
<?php

require dirname(__FILE__) . '/vendor/autoload.php';

use Generator as Coroutine;
use SignalWire\Relay\Consumer;

class CustomConsumer extends Consumer {
  public $project = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX';
  public $token = 'PTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  public $contexts = ['home', 'office'];

  public function ready(): Coroutine {
    yield;
    // Consumer is successfully connected with Relay.
    // You can make calls or send messages here..
  }

  public function onIncomingCall($call): Coroutine {
    $result = yield $call->answer();
    if ($result->isSuccessful()) {
      yield $call->playTTS(['text' => 'Welcome to SignalWire!']);
    }
  }
}

$consumer = new CustomConsumer();
$consumer->run();

What would you like to build today?

  • Two Factor Authentication

    This guide will show you how to implement basic two factor authentication via a voice call.

  • Embed video on your website

    Learn the basics of SignalWire Video APIs with this JavaScript-based sample web-app.

  • Send SMS from the Browser

    Use Node.js to create a web application that allows you to send SMS from the browser.

Join us!

Find the answers you’re looking for in our community

  • Slack Community

    +5k Users

    Join
  • GitHub Organization

    +50 Repositories

    Join