Git Product home page Git Product logo

46elks / 46elks-getting-started Goto Github PK

View Code? Open in Web Editor NEW
51.0 13.0 26.0 734 KB

An introduction to the 46elks API with code examples

Home Page: https://46elks.com/docs/

Elixir 0.77% Go 3.70% JavaScript 23.05% HTML 1.24% Java 4.96% PHP 40.27% Python 8.99% Ruby 0.71% C# 4.18% Shell 0.95% Haskell 2.23% Makefile 0.09% C 3.74% Groovy 0.80% Julia 0.60% VBScript 0.67% Nim 0.52% CSS 0.57% Smarty 0.59% Objective-C 1.39%
sms voice mms ivr telephony

46elks-getting-started's Introduction

46elks-logo

Voice, SMS & MMS for developers.

Welcome to our developer friendly API service! :-)

We make it easy for you to add custom telephony features that are perfectly suited to the way you do things – because sometimes ‘off the shelf’ just doesn't cut it.

You can use 46elks for:

  • Sending SMS text messages
  • Receiving SMS to your applications
  • Sending & receiving MMS pictures
  • Controlling incoming and outgoing telephone calls with code
  • Building interactive voice sessions
  • And other telephony features.

Links

Quickstart

  1. Create your 46elks account and locate your api keys.
  2. Send your first SMS from the dashboard or with curl (see below).
  3. Send an SMS code using one of our code examples.
  4. Learn more about what you can do by reading the documentation.

Send your first SMS with curl

Use your api keys and run this in your terminal:

curl https://api.46elks.com/a1/sms \
  -u <api_username>:<api_password> \
  -d from=CurlyElk \
  -d to=+46766861004 \
  -d message="Test message to your phone."

sms-on-mobile-phone


Code examples

All code examples are public domain and can be used freely.

C - C# | .NET - Elixir - Go - Google apps - haskell - HTML - PHP - Python - Ruby - Java - Node.js - cURL

Build an interactive voice menu or response (IVR)

IVR samples collection.

Show all coding examples for all languages


Community

Projects

Modules, SDKs and libraries

Tutorials

Have you written a tutorial or created an app that you're willing to share? Let us know at [email protected]!

Integrations

If there is an integration that you could benefit from please get in touch.


Teachers

Are you helping others learn how to code? Doing a workshop or a lesson on APIs? Get in touch if you'd like to use the 46elks API to help more people learn about APIs.

Email: [email protected]


Hackathons

We are keen on helping out, and we'd be happy to help you with preparations, mentoring and give away boosted credit packages for participants. Talk to us. We're also particularily interested in helping events and organizations working with teaching coding to beginners, initiatives that encourage diversity in IT, and among conferences. We enjoy meetups, let us know if you’d like for someone to come and hold a presentation about APIs - getting started with apis, how to send an sms in PHP/Python/Elixir/Ruby/Go or another language - we love to learn and share! We exist to help you build useful and cool things!

Contact 46elks
Email: [email protected]
Twitter: @46elks
Instagram: @46elks

46elks-getting-started's People

Contributors

absoluteironic avatar alge avatar benjichat avatar chatwin3d avatar j0n avatar jassob avatar jimjardland avatar jmigueprieto avatar johannesl avatar liquidityc avatar littlekid avatar macaullyjames avatar minisemi avatar nils-hoglund avatar nullmage avatar reinefjord avatar sakjur avatar themaxsandelin avatar thuma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

46elks-getting-started's Issues

ide: schemalagda sms

skulle vara nice o kunna skicka ut sms vid en specifik tidpunkt.

typ:

new URLSearchParams({
  to: '...',
  from: '...',
  sendAt: new Date().toJSON() // ISO-8601 format
})

Better filenames for Java samples

Make it clearer that the samples are the same for plain Java and Unirest. Maybe like this:

SendSMS.java
SendSMS-Unirest.java
SendSMS-HttpClient.java (to be added)

I get this error when I try send sms with 46elks Api php

`<?php

include "../db.php";

//$_POST['command'] ;//
$command = $_POST['command'];
if ($command == "register_user") {//register user
$mobile = $_POST['mobile'];
$token = $_POST['token'];
$sql = "SELECT * FROM tbl_user where mobile ={$mobile}";
$result = mysqli_query($connection, $sql);
$num = mysqli_num_rows($result);

$user_id = 0;

if ($num == 0) {
    $query = "INSERT INTO tbl_user(mobile,tarikh,token)values('{$mobile}',now(),'{$token}')";
    $result = mysqli_query($connection, $query);
    $user_id = mysqli_insert_id($connection);
} else {
    $user = mysqli_fetch_assoc($result);
    $user_id = $user['id'];
}
//register finished


//delete all sms from database
$query = "delete from `tbl_sms_verify` where sms_user_id=$user_id";
$result = mysqli_query($connection, $query);

//insert sms to database
$code = rand(1000, 9999);
$query = "insert into `tbl_sms_verify`(sms_user_id,sms_code)values($user_id,'$code')";
$result = mysqli_query($connection, $query);


function sendSMS ($sms) {

    $username = 'u7dca0c584dfa6f53cc6fb607ac83030e';
    $password = '582593262C81212A6C06F314B30B43A2';

    $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(
        'https://api.46elks.com/a1/SMS', false, $context );

    if (!strstr($http_response_header[0],"200 OK"))
        return $http_response_header[0];

    return $response;
}


$sms = array(

    'from' => 'PHPElk',
    'to' => '$mobile',
    'message' => '$code',

);
echo sendSMS ($sms) . "\n";

if ($command == "verify_code") {//

$mobile = $_POST['mobile'];
$code = $_POST['code'];


$query = "select * from tbl_user where mobile='{$mobile}'";

$result = mysqli_query($connection, $query);

$num = mysqli_num_rows($result);

if ($num == 0) {
    echo json_encode(array('result1' => "error1"));
} else {
    $user = mysqli_fetch_assoc($result);
    $user_id = $user['id'];

    $query = "select * from tbl_sms_verify where sms_user_id='{$user_id}' and sms_code='{$code}'";
    $result = mysqli_query($connection, $query);
    $num = mysqli_num_rows($result);


    if ($num == 0) {
        echo json_encode("error");
    } else {
        
        echo json_encode("ok" );
    }
    
}

}

?>
`

I try pass two variable $mobile and $code into $ sms but I appea with Error. Can someone help why I get This Error.

Need a GitHub Action

Why is there no GitHub Action available for 46elks? It'd be really nice to send an SMS on build success/fail or when there's a new PR to review etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.