summaryrefslogtreecommitdiffstats
path: root/examples/scopes/scopes.cs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/scopes/scopes.cs')
-rw-r--r--examples/scopes/scopes.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/scopes/scopes.cs b/examples/scopes/scopes.cs
index b58b785..ac1c40e 100644
--- a/examples/scopes/scopes.cs
+++ b/examples/scopes/scopes.cs
@@ -1,15 +1,16 @@
using System;
+using SendGrid;
using SendGrid.Helpers.Mail; // If you are using the Mail Helper
using Newtonsoft.Json; // You can generate your JSON string yourelf or with another library if you prefer
-string _apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User);
-dynamic sg = new SendGrid.SendGridAPIClient(_apiKey);
+string apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User);
+Client client = new Client(apiKey);
////////////////////////////////////////////////////////
// Retrieve a list of scopes for which this user has access.
// GET /scopes
-dynamic response = await sg.client.scopes.get();
+Response response = await client.RequestAsync(method: Client.Methods.GET, urlPath: "scopes");
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());