You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Fuel SDK for Python provides easy access to ExactTarget's Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to ExactTarget functionality via common collection types such as array/hash.
5
+
## Overview
6
+
7
+
The Fuel SDK for Python provides easy access to ExactTarget's Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to ExactTarget functionality via common collection types such as array/hash.
8
+
9
+
## Requirements
8
10
9
-
## Requirements ##
10
11
Python 2.7.3
11
12
12
-
libraries:
13
+
Libraries:
13
14
14
-
- pyjwt 0.1.5
15
-
- requests 1.1.0
16
-
- suds 0.4
15
+
* pyjwt 0.1.5
16
+
* requests 1.1.0
17
+
* suds 0.4
17
18
18
19
The quickest way to install the required libraries is to use pip and tell it to load the libraries listed in the requiredlibraries.txt file (see below). Pip is a tool for installing and managing Python packages and is available at https://pypi.python.org/pypi/pip.
19
20
21
+
```
20
22
pip install -r requirements.txt
23
+
```
21
24
25
+
## Getting Started
22
26
23
-
##Getting Started ##
27
+
### Configuring
24
28
25
-
### Configuring ###
26
-
After downloading the project, rename the config.python.template file to config.python.
29
+
After downloading the project, rename the `config.python.template` file to `config.python`.
27
30
28
-
Edit config.python so you can input the ClientID and Client Secret values provided when you registered your application. If you are building a HubExchange application for the Interactive Marketing Hub then, you must also provide the Application Signature (appsignature). The defaultwsdl configuration must be [changed depending on the ExactTarget service](https://code.exacttarget.com/question/there-any-cetificrate-install-our-server-access-et-api"ExactTarget Forum").
31
+
Edit `config.python` so you can input the ClientID and Client Secret values provided when you registered your application. If you are building a HubExchange application for the Interactive Marketing Hub then, you must also provide the Application Signature (appsignature).
32
+
The defaultwsdl configuration must be [changed depending on the ExactTarget service](https://code.exacttarget.com/question/there-any-cetificrate-install-our-server-access-et-api"ExactTarget Forum").
29
33
The authenticationurl must also be [changed depending on service](https://code.exacttarget.com/question/not-able-create-accesstoken-when-clientidsecret-associated-preproduction-account"ExactTarget Forum").
30
34
31
35
If you have not registered your application or you need to lookup your Application Key or Application Signature values, please go to App Center at [Code@: ExactTarget's Developer Community](http://code.exacttarget.com/appcenter"Code@ App Center").
Description = "This list was created with the PythonSDK"
92
98
ListClassification = "ExactTargetList"
93
99
}]
94
-
</pre>
100
+
```
95
101
96
-
## ET\_Client Class ##
102
+
## ET\_Client Class
97
103
98
-
The ET\_Client class takes care of many of the required steps when accessing ExactTarget's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new ET_Client object for each request made.
104
+
The ET\_Client class takes care of many of the required steps when accessing ExactTarget's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new ET_Client object for each request made.
105
+
106
+
## Responses
99
107
100
-
## Responses ##
101
108
All methods on Fuel SDK objects return a generic object that follows the same structure, regardless of the type of call. This object contains a common set of properties used to display details about the request.
102
109
103
-
- status: Boolean value that indicates if the call was successful
104
-
- code: HTTP Error Code (will always be 200 for SOAP requests)
105
-
- message: Text values containing more details in the event of an error
106
-
- results: Collection containing the details unique to the method called.
| status | Boolean value that indicates if the call was successful |
113
+
| code | HTTP Error Code (will always be 200 for SOAP requests) |
114
+
| message | Text values containing more details in the event of an Error |
115
+
| results | Collection containing the details unique to the method called. |
107
116
108
117
Get Methods also return an addition value to indicate if more information is available (that information can be retrieved using the getMoreResults method):
109
118
110
-
- moreResults - Boolean value that indicates on Get requests if more data is available.
119
+
- moreResults - Boolean value that indicates on Get requests if more data is available.
120
+
111
121
122
+
## Samples
112
123
113
-
## Samples ##
114
-
Find more sample files that illustrate using all of the available functions for ExactTarget objects exposed through the API in the objsamples directory.
124
+
Find more sample files that illustrate using all of the available functions for ExactTarget objects exposed through the API in the objsamples directory.
**Note**: Suds is now patched at runtime when importing the FuelSDK. You no longer need to edit the library. Please be aware of the change.
135
145
136
146
The default Suds 0.4 Package that is available for download needs to have a couple small fixes applied in order for it to fully support the Fuel SDK. Please update your suds installation using the following instructions:
137
147
138
148
- Download the suds package source from https://pypi.python.org/pypi/suds
139
-
- Open the file located wihin the uncompressed files at: suds\mx\appender.py
149
+
- Open the file located wihin the uncompressed files at: `suds\mx\appender.py`
140
150
- At line 223, the following lines will be present:
141
-
><pre>
142
-
child.setText(p.get())
143
-
parent.append(child)
144
-
for item in p.items():
145
-
cont = Content(tag=item[0], value=item[1])
146
-
Appender.append(self, child, cont)
147
-
</pre>
151
+
```python
152
+
child.setText(p.get())
153
+
parent.append(child)
154
+
for item in p.items():
155
+
cont = Content(tag=item[0], value=item[1])
156
+
Appender.append(self, child, cont)
157
+
```
148
158
149
159
- Replace those lines with:
150
-
><pre>
151
-
child_value = p.get()
152
-
if(child_value is None):
153
-
pass
154
-
else:
155
-
child.setText(child_value)
156
-
parent.append(child)
157
-
for item in p.items():
158
-
cont = Content(tag=item[0], value=item[1])
159
-
Appender.append(self, child, cont)
160
-
161
-
</pre>
162
-
163
-
- Open the file located wihin the uncompressed files at suds\bindings\document.py
160
+
```python
161
+
child_value = p.get()
162
+
if(child_value isNone):
163
+
pass
164
+
else:
165
+
child.setText(child_value)
166
+
parent.append(child)
167
+
for item in p.items():
168
+
cont = Content(tag=item[0], value=item[1])
169
+
Appender.append(self, child, cont)
170
+
```
171
+
172
+
- Open the file located wihin the uncompressed files at `suds\bindings\document.py`
164
173
- After line 62 which reads:
165
-
><pre>
166
-
n += 1
167
-
</pre>
168
-
169
-
- Add the following lines:
170
-
><pre>
171
-
if value is None:
172
-
continue
173
-
</pre>
174
+
```python
175
+
n +=1
176
+
```
177
+
178
+
- Add the following lines:
179
+
```python
180
+
if value isNone:
181
+
continue
182
+
```
174
183
- Install Suds by running the command
175
-
> python setup.py install
184
+
```
185
+
python setup.py install
186
+
``
176
187
177
-
## Copyright and license ##
188
+
## Copyright and license
178
189
Copyright (c) 2013 ExactTarget
179
190
180
191
Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the COPYING file.
181
192
182
193
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0 commit comments