Adding SMS and voice to
your application
or service should be easy

Experience how easy it can be...

Our API makes it easy for you to add custom telephony features that are perfectly suited to the way you do things – because let’s face it, sometimes ‘off the shelf’ just doesn't cut it.

Sample code for our API

POST https://<API-Username>:<API-Password>@api.46elks.com/a1/SMS
application/x-www-form-urlencoded
from=+46766861234
to=+46723175800
message='Hi! This is a message from me! Have a nice day!'
  
POST https://<API-Username>:<API-Password>@api.46elks.com/a1/Calls
application/x-www-form-urlencoded
from=+46766861234
to=+46723175800
voice_start={"connect":"+46340890510"}
  
{
  "ivr": "http://myserver.se/welcome.wav",
  "1": {
    "play": "http://myserver.se/info.wav"
  },
  "2": {
    {
    "play": "http://myserver.se/entervoicemail.wav",
    "next": {
      "record": "http://myserver.se/newvoicemail"
    }
  }
  "3": {
    "ivr": "http://myserver.se/enterpin.wav",
    "digits": 5,
    "next": "http://myserver.se/usercode"
  }
  "4": {
    "connect": "+46723175800"
  }
}
curl -X POST \
  -u <API-Username>:<API-Password> \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'from=VILLE' \
  -d 'to=+358503672181' \
  -d 'message=Test Message To your phone.' \
  'https://api.46elks.com/a1/SMS'
curl -X POST \
  -u <API-Username>:<API-Password> \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'from=+46766861234' \
  -d 'to=+46723175800' \
  -d 'voice_start={"connect":"+46340890510"}' \
  'https://api.46elks.com/a1/Calls'
{
  "ivr": "http://myserver.se/welcome.wav",
  "1": {
    "play": "http://myserver.se/info.wav"
  },
  "2": {
    {
    "play": "http://myserver.se/entervoicemail.wav",
    "next": {
      "record": "http://myserver.se/newvoicemail"
    }
  }
  "3": {
    "ivr": "http://myserver.se/enterpin.wav",
    "digits": 5,
    "next": "http://myserver.se/usercode"
  }
  "4": {
    "connect": "+46723175800"
  }
}
<?php
  
$url = 'https://api.46elks.com/a1/SMS';
$username = '<API-Username>';
$password = '<API-Password>';
$sms = array('from' => 'DummyFrom',
             'to' => '+46709751949',
             'message' => 'Hello hello!');
            
$context = stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header'  => "Authorization: Basic ".
            base64_encode($username.':'.$password). "\r\n".
            "Content-type: application/x-www-form-urlencoded\r\n",
        'content' => http_build_query($sms),
        'timeout' => 10
        )
    ));

$response = file_get_contents($url, false, $context);
print $response;

?>
<?php

$url = 'https://api.46elks.com/a1/Calls';
$username = '<API-Username>';
$password = '<API-Password>';
$call = array('from' => '+46709751949',
             'to' => '+46709751949',
             'voice_start' => '{"connect":"+461890510"}');
            
$context = stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header'  => "Authorization: Basic ".
            base64_encode($username.':'.$password). "\r\n".
            "Content-type: application/x-www-form-urlencoded\r\n",
        'content' => http_build_query($call),
        'timeout' => 10
        )
    ));

$response = file_get_contents($url, false, $context );
print $response;

?>
{
  "ivr": "http://myserver.se/welcome.wav",
  "1": {
    "play": "http://myserver.se/info.wav"
  },
  "2": {
    {
    "play": "http://myserver.se/entervoicemail.wav",
    "next": {
      "record": "http://myserver.se/newvoicemail"
    }
  }
  "3": {
    "ivr": "http://myserver.se/enterpin.wav",
    "digits": 5,
    "next": "http://myserver.se/usercode"
  }
  "4": {
    "connect": "+46723175800"
  }
}
import requests

auth = (
    '<API-Username>',
    '<API-Password>'
    )

fields = {
    'from': 'Hello',
    'to': '+46723175800',
    'message': 'Test Message To your phone.'
    }

response = requests.post(
    "https://api.46elks.com/a1/SMS",
    data=fields,
    auth=auth
    )

print(response.text)
import requests

auth = (
    '<API-Username>',
    '<API-Password>'
    )

fields = {
    'from': '+46766861234',
    'to': '+46723175800',
    'voice_start': '{"connect":"+461890510"}'
    }

response = requests.post(
    "https://api.46elks.com/a1/Call",
    data=fields,
    auth=auth
    )

print(response.text)
{
  "ivr": "http://myserver.se/welcome.wav",
  "1": {
    "play": "http://myserver.se/info.wav"
  },
  "2": {
    {
    "play": "http://myserver.se/entervoicemail.wav",
    "next": {
      "record": "http://myserver.se/newvoicemail"
    }
  }
  "3": {
    "ivr": "http://myserver.se/enterpin.wav",
    "digits": 5,
    "next": "http://myserver.se/usercode"
  }
  "4": {
    "connect": "+46723175800"
  }
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace elktest {
  class Program {
    public static string user = "<API-Username>";
    public static string pwd = "<API-Password>";
    private static HttpClient client;
    static void Main(string[] args)
    {
      Task.Run(async() = > {
        using(client = new HttpClient()) {
          client.BaseAddress = new Uri("https://api.46elks.com");

          client.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue(
              "Basic",
              Convert.ToBase64String(
                System.Text.ASCIIEncoding.ASCII.GetBytes(
                  string.Format("{0}:{1}", user, pwd))));

          var content = new FormUrlEncodedContent(new[] {
            new KeyValuePair < string, string > ("from", "ElkTest"),
            new KeyValuePair < string, string > (
              "to", "+46735417172"),
            new KeyValuePair < string, string > (
              "message",
              "Test 😊 message to you!"),
          });

          HttpResponseMessage response = await client
            .PostAsync("/a1/SMS", content);
          response.EnsureSuccessStatusCode();
          var result = await response.Content.ReadAsStringAsync();
        }
      }).Wait();
    }
  }
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace elktest {
  class Program {
    public static string user = "<API-Username>";
    public static string pwd = "<API-Password>";
    private static HttpClient client;
    static void Main(string[] args)
    {
      Task.Run(async() = > {
        using(client = new HttpClient()) {
          client.BaseAddress = new Uri("https://api.46elks.com");

          client.DefaultRequestHeaders.Authorization = 
            new AuthenticationHeaderValue(
              "Basic",
              Convert.ToBase64String(
                System.Text.ASCIIEncoding.ASCII.GetBytes(
                  string.Format("{0}:{1}", user, pwd))));

          var content = new FormUrlEncodedContent(new[] {
            new KeyValuePair < string, string > ("from", "ElkTest"),
            new KeyValuePair < string, string > (
              "to", "+46735417172"),
            new KeyValuePair < string, string > (
              "voice_start",
              '{"connect":"+461890510"}'),
          });

          HttpResponseMessage response = await client
            .PostAsync("/a1/Calls", content);
          response.EnsureSuccessStatusCode();
          var result = await response.Content.ReadAsStringAsync();
        }
      }).Wait();
    }
  }
}
{
  "ivr": "http://myserver.se/welcome.wav",
  "1": {
    "play": "http://myserver.se/info.wav"
  },
  "2": {
    {
    "play": "http://myserver.se/entervoicemail.wav",
    "next": {
      "record": "http://myserver.se/newvoicemail"
    }
  }
  "3": {
    "ivr": "http://myserver.se/enterpin.wav",
    "digits": 5,
    "next": "http://myserver.se/usercode"
  }
  "4": {
    "connect": "+46723175800"
  }
}
Show me the api documentation

Checkout these examples of what others have done with our API

We do local globally

We have global aspirations, but our focus lies at being able to collaborate with developers at grass roots level, offering you services like billing in local currency and support that you can count on.

Select your country to learn more about
what is available in your region.

world map - 46elks available globally

Adding voice and SMS to your application is easy Create your account