example.php 513 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * run Composer first to install the sdk with all it's dependencies in your project. (getcomposer.org)
  4. * composer install
  5. */
  6. require_once "../vendor/autoload.php";
  7. /**
  8. * initiate the TextClient.
  9. * put in your own api-key for authentication.
  10. */
  11. $client = new \CMText\TextClient('your-api-key');
  12. /**
  13. * send a message and get the JSON output returned to your command line.
  14. */
  15. echo json_encode(
  16. $client->SendMessage('Message_Text', 'CM.com', [ 'Recipient_PhoneNumber' ], 'Your_Reference')
  17. );