From 5ee51495dacdf525c468fa6a4baf8c16af7f6079 Mon Sep 17 00:00:00 2001 From: Ankit Mahapatra Date: Sun, 7 Oct 2018 03:05:25 +0530 Subject: [PATCH 1/5] Issue 481 - Update API call url to get a list of all templates. --- USAGE.md | 2 +- examples/templates/templates.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/USAGE.md b/USAGE.md index cf25b2c6..f77b33d8 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4434,7 +4434,7 @@ Transactional templates are templates created specifically for transactional ema SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); Request request = new Request(); request.setMethod(Method.GET); - request.setEndpoint("templates"); + request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy, dynamic"); Response response = sg.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); diff --git a/examples/templates/templates.java b/examples/templates/templates.java index a16c4bed..7ca06ba5 100644 --- a/examples/templates/templates.java +++ b/examples/templates/templates.java @@ -41,7 +41,7 @@ public static void main(String[] args) throws IOException { SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); Request request = new Request(); request.setMethod(Method.GET); - request.setEndpoint("templates"); + request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); Response response = sg.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); From be877bb03d0704a85c4ef76cfa57bae449fc3450 Mon Sep 17 00:00:00 2001 From: Ankit Mahapatra Date: Sun, 7 Oct 2018 03:15:04 +0530 Subject: [PATCH 2/5] #481 - Spacing issue --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index f77b33d8..c819814e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4434,7 +4434,7 @@ Transactional templates are templates created specifically for transactional ema SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); Request request = new Request(); request.setMethod(Method.GET); - request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy, dynamic"); + request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); Response response = sg.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); From 4a04b57b324f36789b6300171d56fd743e69d520 Mon Sep 17 00:00:00 2001 From: Ankit Mahapatra Date: Sun, 7 Oct 2018 03:17:17 +0530 Subject: [PATCH 3/5] #481 - Spacing --- USAGE.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/USAGE.md b/USAGE.md index c819814e..22c028cf 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4432,9 +4432,8 @@ Transactional templates are templates created specifically for transactional ema ```java try { SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); - Request request = new Request(); - request.setMethod(Method.GET); - request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); + Request request = new Request(); + request.setMethod(Method.GET); request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); Response response = sg.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); From dae3f8e14d20ff78661b5b1519fcd370829b9a23 Mon Sep 17 00:00:00 2001 From: Ankit Mahapatra Date: Sun, 7 Oct 2018 03:21:08 +0530 Subject: [PATCH 4/5] Update usage.md --- USAGE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index 22c028cf..7c05a749 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4433,7 +4433,8 @@ Transactional templates are templates created specifically for transactional ema try { SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); Request request = new Request(); - request.setMethod(Method.GET); request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); + request.setMethod(Method.GET); + request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); Response response = sg.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); From f2a96746f76ea941844d5a3b7cebf845a8002e24 Mon Sep 17 00:00:00 2001 From: Ankit Mahapatra Date: Sun, 7 Oct 2018 03:24:39 +0530 Subject: [PATCH 5/5] Update usage.md --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index 7c05a749..ea23e4c4 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4432,7 +4432,7 @@ Transactional templates are templates created specifically for transactional ema ```java try { SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); - Request request = new Request(); + Request request = new Request(); request.setMethod(Method.GET); request.setEndpoint("https://api.sendgrid.com/v3/templates?generations=legacy,dynamic"); Response response = sg.api(request);