forked from sendgrid/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.html
More file actions
221 lines (196 loc) · 5.13 KB
/
Copy pathapps.html
File metadata and controls
221 lines (196 loc) · 5.13 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
---
layout: page
weight: 0
title: Apps
navigation:
show: true
---
{% info %}
Please see the <a href='{{root_url}}/API_Reference/Web_API/filter_settings.html'>Filter Settings</a> page for a list of the required parameters for each app setting.
{% endinfo %}
{% anchor h2 %}
List
{% endanchor %}
List all of the available appgs.
Note: The
<em>name</em>
entry is used in all the other API calls to identify a app.
<table class="table table-bordered table-striped"><tbody>
<tr>
<td>Parameter</td>
<td>Required</td>
<td>Requirements</td>
<td>Description</td>
</tr>
<tr>
<td>task</td>
<td>Yes</td>
<td>Must be set to
<em>getavailable</em>
</td>
<td>Retrieve Available Apps</td>
</tr>
<tr>
<td>user</td>
<td>Yes</td>
<td>Subuser must be registered under your account</td>
<td>The subuser who we will update</td>
</tr>
</tbody></table>
{% apiexample list POST https://api.sendgrid.com/apiv2/customer.apps api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=getavailable&user=example@example.com %}
{% response json %}
{
"name": "twitter",
"title": "Twitter",
"description": "This plugin allows you to send an email message to twitter",
"activated": false
}
{% endresponse %}
{% response xml %}
<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>
{% endresponse %}
{% endapiexample %}
<hr/>
{% anchor h2 %}
Activate App
{% endanchor %}
<table class="table table-bordered table-striped"><tbody>
<tr>
<td>Parameter</td>
<td>Required</td>
<td>Requirements</td>
<td>Description</td>
</tr>
<tr>
<td>task</td>
<td>Yes</td>
<td>Must be set to
<em>activate</em>
</td>
<td>Retrieve Available Apps</td>
</tr>
<tr>
<td>user</td>
<td>Yes</td>
<td>Subuser must be registered under your account</td>
<td>The subuser who we will update</td>
</tr>
</tbody></table>
{% apiexample activate POST https://api.sendgrid.com/apiv2/customer.apps api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter&task=activate&user=example@example.com %}
{% response json %}
{
"message": "success"
}
{% endresponse %}
{% response xml %}
<result>
<message>success</message>
</result>
{% endresponse %}
{% endapiexample %}
<hr/>
{% anchor h2 %}
Deactivate App
{% endanchor %}
<table class="table table-bordered table-striped"><tbody>
<tr>
<td>Parameter</td>
<td>Required</td>
<td>Requirements</td>
<td>Description</td>
</tr>
<tr>
<td>task</td>
<td>Yes</td>
<td>Must be set to
<em>deactivate</em>
</td>
<td>Retrieve Available Apps</td>
</tr>
<tr>
<td>user</td>
<td>Yes</td>
<td>Subuser must be registered under your account</td>
<td>The subuser who we will update</td>
</tr>
</tbody></table>
{% apiexample deactivate POST https://api.sendgrid.com/apiv2/customer.apps api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter&task=deactivate&user=example@example.com %}
{% response json %}
{
"message": "success"
}
{% endresponse %}
{% response xml %}
<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>success</message>
</result>
{% endresponse %}
{% endapiexample %}
<hr/>
{% anchor h2 %}
Customize App
{% endanchor %}
These API calls require that settings are passed using POST.
{% apiexample customize POST https://api.sendgrid.com/apiv2/customer.apps api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter&task=setup&user=example@example.com %}
{% response json %}
{"message":"success","settings":[{"field_name":"field_value"}]}
//empty response
{"settings":"null"}
{% endresponse %}
{% response xml %}
<?xml version="1.0" encoding="ISO-8859-1"?>
<filter>
<field_name>field_value</field_name>
...
</filter>
<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>error</message>
<message>... error messages ...</message>
</result>
<!-- empty response -->
<filter></filter>
{% endresponse %}
{% endapiexample %}
<hr/>
{% anchor h2 %}
Get Current Settings
{% endanchor %}
{% apiexample settings POST https://api.sendgrid.com/apiv2/customer.apps api_user=your_sendgrid_username&api_key=your_sendgrid_password&name=twitter&task=getsettings&user=example@example.com %}
{% response json %}
{
"message": "success",
"settings": [
{
"field_name": "field_value"
}
]
}
//error
{
"message": "error",
"errors": [
"...error messages..."
]
}
//empty response
{
"settings": "null"
}
{% endresponse %}
{% response xml %}
<!-- error -->
<result><message>error</message><message>... error messages ...</message></result>
<!-- empty response -->
<filter></filter>
{% endresponse %}
{% endapiexample %}