RapidAPI logo

SendGrid

フリーミアム
開発者 sendgridOfficial
更新日 5ヶ月前
Email
9.8/10
人気度
184ms
レイテンシ
64%
正常稼働率

「SendGrid 」のドキュメント

SendGridのWeb API v3へようこそ!このAPIはRESTfulで完全な機能を備えており、簡単に統合できます。

全文を表示する
Mail
POSTSend
Blocks
GETRetrieve all blocks
GETRetrieve a specific block
DELETEDelete a specific block
Bounces
GETRetrieve all bounces
GETRetrieve a bounce
DELETEDelete a bounce
Invalid Emails
GETRetrieve all invalid emails
GETRetrieve a specific invalid email
DELETEDelete a specific invalid email
Spam Reports
GETRetrieve all spam reports
DELETEDelete a specific spam report
GETRetrieve a specific spam report
Cancel Scheduled Sends
POSTCreate a batch ID
GETValidate Batch ID
POSTCancel or pause a scheduled send
GETRetrieve all scheduled sends
GETRetrieve scheduled send
PATCHUpdate user scheduled send information
DELETEDelete a cancellation or pause of a scheduled send
Unsubscribe Groups
GETRetrieve all suppression groups associated with the user.
GETGet information on a single suppression group.
PATCHUpdate a suppression group.
DELETEDelete a suppression group.
POSTCreate a new suppression group
Suppressions (Unsubscribe)
POSTAdd suppressions to a suppression group
GETRetrieve all suppressions for a suppression group
DELETEDelete a suppression from a suppression group
GETRetrieve all suppressions
GETRetrieve all suppression groups for an email address
POSTSearch for suppressions within a group
Settings - Tracking
GETRetrieve Tracking Settings
GETRetrieve Click Track Settings
PATCHUpdate Click Tracking Settings
GETRetrieve Google Analytics Settings
PATCHUpdate Google Analytics Settings
GETGet Open Tracking Settings
PATCHUpdate Open Tracking Settings
GETRetrieve Subscription Tracking Settings
PATCHUpdate Subscription Tracking Settings
Settings - Mail
GETRetrieve all mail settings
GETRetrieve all BCC mail settings
PATCHUpdate BCC mail settings
GETRetrieve address whitelist mail settings
PATCHUpdate address whitelist mail settings
GETRetrieve footer mail settings
PATCHUpdate footer mail settings
GETRetrieve forward spam mail settings
PATCHUpdate forward spam mail settings
GETRetrieve plain content mail settings
PATCHUpdate plain content mail settings
GETRetrieve spam check mail settings
PATCHUpdate spam check mail settings
GETRetrieve bounce purge mail settings
PATCHUpdate bounce purge mail settings
GETRetrieve forward bounce mail settings
PATCHUpdate forward bounce mail settings
Settings - Inbound Parse
POSTCreate a parse setting
GETRetrieve all parse settings
GETRetrieve a specific parse setting
PATCHUpdate a parse setting
DELETEDelete a parse setting
Account Stats
GETRetrieve global email statistics
GETRetrieve email statistics by country and state/province.
GETRetrieve email statistics by device type.
GETRetrieve email statistics by client type.
GETRetrieve stats by a specific client type.
GETRetrieve email statistics by mailbox provider.
GETRetrieve email statistics by browser.
POSTSend

このエンドポイントを使用すると、SendGridのv3 Web API経由で電子メールを送信できます。

ヘッダーパラメータ
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
必須パラメータ
SendJSON_STRING
REQUIREDSend email payload. For optional payload parameters visit https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html#-Request-Body-Parameters
コードスニペット
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", "ログインしてキーを取得")
.header("Content-Type", "application/json")
.send({"personalizations":[{"to":[{"email":"john@example.com"}],"subject":"Hello, World!"}],"from":{"email":"from_address@example.com"},"content":[{"type":"text/plain","value":"Hello, World!"}]})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
サンプルレスポンス
概要
リクエストURL: https://rapidprod-sendgrid-v1.p.rapidapi.com/mail/send
リクエストメソッド: POST
レスポンスヘッダ
レスポンスボディ

SDKをインストール(NodeJS)

インストール

Node.jsでUnirestを使用するには、NPMモジュールをインストールしてください。

$ npm install unirest

インストール完了後は、簡単にリクエストを行うことができるようになります。

var unirest = require('unirest');

リクエスト

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", "ログインしてキーを取得")
.header("Content-Type", "application/json")
.send({"personalizations":[{"to":[{"email":"john@example.com"}],"subject":"Hello, World!"}],"from":{"email":"from_address@example.com"},"content":[{"type":"text/plain","value":"Hello, World!"}]})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2認証
クライアントID
クライアントシークレット
OAuth2認証