summaryrefslogtreecommitdiffstats
path: root/examples/user/user.js
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-07-05 14:51:47 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-07-05 14:51:47 -0700
commita0aee2f880a8e736b638d5188ef56f07d6ce3f82 (patch)
tree11ac0be09ab27d5a82ea7d5bf9cfca62f60c6896 /examples/user/user.js
parenta369c84cf9f747252dc90a0fd108909b60b3f30d (diff)
downloadsendgrid-nodejs-3.0.7.zip
sendgrid-nodejs-3.0.7.tar.gz
sendgrid-nodejs-3.0.7.tar.bz2
Version Bump v3.0.7: swagger/oai updates + accept header fixv3.0.7
Diffstat (limited to 'examples/user/user.js')
-rw-r--r--examples/user/user.js69
1 files changed, 68 insertions, 1 deletions
diff --git a/examples/user/user.js b/examples/user/user.js
index 3046178..7b2305c 100644
--- a/examples/user/user.js
+++ b/examples/user/user.js
@@ -311,7 +311,27 @@ sg.API(request, function (response) {
})
///////////////////////////////////////////////////
-// Retrieve Parse Webhook settings
+// Create a parse setting
+// POST /user/webhooks/parse/settings
+
+
+var request = sg.emptyRequest()
+request.body = {
+ "hostname": "myhostname.com",
+ "send_raw": false,
+ "spam_check": true,
+ "url": "http://email.myhosthame.com"
+};
+request.method = 'POST'
+request.path = '/v3/user/webhooks/parse/settings'
+sg.API(request, function (response) {
+ console.log(response.statusCode)
+ console.log(response.body)
+ console.log(response.headers)
+})
+
+///////////////////////////////////////////////////
+// Retrieve all parse settings
// GET /user/webhooks/parse/settings
@@ -325,6 +345,53 @@ sg.API(request, function (response) {
})
///////////////////////////////////////////////////
+// Update a parse setting
+// PATCH /user/webhooks/parse/settings/{hostname}
+
+
+var request = sg.emptyRequest()
+request.body = {
+ "send_raw": true,
+ "spam_check": false,
+ "url": "http://newdomain.com/parse"
+};
+request.method = 'PATCH'
+request.path = '/v3/user/webhooks/parse/settings/{hostname}'
+sg.API(request, function (response) {
+ console.log(response.statusCode)
+ console.log(response.body)
+ console.log(response.headers)
+})
+
+///////////////////////////////////////////////////
+// Retrieve a specific parse setting
+// GET /user/webhooks/parse/settings/{hostname}
+
+
+var request = sg.emptyRequest()
+request.method = 'GET'
+request.path = '/v3/user/webhooks/parse/settings/{hostname}'
+sg.API(request, function (response) {
+ console.log(response.statusCode)
+ console.log(response.body)
+ console.log(response.headers)
+})
+
+///////////////////////////////////////////////////
+// Delete a parse setting
+// DELETE /user/webhooks/parse/settings/{hostname}
+
+
+var request = sg.emptyRequest()
+request.method = 'DELETE'
+request.path = '/v3/user/webhooks/parse/settings/{hostname}'
+sg.API(request, function (response) {
+ console.log(response.statusCode)
+ console.log(response.body)
+ console.log(response.headers)
+})
+
+///////////////////////////////////////////////////
// Retrieves Inbound Parse Webhook statistics.
// GET /user/webhooks/parse/stats