get

Retrieve settings already configured for parsing incoming email.

Parameter Required Requirements Description
api_user Yes alphanumeric SendGrid Username
api_key Yes alphanumeric SendGrid password

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
10
11
12
13
14
15
16
17
//success
{
  "parse": [
    {
      "hostname": "www.example.com",
      "url": "www.mydomain.com/parse.php",
      "spam_check": 1
    }
  ]
}

//empty
{
  "parse": [

  ]
}

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
8
9
10
11
12
13
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- success -->
<parse>
   <entry>
      <hostname>www.example.com</hostname>
      <url>www.mydomain.com/parse.php</url>
      <spam_check>1</spam_check>
   </entry>
</parse>

<!-- empty -->
<parse></parse>

set

Specify the hostname and url for parsing incoming emails.

Parameter Required Requirements Description
api_user Yes alphanumeric SendGrid Username
api_key Yes alphanumeric SendGrid password
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 spam check is enabled, messages that look like spam will not be POSTed.

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
4
5
6
7
8
9
10
11
12
//success
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

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
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- success -->
<result>
   <message>success</message>
</result>

<!-- error -->
<result>
   <message>error</message>
   <errors>
      ...
      <error>... error messages ...</error>
      ...
   </errors>
</result>

Delete Entry

Delete the existing settings for parsing incoming emails.

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

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
4
5
6
7
8
9
10
11
12
//success
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

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
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- success -->
<result>
   <message>success</message>
</result>

<!-- error -->
<result>
   <message>error</message>
   <errors>
      ...
      <error>... error messages ...</error>
      ...
   </errors>
</result>