summaryrefslogtreecommitdiffstats
path: root/examples/devices/devices.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/devices/devices.js')
-rw-r--r--examples/devices/devices.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/devices/devices.js b/examples/devices/devices.js
index a41a102..26c3f21 100644
--- a/examples/devices/devices.js
+++ b/examples/devices/devices.js
@@ -1,4 +1,4 @@
-var sg = require('../lib/sendgrid.js').SendGrid(process.env.SENDGRID_API_KEY)
+var sg = require('sendgrid-nodejs').SendGrid(process.env.SENDGRID_API_KEY)
///////////////////////////////////////////////////
// Retrieve email statistics by device type.
@@ -7,10 +7,11 @@ var sg = require('../lib/sendgrid.js').SendGrid(process.env.SENDGRID_API_KEY)
var request = sg.emptyRequest()
request.queryParams["aggregated_by"] = 'day'
-request.queryParams["limit"] = '1'
-request.queryParams["start_date"] = '2016-01-01'
-request.queryParams["end_date"] = '2016-04-01'
-request.queryParams["offset"] = '1'
+ request.queryParams["limit"] = '1'
+ request.queryParams["start_date"] = '2016-01-01'
+ request.queryParams["end_date"] = '2016-04-01'
+ request.queryParams["offset"] = '1'
+
request.method = 'GET'
request.path = '/v3/devices/stats'
sg.API(request, function (response) {