Sender Identities API

Marketing Emails機能からマイグレーションを行う場合、こちらを参照してください。

Sender Identities APIはMarketing Campaigns機能の送信者情報を管理します。

nickname, from.email, address, city, および countryパラメータは送信者情報を作成または更新する際に必要となります。

送信者情報の作成[POST]

送信者情報を作成します。

送信者情報は利用開始前に検証作業が必要になります。Whitelabel済みのドメインの場合自動的に検証済みになります。それ以外の場合、from.emailにメールが送信されます。

Request

1
POST https://api.sendgrid.com/v3/senders HTTP/1.1
Request Body
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "nickname": "My Sender ID",
  "from": {
    "email": "from@example.com",
    "name": "Example INC"
  },
  "reply_to": {
    "email": "replyto@example.com",
    "name": "Example INC"
  },
  "address": "123 Elm St.",
  "address_2": "Apt. 456",
  "city": "Denver",
  "state": "Colorado",
  "zip": "80202",
  "country": "United States"
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "id": 1,
  "nickname": "My Sender ID",
  "from": {
    "email": "from@example.com",
    "name": "Example INC"
  },
  "reply_to": {
    "email": "replyto@example.com",
    "name": "Example INC"
  },
  "address": "123 Elm St.",
  "address_2": "Apt. 456",
  "city": "Denver",
  "state": "Colorado",
  "zip": "80202",
  "country": "United States",
  "verified": true,
  "updated_at": 1449872165,
  "created_at": 1449872165,
  "locked": false
}

全送信者情報の取得 [GET]

全送信者情報の一覧を取得します。

Request

1
GET https://api.sendgrid.com/v3/senders HTTP/1.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
{
  "result": [
    {
      "id": 1,
      "nickname": "My Sender ID",
      "from": {
        "email": "from@example.com",
        "name": "Example INC"
      },
      "reply_to": {
        "email": "replyto@example.com",
        "name": "Example INC"
      },
      "address": "123 Elm St.",
      "address_2": "Apt. 456",
      "city": "Denver",
      "state": "Colorado",
      "zip": "80202",
      "country": "United States",
      "verified": true,
      "updated_at": 1449872165,
      "created_at": 1449872165,
      "locked": false
    }
  ]
}

送信者情報の更新 [PATCH]

from.emailを再検証が必要な状態に更新します。Whitelabel済みのドメインの場合自動的に検証済みになります。それ以外の場合、from.emailにメールが送信されます。

部分的な更新は可能ですが、POSTエンドポイントで必須とされているフィールドはnilを指定することができません。

Request

1
PATCH https://api.sendgrid.com/v3/senders/{sender_id} HTTP/1.1
Request Body
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "nickname": "My Sender ID",
  "from": {
    "email": "from@example.com",
    "name": "Example INC"
  },
  "reply_to": {
    "email": "replyto@example.com",
    "name": "Example INC"
  },
  "address": "123 Elm St.",
  "address_2": "Apt. 456",
  "city": "Denver",
  "state": "Colorado",
  "zip": "80202",
  "country": "United States"
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "id": 1,
  "nickname": "My Sender ID",
  "from": {
    "email": "from@example.com",
    "name": "Example INC"
  },
  "reply_to": {
    "email": "replyto@example.com",
    "name": "Example INC"
  },
  "address": "123 Elm St.",
  "address_2": "Apt. 456",
  "city": "Denver",
  "state": "Colorado",
  "zip": "80202",
  "country": "United States",
  "verified": true,
  "updated_at": 1449872165,
  "created_at": 1449872165,
  "locked": false
}

送信者情報の削除 [DELETE]

送信者情報を削除します。

Request

1
DELETE https://api.sendgrid.com/v3/senders/{sender_id} HTTP/1.1

Response

1
HTTP/1.1 204

送信者検証メールの再送 [POST]

送信者の検証メールを再送します。

Request

1
POST https://api.sendgrid.com/v3/senders/{sender_id}/resend_verification HTTP/1.1

Response

1
HTTP/1.1 204

送信者情報の取得 [GET]

特定の送信者情報を取得します。

Request

1
GET https://api.sendgrid.com/v3/senders/{sender_id} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "id": 1,
  "nickname": "My Sender ID",
  "from": {
    "email": "from@example.com",
    "name": "Example INC"
  },
  "reply_to": {
    "email": "replyto@example.com",
    "name": "Example INC"
  },
  "address": "123 Elm St.",
  "address_2": "Apt. 456",
  "city": "Denver",
  "state": "Colorado",
  "zip": "80202",
  "country": "United States",
  "verified": true,
  "updated_at": 1449872165,
  "created_at": 1449872165,
  "locked": false
}