summaryrefslogtreecommitdiffstats
path: root/examples/transmission/get_all_transmissions.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/transmission/get_all_transmissions.php')
-rw-r--r--examples/transmission/get_all_transmissions.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php
index db06b68..fb62ec7 100644
--- a/examples/transmission/get_all_transmissions.php
+++ b/examples/transmission/get_all_transmissions.php
@@ -2,11 +2,14 @@
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 SparkPost\Transmission;
-$key = 'YOURAPIKEY';
-SparkPost::setConfig(array('key'=>$key));
+SparkPost::setConfig(array('key'=>$config['api-key']));
try {
$results = Transmission::all();
@@ -14,4 +17,4 @@ try {
} catch (\Exception $exception) {
echo $exception->getMessage();
}
-?> \ No newline at end of file
+?>