DOCUMENTATION

HTTP API DOCUMENTATION

CopyHost: api.kodesms.com/sms/send
        Accept: application/json
        ApiKey: {Api key}
        ApiSecret: {Api Secret}
        {
        "message" : "hello, michael!",
        "recipient": "0245667942",
        "sender_alias": "jimmy"
        }

PHP API Documentation

Copy// CURL CODE TO SEND SMS
        try{
        $ch = curl_init('http://api.kodesms.com/sms/send');

        curl_setopt($ch, CURLOPT_POST, 1);

        $data = ['message'=>'Hello fred','recipient'=>'0240120250','sender_alias'=>'freddy'];
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

        curl_setopt($ch, CURLOPT_HTTPHEADER,
        array("Content-Type: application/json ",
        "ApiKey: {API KEY}",
        "ApiSecret: {API SECRET}"
        )
        );
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        $result = curl_exec($ch);
        curl_close($ch);

        }catch(\Exception $e){
        trigger_error(sprintf(
        'Curl failed with error #%d: %s',
        $e->getCode(), $e->getMessage()),
        E_USER_ERROR);
        }
        return $result;
        }

CURL API Documentation

Copy                            curl -X POST \
                                -H 'Content-Type: application/json' \
                                -H 'Accept: application/json' \
                                -d '{
                                "from":"KODESMS",
                                "to":"0240120250",
                                "text":"Test SMS."
                                }' http://api.kodesms.com/sms/send
GET API KEYS.