This module allows you to manage which lists are assigned to newsletters.
add
Assign a List to a Newsletter.
| Parameter |
Required |
Requirements |
Description |
| list |
Yes |
None |
The name of the list to assign to the newsletter. |
| name |
Yes |
None |
The name of the newsletter. |
Call
1
| http://sendgrid.com/api/newsletter/recipients/add.json?name=SendGrid%20NL%20Test2&list=test&api_user=SGusername&api_key=SGpassword
|
Response: Success
1
2
3
| {
"message": "success"
}
|
Response: Error
1
2
3
4
5
6
| {
"message": "error",
"errors": [
"...error messages..."
]
}
|
Call
1
| http://sendgrid.com/api/newsletter/recipients/add.xml?name=SendGrid%20NL%20Test2&list=test&api_user=SGusername&api_key=SGpassword
|
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>error: reason</message>
</result>
|
get
Get all lists assigned to a particular newsletter.
| Parameter |
Required |
Requirements |
Description |
| name |
Yes |
None |
The name of the newsletter for which to retrieve lists. |
Call
1
| http://sendgrid.com/api/newsletter/recipients/get.json?name=test&api_user=SGusername&api_key=SGpassword
|
Response: Success
1
2
3
4
5
| [
{
"list": "Training Contacts"
}
]
|
Response: Error
1
2
3
4
5
6
| {
"message": "error",
"errors": [
"...error messages..."
]
}
|
Call
1
| http://sendgrid.com/api/newsletter/recipients/get.xml?name=test&api_user=SGusername&api_key=SGpassword
|
Response: Success
1
2
3
4
5
6
7
| <?xml version="1.0" encoding="ISO-8859-1"?>
<lists>
<list>
<list>Training Contacts</list>
</list>
</lists>
|
Response: Error
1
2
3
4
5
| <?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>error: reason</message>
</result>
|
delete
Remove assigned lists from newsletter.
| Parameter |
Required |
Requirements |
Description |
| name |
Yes |
Must be an existing newsletter. |
To newsletter from which the list will be unassigned. |
| list |
Yes |
Must be an existing Recipient List. |
Remove this list from the newsletter. |
Call
1
| http://sendgrid.com/api/newsletter/delete.json?name=SendGrid%20NL%20Test1&list=test&api_user=Sgusername&api_key=SGpassword
|
Response: Success
1
2
3
| {
"message": "success"
}
|
Response: Error
1
2
3
4
5
6
| {
"message": "error",
"errors": [
"...error messages..."
]
}
|
Call
1
| http://sendgrid.com/api/newsletter/delete.xml?name=SendGrid%20NL%20Test1&list=test&api_user=Sgusername&api_key=SGpassword
|
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>error: reason</message>
</result>
|