Whitelabel

ここでは、親アカウント上で作成した全てのWhitelabelレコードが利用可能です。これらのレコードは1つ以上のサブユーザに割り当てることができます。mail_domainurl_domainは基本的に同じ値となります。

WhitelabelレコードはAPIにより作成することはできません。Webダッシュボードでのみ作成可能です。APIはサブユーザとWhitelabelレコードの関連付けの設定および変更にのみ使用されます。

IPアドレスはWhitelabelレコードに関連付けられていますが、本節のAPIでは関連付けを行うことができないことに注意してください。サブユーザは誤った組み合わせのWhitelabelレコードとIPアドレスに割り当てないようにしてください。この時点ではIPアドレスに対してWhtelabelされたDNS逆引きレコードは参照されないことに注意してください。DNSコマンドでこれらの公開レコードを参照することは可能です。


List

URI引数 必須 条件 説明
task Yes listを指定します 作成済みのWhitelabelレコードのリストを取得します
Parameter Value Requirements Description
1
1378406456

Call

POST https://api.sendgrid.com/apiv2/customer.whitelabel.json
POST Data api_user=apikey&api_key=your_sendgrid_api_key&task=list

Response

1
2
3
4
5
6
7
8
9
10
[
  {
    "mail_domain": "em.domain1.com",
    "url_domain": "em.domain1.com"
  },
  {
    "mail_domain": "em.domain2.com",
    "url_domain": "em.domain2.com"
  }
]

Call

POST https://api.sendgrid.com/apiv2/customer.whitelabel.xml
POST Data api_user=apikey&api_key=your_sendgrid_api_key&task=list

Response

1
2
3
4
5
6
7
8
9
10
<whitelabels>
   <whitelabel>
      <mail_domain>em.domain1.com</mail_domain>
      <url_domain>em.domain1.com</url_domain>
   </whitelabel>
   <whitelabel>
      <mail_domain>em.domain2.com</mail_domain>
      <url_domain>em.domain2.com</url_domain>
   </whitelabel>
</whitelabels>

Attach

新たなWhitelabelレコードをサブユーザに割り当てるとともに、以前割り当てられていたレコードは割り当てが解除されます。送信済みのメッセージには影響はありません。

URI引数 必須 条件 説明
task Yes appendを指定します サブユーザにWhitelabelレコードを割り当てます
user Yes 親アカウント配下に登録されているサブユーザ Whitelabelレコードの関連付けを編集するサブユーザ
mail_domain Yes sub.domain.com形式 作成済みのWhitelabelレコード
Parameter Value Requirements Description
1
1948318248

Call

POST https://api.sendgrid.com/apiv2/customer.whitelabel.json
POST Data api_user=apikey&api_key=your_sendgrid_api_key&task=append&user=subuser_username&mail_domain=em.domain1.com

Response

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

Call

POST https://api.sendgrid.com/apiv2/customer.whitelabel.xml
POST Data api_user=apikey&api_key=your_sendgrid_api_key&task=append&user=subuser_username&mail_domain=em.domain1.com

Response

1
2
3
<result>
   <message>success</message>
</result>