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

curl -X POST \
-u apiusername:apipassword \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'from=ElkCo' \
-d 'to=+46723175800' \
-d "message=It's cold outside, bring a sweater" \
'https://api.46elks.com/a1/SMS'
curl -X POST \
-u apiusername:apipassword \
-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 = "apiusername"
API_PASSWORD = "apipassword"

# Make a request to the 46elks API
response = requests.post(
    "https://api.46elks.com/a1/SMS",
    auth = (API_USERNAME, API_PASSWORD),
    data = {
        "from": "ElkCo",
        "to": "+46723175800",
        "message": "It's cold outside, bring a sweater!"
    }
)

# 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 = "apiusername"
API_PASSWORD = "apipassword"

# 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 = 'apiusername';
  $password = 'apipassword';
  $sms = array('from' => 'ElkCo',
               'to' => '+46709751949',
               'message' => "It's cold outside, bring a sweater!");
              
  $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 = 'apiusername';
  $password = 'apipassword';
  $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 = "apiusername";
    public static string pwd = "apipassword";
    private static HttpClient client;
    static void Main(string[] args)
    {
      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", "ElkCo"),
        new KeyValuePair < string, string > (
          "to", "+46735417172"),
        new KeyValuePair < string, string > (
          "message",
          "It's cold outside, bring a sweater!"),
      });

      HttpResponseMessage response = client
        .PostAsync("/a1/SMS", content).Result;
      string result = response.Content.ReadAsStringAsync().Result;
      Console.WriteLine(result);
    }
  }
}
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 = "apiusername";
    public static string pwd = "apipassword";
    private static HttpClient client;
    static void Main(string[] args)
    {
      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", "+46766861004"),
        new KeyValuePair < string, string > (
          "to", "+46735417172"),
        new KeyValuePair < string, string > (
          "voice_start", '{"connect":"+461890510"}'),
        }
      );

      HttpResponseMessage response = client
        .PostAsync("/a1/Calls", content).Result;
      string result = response.Content.ReadAsStringAsync().Result;
      Console.WriteLine(result);
    }
  }
}
POST https://apiusername:apipassword@api.46elks.com/a1/SMS
application/x-www-form-urlencoded
from=ElkCo
to=+46723175800
message="It's cold outside, bring a sweater!"
POST https://apiusername:apipassword@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"
}
Visa mig api-dokumentationen

Vad gör andra med 46elks api?

Du är i gott sällskap
när du använder 46elks

kodcentrum logo, organization that trusts 46elks

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