This module allows you to create and manage categories within your Newsletters.
create
Create a new Category.
Parameters
| Parameter |
Required |
Requirements |
Description. |
| category |
Yes |
None |
The name that will be used for the Category being created. |
Call
1
| http://sendgrid.com/api/newsletter/category/create.json?api_user=USERNAME&api_key=PASSWORD&category=CATEGORY
|
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/category/create.xml?api_user=USERNAME&api_key=PASSWORD&category=CATEGORY
|
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>
|
add
Assign a Category to an existing Newsletter.
Parameters
| Parameter |
Required |
Requirements |
Description |
| category |
Yes |
Must be an existing Category. |
The Category that will be added to the newsletter. |
| name |
Yes |
Must be an existing Newsletter |
The Newsletter to which the categories will be added. |
Call
1
| http://sendgrid.com/api/newsletter/category/add.json?api_user=USERNAME&api_key=PASSWORD&category=CATEGORY&name=NEWSLETTER
|
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/category/add.xml?&api_user=USERNAME&api_key=PASSWORD&category=CATEGORY&name=NEWSLETTER
|
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>
|
remove
Remove specific categories, or all categories from a Newsletter.\
Parameters
| Parameter |
Required |
Requirements |
Description |
| name |
Yes |
Must be an existing Newsletter |
The Newsletter that will have Category(ies) deleted from it. |
| category |
No |
Must be an existing category currently added to the Newsletter |
Remove the Category with this name. If the category is not specified. all categories will be deleted from the Newsletter. |
Call
1
| http://sendgrid.com/api/newsletter/category/remove.json?api_user=USERNAME&api_key=PASSWORD&category=CATEGORY&name=NEWSLETTER
|
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/category/remove.xml?api_user=USERNAME&api_key=PASSWORD&category=CATEGORY&name=NEWSLETTER
|
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>
|
list
List all categories.
Parameters
| Parameter |
Required |
Requirements |
Description |
| category |
No |
Must be an existing Category |
Search to see if a specific Category exists rather than a list of all Categories. |
Call
1
| http://sendgrid.com/api/newsletter/category/list.json?api_user=USERNAME&api_key=PASSWORD
|
Response: Success
1
2
3
4
5
6
7
8
| [
{
"category": "CATEGORY"
},
{
"category": "CATEGORY2"
}
]
|
Response: Error
1
2
3
4
5
6
| {
"message": "error",
"errors": [
"...error messages..."
]
}
|
Call
1
| http://sendgrid.com/api/newsletter/category/list.xml?api_user=USERNAME&api_key=PASSWORD
|
Response: Success
1
2
3
4
5
6
7
8
9
10
| <?xml version="1.0" encoding="ISO-8859-1"?>
<categories>
<category>
<category>CATEGORY</category>
</category>
<category>
<category>CATEGORY2</category>
</category>
</categories>
|
Response: Error
1
2
3
4
5
| <?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>error: reason</message>
</result>
|