2017 © Pedro Peláez
 

library runthered

Run The Red PHP Wrapper libraries for public APIs

image

runthered/runthered

Run The Red PHP Wrapper libraries for public APIs

  • Thursday, July 7, 2016
  • by finncolman
  • Repository
  • 1 Watchers
  • 0 Stars
  • 517 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

Installation

You can install runthered-php via composer or by downloading the source., (*1)

The Packagist URL is https://packagist.org/packages/runthered/runthered, (*2)

Overview

The Run The Red PHP API wrapper libraries allow you to call RTR's public APIs via simple PHP requests., (*3)

Examples

Push API send MT and query DLR:, (*4)

pushMessage($body, $to, $from, $id);
        echo "The msg_id is $response->msg_id\n";
        echo "The status is $response->status\n";
        echo "The id is $response->id\n";

        $msg_id = '55f8d226e13823069edbdfe2';
        $dlr_id = 12346;
        $dlr_response = $pushApi->queryDlr($msg_id,$dlr_id);
        echo "The status is $dlr_response->status\n";
        echo "The reason is $dlr_response->reason_code\n";
        echo "The dlr id is $dlr_response->id\n";
} catch (PushApiException $e){
        echo 'Caught exception: ',  $e->getMessage(), " and code ", $e->getCode(), "\n";
}

?>

HTTP Gateway send MT and query DLR status:, (*5)

pushMessage($message, $to, $from);
        echo "The msg_id is $response\n";

        $msg_id = '55f8d193e13823069edbdfdd';
        $dlr_response = $httpGatewayApi->queryDlr($msg_id);
        echo "The status is $dlr_response->status\n";
        echo "The reason is $dlr_response->reason_code\n";
        echo "The dlr id is $dlr_response->id\n";
} catch (HttpGatewayException $e){
        echo 'Caught exception: ',  $e->getMessage(), " and code ", $e->getCode(), "\n";
}

?>

HTTP Gateway send bulk MT messages, (*6)

pushToMany($message, $to_numbers, $from);
foreach($responses as $response){
    echo "The response data is response " . $response->response . " and http code " . $response->http_code . "\n";
}

// alternatively use the pushToManyPost function which uses POST instead of GET, which is slower but more secure
$responses = $httpGatewayApi->pushToManyPost($message, $to_numbers, $from);
foreach($responses as $response){
    echo "The response data is response " . $response->response . " and http code " . $response->http_code . "\n";
}


?>


Prerequisites

  • PHP >= 5.3.0

The Versions

07/07 2016

dev-master

9999999-dev https://github.com/runthered/runthered-php.git

Run The Red PHP Wrapper libraries for public APIs

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

rtr runthered