Sendgrid API:“提供的授权许可无效,过期或被吊销”

我已经挖过了过去的post,似乎没有什么解决这个问题。 我正在使用生成的API密钥(不是API密钥ID),我已经允许所有权限,甚至尝试打开第二个帐户并从那里尝试。 这里是代码:

// Create new mail object. var mail = new helper.Mail(); // Set 'from' for email. var from = new helper.Email("owner@site.com", "First Last"); mail.setFrom(from) // Set 'subject' for email. mail.setSubject("SchemeBeam Email Verification"); // Create a new personalization, which will allow us to define // an individual to send this email too, as well as define // substitutions to use so we can replace a string, such as // '%hash'%, in the email template with the real hash for this // user. var personalization = new helper.Personalization() var to = new helper.Email("test1@example.com", "Example User"); personalization.addTo(to); // Set hash substituion. //var substitution = new helper.Substitution("%hash%", md5Hash); //personalization.addSubstitution(substitution); // Let's send it. var sg = require('sendgrid')(process.env.SENDGRID_API_KEY); var request = sg.emptyRequest({ method: 'POST', path: '/v3/mail/send', body: mail.toJSON(), }); sg.API(request, function(error, response) { // Handle the response here. console.log(response.statusCode); console.log(response.body); console.log(response.headers); }); 

这里是错误:

 { errors: [ { message: 'The provided authorization grant is invalid, expired, or revoked', field: null, help: null } ] } { server: 'nginx', date: 'Wed, 16 Nov 2016 17:45:14 GMT', 'content-type': 'application/json', 'content-length': '116', connection: 'close', 'x-frame-options': 'DENY' }