Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Retrieve a specific parse setting



API Overview

api-overview page anchor

Twilio SendGrid's Inbound Parse Webhook allows you to receive emails as multipart/form-data at a URL of your choosing. SendGrid will grab the content, attachments, and the headers from any email it receives for your specified hostname.

See "Setting up the Inbound Parse Webhook" for help configuring the Webhook. You can also manage the Inbound Parse Webhook in the Twilio SendGrid App(link takes you to an external page).

To begin processing email using SendGrid's Inbound Parse Webhook, you will have to setup MX Records, choose the hostname (or receiving domain) that will be receiving the emails you want to parse, and define the URL where you want to POST your parsed emails. If you do not have access to your domain's DNS records, you must work with someone in your organization who does.


GET/v3/user/webhooks/parse/settings/{hostname}

Base url: https://api.sendgrid.com

This endpoint allows you to retrieve a specific inbound parse setting by hostname.

You can retrieve all your Inbound Parse settings and their associated host names with the "Retrieve all parse settings" endpoint.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>

on-behalf-ofstringOptional

The on-behalf-of header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>). See On Behalf Of for more information.

Property nameTypeRequiredDescription
hostnamestringrequired

The hostname associated with the inbound parse setting that you would like to retrieve.

200401403404500
SchemaExample
Property nameTypeRequiredDescriptionChild properties
urlstring

The public URL where you would like SendGrid to POST the data parsed from your email. Any emails sent with the given hostname provided (whose MX records have been updated to point to SendGrid) will be parsed and POSTed to this URL.


hostnamestring

A specific and unique domain or subdomain that you have created to use exclusively to parse your incoming email. For example, parse.yourdomain.com.


spam_checkboolean

Indicates if you would like SendGrid to check the content parsed from your emails for spam before POSTing them to your domain.


send_rawboolean

Indicates if you would like SendGrid to post the original MIME-type content of your parsed email. When this parameter is set to true, SendGrid will send a JSON payload of the content of your email.

Retrieve a specific parse setting

retrieve-a-specific-parse-setting page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_19
const client = require('@sendgrid/client');
_19
client.setApiKey(process.env.SENDGRID_API_KEY);
_19
_19
const hostname = "lt-38.hamilton-robinson.org";
_19
_19
const request = {
_19
url: `/v3/user/webhooks/parse/settings/${hostname}`,
_19
method: 'GET',
_19
_19
}
_19
_19
client.request(request)
_19
.then(([response, body]) => {
_19
console.log(response.statusCode);
_19
console.log(response.body);
_19
})
_19
.catch(error => {
_19
console.error(error);
_19
});


Rate this page: