sendgrid / sendgrid-java

The Official Twilio SendGrid Led, Community Driven Java API Library
https://sendgrid.com
MIT License
485 stars 409 forks source link

Unable to create Transactional templates using send grid key #675

Closed vijayiiit137 closed 3 years ago

vijayiiit137 commented 3 years ago

Issue Summary

Tried to create transactional template using java with the link - https://sendgrid.api-docs.io/v3.0/transactional-templates/create-a-transactional-template But got response as 401 Tried with free account If template creates where i can see template in send grid

Code Snippet : kong.unirest.HttpResponse response = Unirest.post("https://api.sendgrid.com/v3/templates") .header("on-behalf-of", "user") .header("authorization", "sendgridapikey") .header("content-type", "application/json") .body("{\"name\":\"example_name\"}") .asString(); System.out.println(response.getStatus());

Maven Dependencies :

com.sendgrid sendgrid-java 4.4.1 commons-io commons-io 2.6 com.konghq unirest-java 3.11.09

Technical details:

thinkingserious commented 3 years ago

Hello @vijayiiit137,

Thanks for submitting a GitHub issue! We are very sorry that you are running into this problem. In order to better serve you, as this does not present itself as a library specific issue, we would like to ask that you reach out to our support team at https://support.sendgrid.com.

Thank you!

SendGrid DX Team