D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
testing-same-sendgrid-php
/
examples
/
scopes
/
Filename :
scopes.php
back
Copy
<?php require 'vendor/autoload.php'; // If you're using Composer (recommended) // comment out the above line if not using Composer // require("./sendgrid-php.php"); // If not using Composer, uncomment the above line $apiKey = getenv('SENDGRID_API_KEY'); $sg = new \SendGrid($apiKey); //////////////////////////////////////////////////// // Retrieve a list of scopes for which this user has access. # // GET /scopes # try { $response = $sg->client->scopes()->get(); print $response->statusCode() . "\n"; print_r($response->headers()); print $response->body() . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; }