diff options
Diffstat (limited to 'examples/transmission/get_all_transmissions.php')
-rw-r--r-- | examples/transmission/get_all_transmissions.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php index bc57466..7baf4f1 100644 --- a/examples/transmission/get_all_transmissions.php +++ b/examples/transmission/get_all_transmissions.php @@ -2,13 +2,16 @@ namespace Examples\Transmisson; require_once (dirname(__FILE__).'/../bootstrap.php'); +//pull in API key config +$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json"); +$config = json_decode($configFile, true); + use SparkPost\SparkPost; use GuzzleHttp\Client; use Ivory\HttpAdapter\Guzzle6HttpAdapter; -$key = 'YOUR API KEY'; $httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key'=>$key]); +$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]); try { $results = $sparky->transmission->all(); |