If you have a non-library SendGrid issue, please contact our support team.
If you can't find a solution below, please open an issue.
When debugging or testing, it may be useful to examine the raw request body to compare against the documented format.
You can do this with something like:
var requestPost = client.emptyRequest()
requestPost.method = 'POST'
requestPost.path = '/v3/api_keys'
requestPost.body = { data: 'some test data' }
requestPost.headers['X-Test'] = 'test'
// Log request body before sending POST request.
console.log(requestPost.body)
client.API(requestPost, (response) => {
// Log the response.
console.log(response.statusCode)
console.log(response.body)
console.log(response.headers)
})