Retrieve and delete entries in the Spam Reports list.
get
| Parameter |
Required |
Requirements |
Description |
| date |
No |
Must be set to 1 |
Retrieve the timestamp of the spam report records. It will return a date in a
MySQL timestamp format - YYYY-MM-DD HH:MM:SS |
| days |
No |
If specified, must be an integer greater than 0 |
Number of days in the past for which to retrieve spam reports (includes
today) |
| start_date |
No |
Date must be in YYYY-MM-DD format and be earlier than the end_date
parameter. |
The start of the date range for which to retrieve spam reports. |
| end_date |
No |
Date must be in YYYY-MM-DD format and be later than the start_date
parameter. |
The end of the date range for which to retrieve spam reports. |
| limit |
No |
some integer |
Optional field to limit the number of results returned. |
| offset |
No |
some integer |
optional beginning point in the list to retrieve from. |
| email |
No |
email address eg testing@example.com |
optional email addresses to search for. |
Call
1
| https://sendgrid.com/api/spamreports.get.json?api_user=youremail@domain.com&api_key=secureSecret&date=1
|
Response
1
2
3
4
5
6
7
8
9
10
11
12
| [
{
"ip": "174.36.80.219",
"email": "example@aol.com",
"created": "2009-12-06 15:45:08"
},
{
"ip": "74.63.202.105",
"email": "example2@yahoo.com",
"created": "2009-12-08 07:43:01"
}
]
|
Call
1
| https://sendgrid.com/api/spamreports.get.xml?api_user=youremail@domain.com&api_key=secureSecret&date=1
|
Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| <?xml version="1.0" encoding="ISO-8859-1"?>
<spamreports>
<spamreport>
<ip>174.36.80.219</ip>
<email>example@aol.com</email>
<created>2009-12-06 15:45:08</created>
</spamreport>
<spamreport>
<ip>74.63.202.105</ip>
<email>example2@yahoo.com</email>
<created>2009-12-08 07:43:01</created>
</spamreport>
</spamreports>
|
delete
Delete an address from the Spam Reports list.
| Parameter |
Required |
Requirements |
Description |
| email |
Yes |
Must be a valid user account email |
Email spam reports address to remove |
Call
1
| https://sendgrid.com/api/spamreports.delete.json?api_user=youremail@domain.com&api_key=secureSecret&email=emailToDelete@domain.com
|
Response: Success
1
2
3
| {
"message": "success"
}
|
Response: Error
1
2
3
4
5
6
| {
"message": "error",
"errors": [
"...error messages..."
]
}
|
Call
1
| https://sendgrid.com/api/spamreports.delete.xml?api_user=youremail@domain.com&api_key=secureSecret&email=emailToDelete@domain.com
|
Response: Success
1
2
3
4
5
| <?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>success</message>
</result>
|
Response: Error
1
2
3
4
5
| <?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>Email does not exist</message>
</result>
|