RapidAPI logo

Sign Up

Log In

SendGrid

FREEMIUM
By sendgridOfficial
Updated 3 months ago
Email
8.5/10
Popularity Score
307ms
Latency
98%
Success Rate
Discussions
Hi Developer, feel free to ask your question:
automationConst0UN:22 days ago
0 Answers

Good

Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://rapidprod-sendgrid-v1.p.rapidapi.com/mail/send")
.header("X-RapidAPI-Host", "rapidprod-sendgrid-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"personalizations":[{"to":[{"email":"[email protected]"}],"subject":"Hello, World!"}],"from":{"email":"[email protected]"},"content":[{"type":"text/plain","value":"Hello, World!"}]})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication