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

Experience how neat 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

curl -X POST \
-u <API-Username>:<API-Password> \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'from=TheSender' \
-d 'to=+46723175800' \
-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'
import requests

# Your 46elks credentials
# You can find these in the dashboard after creating an account
API_USERNAME = "username"
API_PASSWORD = "password"

# Make a request to the 46elks API
response = requests.post(
    "https://api.46elks.com/a1/SMS",
    auth = (API_USERNAME, API_PASSWORD),
    data = {
        "from": "Hello",
        "to": "+46723175800",
        "message": "Test Message To your phone."
    }
)

# Check that the request was succesful
if response.status_code == requests.codes.ok:
    print("Sent! The API responded:")
    print(response.text)
else:
    # Error handling code...
    print("Error: %s" % response.text)
import requests

# Your 46elks credentials
# You can find these in the dashboard after creating an account
API_USERNAME = "username"
API_PASSWORD = "password"

# Make a request to the 46elks API
response = requests.post(
    "https://api.46elks.com/a1/Calls",
    auth = (API_USERNAME, API_PASSWORD),
    data = {
        "from": "+46766861234",
        "to": "+46723175800",
        "voice_start": "{'connect':'+461890510'}"
    }
)

# Check that the request was succesful
if response.status_code == requests.codes.ok:
    print("Sent! The API responded:")
    print(response.text)
else:
    # Error handling code...
    print("Error: %s" % response.text)
<?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;
?>
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();
    }
  }
}
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"
}
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