This module allows you to manage which lists are assigned to marketing email.

add

Assign a List to a Marketing Email.

Parameter Required Requirements Description
list Yes None The name of the list to assign to the marketing email
name Yes None The name of the marketing email
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/recipients/add.json
POST Data name=SendGrid%20NL%20Test2&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
//success
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

POST https://api.sendgrid.com/api/newsletter/recipients/add.xml
POST Data name=SendGrid%20NL%20Test2&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>success</message>
</result>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error: reason</message>
</result>

get

Get all lists assigned to a particular marketing email

Parameter Required Requirements Description
name Yes None The name of the marketing email for which to retrieve lists.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/recipients/get.json
POST Data name=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
//success
[
  {
    "list": "Training Contacts"
  }
]

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

POST https://api.sendgrid.com/api/newsletter/recipients/get.xml
POST Data name=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="ISO-8859-1"?>

<lists>
   <list>
      <list>Training Contacts</list>
   </list>
</lists>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error: reason</message>
</result>

delete

Remove assigned lists from marketing email

Parameter Required Requirements Description
name Yes Must be an existing marketing email To marketing email from which the list will be unassigned.
list Yes Must be an existing Recipient List. Remove this list from the marketing email
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/delete.json
POST Data name=SendGrid%20NL%20Test1&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
//success
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

POST https://api.sendgrid.com/api/newsletter/delete.xml
POST Data name=SendGrid%20NL%20Test1&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>success</message>
</result>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error: reason</message>
</result>