summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-03-20 20:32:22 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-03-20 20:32:22 -0700
commit1f9f18e136c2bbaeda2fbac9a10ab8c5abc07993 (patch)
tree116c372c47f966c0b1bb6de0bc9c12e2369331f2 /examples
parentdb86af55edb0329f4cb0ee4a97e8c5a49a7850de (diff)
downloadphp-http-client-1f9f18e136c2bbaeda2fbac9a10ab8c5abc07993.zip
php-http-client-1f9f18e136c2bbaeda2fbac9a10ab8c5abc07993.tar.gz
php-http-client-1f9f18e136c2bbaeda2fbac9a10ab8c5abc07993.tar.bz2
Composer/Packagist tested
Diffstat (limited to 'examples')
-rw-r--r--examples/example.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/example.php b/examples/example.php
index 3a90c69..abf2e62 100644
--- a/examples/example.php
+++ b/examples/example.php
@@ -1,13 +1,18 @@
<?php
-include(dirname(__DIR__).'/lib/client.php');
-include(dirname(__DIR__).'/lib/config.php');
-$config = new SendGrid\Config(dirname(__DIR__), '.env');
+// If running this outside of this context, use the following include and
+// comment out the two includes below
+// require __DIR__ . '/vendor/autoload.php';
+include(dirname(__DIR__).'/lib/SendGrid/client.php');
+include(dirname(__DIR__).'/lib/SendGrid/config.php');
+// This gets the parent directory, for your current directory use getcwd()
+$path_to_config = dirname(__DIR__);
+$config = new SendGrid\Config($path_to_config, '.env');
$api_key = getenv('SENDGRID_API_KEY');
$headers = array(
'Content-Type: application/json',
'Authorization: Bearer '.$api_key
);
-$client = new SendGrid\Client('https://e9sk3d3bfaikbpdq7.stoplight-proxy.io', $headers, '/v3', null);
+$client = new SendGrid\Client('https://api.sendgrid.com', $headers, '/v3', null);
// GET Collection
$query_params = array('limit' => 100, 'offset' => 0);