This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with List in SendGrid
 Overview
Operation | Description |
---|---|
addList | Create a new Recipient List. |
editList | Rename a Recipient List. |
getList | List all Recipient Lists on your account, or check if a particular List exists. |
deleteList | Remove a Recipient List from your account. |
Operation details
This section provides details on the operations.
Adding new list
The addList operation adds a Recipient List in your account.
<sendgrid.addList> <list>{$ctx:list}</list> <name>{$ctx:name}</name> </sendgrid.addList>
Properties
list : Required - Create a Recipient List with this name.
name: Specify the column name for the name associated with email addresses.Â
 { "apiUrl":"https://api.sendgrid.com/api/newsletter", "apiUser":"UserName", "apiKey":"PassWord", "list":"test" }
Editing a list
The editList operation rename a Recipient List.
<sendgrid.editList> <list>{$ctx:list}</list> <newlist>{$ctx:newlist}</newlist> </sendgrid.editList>
Properties
list : Required - This is the name of the Recipient List to be renamed.
newlist: Required - Specify the new name for the Recipient List.Â
 { "apiUrl":"https://api.sendgrid.com/api/newsletter", "apiUser":"UserName", "apiKey":"PassWord", "list":"test", "newlist":"newtest" }
Getting a list
The getList operation gets all Recipient List.
<sendgrid.getList> <list>{$ctx:list}</list> </sendgrid.getList>
Properties
list :Â Check for this particular list.
Â
{ "apiUrl":"https://api.sendgrid.com/api/newsletter", "apiUser":"UserName", "apiKey":"PassWord", "list":"test" }
Deleting a list
The  deleteList operation removes a Recipient List from your account.
<sendgrid.deleteList> <list>{$ctx:list}</list> </sendgrid.deleteList>
Properties
list :Â Required - Remove this Recipient List.
Â
{ "apiUrl":"https://api.sendgrid.com/api/newsletter", "apiUser":"UserName", "apiKey":"PassWord", "list":"test" }
Sample configuration
Following is a sample proxy service that illustrates how to connect to SendGrid with the init
operation and use the addList operation. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="sendgrid_addList" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiUser" expression="json-eval($.apiUser)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="list" expression="json-eval($.list)"/> <property name="name" expression="json-eval($.name)"/> Â <sendgrid.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiUser>{$ctx:apiUser}</apiUser> <apiKey>{$ctx:apiKey}</apiKey> </sendgrid.init> <sendgrid.addList> <list>{$ctx:list}</list> <name>{$ctx:name}</name> </sendgrid.addList> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>