File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ namespace Examples \Unwrapped ;
3+ require_once (dirname (__FILE__ ).'/../bootstrap.php ' );
4+
5+ //pull in API key config
6+ $ configFile = file_get_contents (dirname (__FILE__ ) . '/../example-config.json ' );
7+ $ config = json_decode ($ configFile , true );
8+
9+ use SparkPost \SparkPost ;
10+ use GuzzleHttp \Client ;
11+ use Ivory \HttpAdapter \Guzzle6HttpAdapter ;
12+
13+ $ httpAdapter = new Guzzle6HttpAdapter (new Client ());
14+ $ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
15+
16+ try {
17+ $ sparky ->setupUnwrapped ('webhooks ' );
18+
19+ $ results = $ sparky ->webhooks ->get ();
20+
21+ echo 'Congrats you can use your SDK! ' ;
22+ } catch (\Exception $ exception ) {
23+ echo $ exception ->getMessage ();
24+ }
25+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SparkPost ;
4+
5+ class APIResponseException extends \Exception {
6+
7+ }
8+
9+ ?>
You can’t perform that action at this time.
0 commit comments