SMS & telefoni
är nu enkelt att baka in i
ditt system eller arbetsflöde!

Prova själv hur läckert det kan vara...

Du kan integrera telefoni enkelt genom ett api.
Perfekt för att få till just den lösning du behöver
– det är ju inte alltid en färdig lösning passar.

Exempelkod

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=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'
{
  "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/Calls",
    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"
  }
}
Visa mig api-dokumentationen

Vad gör andra med 46elks api?

Vi är lokalt tillgängliga, globalt.

Vi är tillgängliga globalt, och samarbetar lokalt med utvecklare. Vi erbjuder dig fakturering i svenska kronor och support du kan lita på.

Välj land för att läsa om vad
som finns tillgängligt i området.

Världkarta - 46elks finns i Sverige!

Vill du integrera telefoni och SMS i din applikation? Skapa konto