Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

250 lines (234 sloc) 6.443 kB
---
layout: page
weight: 0
title: Customer Subuser Unsubscribes
navigation:
show: true
---
{% anchor h2 %}
Retrieve Unsubscribes
{% endanchor %}
<p>Note that you can use
<em>either</em>
the days parameter
<em>or</em>
the start_date and end_date parameter.</p>
<table class="table table-bordered table-striped">
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Requirements</th>
<th>Description</th>
</tr>
<tr>
<td>user</td>
<td>Yes</td>
<td>Customer subuser must be registered under
your account</td>
<td>The customer subuser we are retrieving
unsubscribes from</td>
</tr>
<tr>
<td>task</td>
<td>Yes</td>
<td>Must be set to
<em>get</em>
</td>
<td>This will allow you to retrieve the
unsubscribes for the specified customer subuser</td>
</tr>
<tr>
<td>date</td>
<td>No</td>
<td>Must be set to 1</td>
<td>Retrieves the timestamps, it will return a
date in a MySQL timestamp format - YYYY-MM-DD HH:MM:SS</td>
</tr>
</table>
{% xmljsontabs get %}
<div class="tab-content">
<div class="tab-pane" id="get-xml">
<h3>Call</h3>
{% codeblock %}
https://sendgrid.com/apiv2/reseller.manageSubuser.xml?api_user=username&api_key=secureSecret&method=unsubscribes&user=example@example.com&task=get&date=
{% endcodeblock %}
<h3>Response</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>
<unsubscribes>
<unsubscribe>
<email>email1@domain.com</email>
<created>2009-06-10 12:40:30</created>
</unsubscribe>
<unsubscribe>
<email>email2@domain2.com</email>
<created>2009-06-10 12:40:30</created>
</unsubscribe>
</unsubscribes>
{% endcodeblock %}
</div>
<div class="tab-pane active" id="get-json">
<h3>Call</h3>
{% codeblock %}
https://sendgrid.com/apiv2/reseller.manageSubuser.xml?api_user=username&api_key=secureSecret&method=unsubscribes&user=example@example.com&task=get&date=
{% endcodeblock %}
<h3>Response</h3>
{% codeblock lang:javascript %}[
{
"email": "email1@domain.com",
"created": "2009-06-01 19:41:39"
},
{
"email": "email2@domain2.com",
"created": "2009-06-01 19:41:39"
}
]
{% endcodeblock %}
</div>
</div>
<hr/>
{% anchor h2 %}
Delete Unsubscribes
{% endanchor %}
<p>Since SendGrid does not deliver to unsubscribe addresses, users can remove unsubscribes from their list at any time if re-delivery to an unsubscribed address is desired.</p>
<table class="table table-bordered table-striped">
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Requirements</th>
<th>Description</th>
</tr>
<tr>
<td>user</td>
<td>Yes</td>
<td>Customer subuser must be registered under
your account</td>
<td>The customer subuser we are retrieving
unsubscribes from</td>
</tr>
<tr>
<td>task</td>
<td>Yes</td>
<td>Must be set to
<em>delete</em>
</td>
<td>This will allow you to delete an unsubscribe
record for the specified customer subuser</td>
</tr>
<tr>
<td>email</td>
<td>No</td>
<td>Must be an unsubscribe record</td>
<td>You must specify the unsubscribe record to
remove</td>
</tr>
</table>
{% xmljsontabs delete %}
<div class="tab-content">
<div class="tab-pane" id="delete-xml">
<h3>Call</h3>
{% codeblock %}
https://sendgrid.com/apiv2/reseller.manageSubuser.xml?api_user=username&api_key=secureSecret&method=unsubscribes&user=example@example.com&task=delete&email=unsubscribe@sample.com
{% endcodeblock %}
<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>success</message>
</result>
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>Email does not exist</message>
</result>
{% endcodeblock %}
</div>
<div class="tab-pane active" id="delete-json">
<h3>Call</h3>
{% codeblock %}
https://sendgrid.com/apiv2/reseller.manageSubuser.json?api_user=username&api_key=secureSecret&method=unsubscribes&user=example@example.com&task=delete&email=unsubscribe@sample.com
{% endcodeblock %}
<h3>Response: Success</h3>
{% codeblock lang:javascript %}{
"message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:javascript %}{
"message": "Email does not exist"
}
{% endcodeblock %}
</div>
</div>
<hr/>
{% anchor h2 %}
Add Unsubscribes
{% endanchor %}
<p>Add unsubscribe email records to their account if they need to stop sending email messages to a specific recipient.</p>
<table class="table table-bordered table-striped">
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Requirements</th>
<th>Description</th>
</tr>
<tr>
<td>user</td>
<td>Yes</td>
<td>Customer subuser must be registered under
your account</td>
<td>The customer subuser we are retrieving
unsubscribes from</td>
</tr>
<tr>
<td>task</td>
<td>Yes</td>
<td>Must be set to
<em>add</em>
</td>
<td>This will allow you to add an unsubscribe
record for the specified customer subuser</td>
</tr>
<tr>
<td>email</td>
<td>No</td>
<td>Must be an unsubscribe record</td>
<td>You must specify the unsubscribe record to
add</td>
</tr>
</table>
{% xmljsontabs add %}
<div class="tab-content">
<div class="tab-pane" id="add-xml">
<h3>Call</h3>
{% codeblock %}
https://sendgrid.com/apiv2/reseller.manageSubuser.xml?api_user=username&api_key=secureSecret&method=unsubscribes&user=example@example.com&task=add&email=unsubscribe@sample.com
{% endcodeblock %}
<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>success</message>
</result>
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>Email already exists</message>
</result>
{% endcodeblock %}
</div>
<div class="tab-pane active" id="add-json">
<h3>Call</h3>
{% codeblock %}
https://sendgrid.com/apiv2/reseller.manageSubuser.json?api_user=username&api_key=secureSecret&method=unsubscribes&user=example@example.com&task=add&email=unsubscribe@sample.com
{% endcodeblock %}
<h3>Response: Success</h3>
{% codeblock lang:javascript %}{
"message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:javascript %}{
"message": "Email already exists"
}
{% endcodeblock %}
</div></div>
Jump to Line
Something went wrong with that request. Please try again.