Bounces

このエンドポイントではバウンスリストの一覧取得と削除を行うことができます。

get

アドレス、応答コード指定でバウンスリストの一覧取得を行います。オプションで日付を指定することも可能です。

URI引数 必須 条件 説明
date No 1をセットします バウンスリストレコードのタイムスタンプを取得します。MySQLのタイムスタンプフォーマット - YYYY-mm-dd HH:MM:SSが返ります
days No 指定する場合、正の整数 指定した過去の日数分バウンスリストを取得します(今日を含みます)
start_date No YYYY-mm-ddフォーマットで指定する必要があります。end_dateより早い日付を指定します。 バウンスリストを取得する期間の開始日を指定します
end_date No YYYY-mm-ddフォーマットで指定する必要があります。start_dateより遅い日付を指定します。 バウンスリストを取得する期間の終了日を指定します
limit No 整数 応答結果で取得するリスト数の上限を指定します
offset No 整数 一覧取得するリストの初期位置を指定します
type No hardまたはsoft 検索するバウンスのタイプ
email No メールアドレス(例:testing@example.com) 検索するメールアドレス
Parameter Value Requirements Description
1
4322136549

Call

GET https://api.sendgrid.com/api/bounces.get.json?api_user=apikey&api_key=your_sendgrid_api_key&date=1

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[
  {
    "status": "4.0.0",
    "created": "2011-09-16 22:02:19",
    "reason": "Unable to resolve MX host sendgrid.ne",
    "email": "example@example.com"
  },
  {
    "status": "4.0.0",
    "created": "2011-09-19 17:47:15",
    "reason": "Connection timed out",
    "email": "example@example.com"
  },
  {
    "status": "5.1.1",
    "created": "2011-10-17 11:07:10",
    "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 http://mail.google.com/support/bin/answer.py?answer=6596 z10si838244anz.171 ",
    "email": "example@example.com"
  },
  {
    "status": "5.7.1",
    "created": "2011-10-26 23:06:22",
    "reason": "550 5.7.1 <example@example.com>... Relaying denied. Proper authentication required. ",
    "reason": "550 5.7.1 <info@bnl.co.uk>... Relaying denied. Proper authentication required. ",
    "email": "example@example.com"
  },
  {
    "status": "5.7.1",
    "created": "2011-12-01 01:45:55",
    "reason": "554 5.7.1 <example@example.com>: Relay access denied ",
    "reason": "554 5.7.1 <richard@hengseng.com>: Relay access denied ",
    "email": "example@example.com"
  },
  {
    "status": "550",
    "created": "2012-06-01 14:10:15",
    "reason": "550 support.sendgrid.net [74.63.202.100] is currently not permitted to relay through this server. Perhaps you have not logged into the pop/imap server in the last 30 minutes or do not have SMTP Authentication turned on in your email client. ",
    "email": "example@example.com"
  }
]

Call

GET https://api.sendgrid.com/api/bounces.get.xml?api_user=apikey&api_key=your_sendgrid_api_key&date=1

Response

1
2
3
4
5
6
7
8
<bounces>
   <bounce>
      <email>example@example.com</email>
      <status>5.1.1</status>
      <reason>host [127.0.0.1] said: 550 5.1.1 unknown or illegal user: example@example.com</reason>
      <created>2009-06-10 12:40:30</created>
   </bounce>
</bounces>

delete

バウンスリストからアドレスを削除します。

URI引数 必須 条件 説明
start_date No YYYY-mm-ddフォーマットで指定する必要があります。end_dateより早い日付を指定します。 削除する期間の開始日を指定します
end_date No YYYY-mm-ddフォーマットで指定する必要があります。start_dateより遅い日付を指定します。 削除する期間の終了日を指定します
type No hardまたはsoft 検索するバウンスのタイプ
email No 有効なユーザアカウントのメールアドレスである必要があります 検索するメールアドレス
delete_all No 1 バウンスリストをクリアします
Parameter Value Requirements Description
1
1269641100

Call

POST https://api.sendgrid.com/api/bounces.delete.json
POST Data api_user=apikey&api_key=your_sendgrid_api_key&email=emailToDelete@domain.com

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/bounces.delete.xml
POST Data api_user=apikey&api_key=your_sendgrid_api_key&email=emailToDelete@domain.com

Response

1
<result> success @nodes </result>

Count

URI引数 必須 条件 説明
start_date No YYYY-mm-ddフォーマットで指定する必要があります。end_dateより早い日付を指定します。 カウントする期間の開始日
end_date No YYYY-mm-ddフォーマットで指定する必要があります。start_dateより遅い日付を指定します。 カウントする期間の終了日
type No hardまたはsoft 検索するバウンスのタイプ
Parameter Value Requirements Description
1
5535330071

Call

GET https://api.sendgrid.com/api/bounces.count.json?api_user=apikey&api_key=your_sendgrid_api_key

Response

1
2
3
{
  "count": "4"
}

Call

GET https://api.sendgrid.com/api/bounces.count.xml?api_user=apikey&api_key=your_sendgrid_api_key

Response

1
2
3
<result>
   <count>4</count>
</result>