Bounces API

Bounces

バウンスリストの管理を行うことができます。

List all bounces [GET]

すべてエントリの取得
URI引数 必須 条件 説明
start_time No number バウンス発生時刻の範囲をUNIXタイム形式で指定します。
Example: 1443651141
end_time No number バウンス発生時刻の範囲をUNIXタイム形式で指定します。
Example: 1443651154

Request

1
GET https://api.sendgrid.com/v3/suppression/bounces?start_time={start_time}&end_time={end_time} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
HTTP/1.1 200
[
  {
    "created": 1443651125,
    "email": "testemail1@test.com",
    "reason": "550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at  https://support.google.com/mail/answer/6596 o186si2389584ioe.63 - gsmtp ",
    "status": "5.1.1"
  },
  {
    "created": 1433800303,
    "email": "testemail2@testing.com",
    "reason": "550 5.1.1 <testemail2@testing.com>: Recipient address rejected: User unknown in virtual alias table ",
    "status": "5.1.1"
  }
]

Delete bounces [DELETE]

複数エントリの削除
バウンスリストから削除するオプションには2種類あります:
1) "delete_all"にtrueを指定してバウンスリスト内のすべてのメールアドレスを削除する
2) "emails"に削除するメールアドレスを配列で指定して削除する

Request

1
DELETE https://api.sendgrid.com/v3/suppression/bounces HTTP/1.1
Request Body
1
2
3
{
  "delete_all": true
}

Response

1
HTTP/1.1 204

Request

1
DELETE https://api.sendgrid.com/v3/suppression/bounces HTTP/1.1
Request Body
1
2
3
4
5
6
{
  "emails": [
    "email1@test.com",
    "email2@test.com"
  ]
}

Response

1
HTTP/1.1 204

Get a bounce [GET]

エントリの取得
URI引数 必須 条件 説明
email Yes string 対象メールアドレス
Example: bounce1@test.com

Request

1
GET https://api.sendgrid.com/v3/suppression/bounces/{email} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
HTTP/1.1 200
[
  {
    "created": 1443651125,
    "email": "bounce1@test.com",
    "reason": "550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at  https://support.google.com/mail/answer/6596 o186si2389584ioe.63 - gsmtp ",
    "status": "5.1.1"
  }
]

Delete a bounce [DELETE]

エントリの削除
URI引数 必須 条件 説明
email Yes string 対象メールアドレス
Example: bounce1@test.com

Request

1
DELETE https://api.sendgrid.com/v3/suppression/bounces/{email} HTTP/1.1

Response

1
HTTP/1.1 204