@@ -43,38 +43,42 @@ Sample Code:
4343``` php
4444<?php
4545
46- require_once 'vendor/autoload.php';
46+ require 'vendor/autoload.php';
4747
48- use ClickSendV3APILib\Controllers\SMSController;
48+ \ClickSend\Configuration::$username = 'YOUR USERNAME';
49+ \ClickSend\Configuration::$key = 'YOUR API KEY';
4950
5051$messages = [
51- [
52- "source" => "php",
53- "from" => "sendmobile",
54- "body" => "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
55- "to" => "+61411111111",
56- "schedule" => 1536874701,
57- "custom_string" => "this is a test"
58- ],
59- [
60- "source" => "php",
61- "from" => "sendlist",
62- "body" => "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.",
63- "list_id" => 428,
64- "schedule" => "1436876011",
65- "custom_string" => "This is a test"
66- ]
52+ [
53+ "source" => "php",
54+ "from" => "sendmobile",
55+ "body" => "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
56+ "to" => "+61411111111",
57+ "schedule" => 1536874701,
58+ "custom_string" => "this is a test"
59+ ],
60+ [
61+ "source" => "php",
62+ "from" => "sendlist",
63+ "body" => "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.",
64+ "list_id" => 428,
65+ "schedule" => "1436876011",
66+ "custom_string" => "This is a test"
67+ ]
6768];
6869
6970try {
70- $controller = new SMSController('your-username', 'your-api-key');
71+
72+ $controller = new \ClickSend\Controllers\SMSController('your-username', 'your-api-key');
7173 $response = $controller->sendSms(['messages' => $messages]);
72- //response will return an object
74+
7375 print_r($response);
74- } catch(APIException $e) {
76+
77+ } catch(\ClickSend\APIException $e) {
78+
7579 print_r($e->getResponseBody());
76- }
7780
78- ?>
81+ }
82+ #END OF PHP FILE
7983```
8084
0 commit comments