dev-master
9999999-dev https://github.com/runthered/runthered-php.gitRun The Red PHP Wrapper libraries for public APIs
MIT
The Requires
- php >=5.3.0
The Development Requires
by Finn Colman
rtr runthered
Run The Red PHP Wrapper libraries for public APIs
You can install runthered-php via composer or by downloading the source., (*1)
The Packagist URL is https://packagist.org/packages/runthered/runthered, (*2)
The Run The Red PHP API wrapper libraries allow you to call RTR's public APIs via simple PHP requests., (*3)
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"; } ?>
Run The Red PHP Wrapper libraries for public APIs
MIT
rtr runthered