Get Available

List all of the available apps.

Note: The name entry is used in all the other API calls to identify a app. For a list of all the apps and parameters accesible with the Web API you can check the Filter Settings page.

Call

1
https://sendgrid.com/api/filter.getavailable.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
[
  {
    "name": "twitter",
    "title": "Twitter",
    "description": "This plugin allows you to send an email message to twitter",
    "activated": false
  }
]

Call

1
https://sendgrid.com/api/filter.getavailable.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

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

<filters>
   <filter>
      <name>twitter</name>
      <title>Twitter</title>
      <description>This plugin allows you to send an email message to twitter</description>
      <activated>0</activated>
   </filter>
   ...
</filters>

Activate App

Call

1
https://sendgrid.com/api/filter.activate.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter

Response

1
2
3
{
  "message": "success"
}

Call

1
https://sendgrid.com/api/filter.activate.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter

Response

1
2
3
4
5
<?xml version="1.0" encoding="ISO-8859-1"?>

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

Call

1
https://sendgrid.com/api/filter.deactivate.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter

Response

1
2
3
{
  "message": "success"
}

Call

1
https://sendgrid.com/api/filter.deactivate.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter

Response

1
2
3
4
5
<?xml version="1.0" encoding="ISO-8859-1"?>

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

Deactivate App


Setup App

These API calls require that settings are passed using POST.

PHP curl

Code Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

$url = 'sendgrid.com';
$user = 'username';
$pass = 'password';

$params = array(
  'api_user' => $user,
  'api_key' => $pass,
  'name' => 'twitter',
  'username' => 'twitterusername',
  'password' => 'twitterpassword',
);

$request = $url.'/api/filter.setup.xml';

// Generate curl request
$session = curl_init($request);
// Tell curl to use HTTP POST
curl_setopt ($session, CURLOPT_POST, true);
// Tell curl that this is the body of the POST
curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
// Tell curl not to return headers, but do return the response
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

// obtain response
$response = curl_exec($session);
curl_close($session);

// print everything out
print_r($response);
?>

Get Settings

Call

1
https://sendgrid.com/api/filter.getsettings.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter

Response: Success

1
{"message":"success","settings":[{"field_name":"field_value"}]}

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Response: Empty

*This is returned if that filter has no settings or is not enabled.
1
2
3
{
  "settings": null
}

Call

1
https://sendgrid.com/api/filter.getsettings.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter

Response: Success

1
2
3
4
5
6
<?xml version="1.0" encoding="ISO-8859-1"?>

<filter>
   <field_name>field_value</field_name>
   ...
</filter>

Response: Error

1
2
3
4
5
6
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <message>... error messages ...</message>
</result>

Response: Empty

*This is returned if that filter has no settings or is not enabled.
1
2
3
<?xml version="1.0" encoding="ISO-8859-1"?>

<filter/>