With the Parse Webhook you can parse the content and attachments of emails. The Web API endpoints allow you to setup, get, and delete your Parse Webhooks settings.

get

Retrieve settings already configured for parsing incoming email.

Parameter Value Requirements Description

Call

GET https://api.sendgrid.com/api/parse.get.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
{
  "parse": [
    {
      "hostname": "www.example.com",
      "url": "www.mydomain.com/parse.php",
      "spam_check": 1
    }
  ]
}

Call

GET https://api.sendgrid.com/api/parse.get.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
<parse>
   <entry>
      <hostname>www.example.com</hostname>
      <url>www.mydomain.com/parse.php</url>
      <spam_check>1</spam_check>
   </entry>
</parse>

set

Specify the hostname and url for parsing incoming emails.

Parameter Required Requirements Description
hostname Yes alphanumeric The hostname (domain or subdomain) for which you would like to configure a Parse Webhook callback URL.
url Yes alphanumeric The callback URL to which Parse Webhook payloads will be POSTed.
spam_check No 0 or 1 If enabled, messages will POST, and will have added fields of spam_report and spam_score
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/parse.set.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&hostname=www.example.com&url=www.mydomain.com/parse.php&spam_check=1

Response

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

Call

POST https://api.sendgrid.com/api/parse.set.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&hostname=www.example.com&url=www.mydomain.com/parse.php&spam_check=1

Response

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

Delete Entry

Delete the existing settings for parsing incoming emails.

Parameter Required Requirements Description
hostname Yes alphanumeric The hostname (domain or subdomain) for which you would like to delete Parse Webhook settings.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/parse.delete.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&hostname=www.example.com

Response

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

Call

POST https://api.sendgrid.com/api/parse.delete.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&hostname=www.example.com

Response

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