code
string
signature
string
docstring
string
loss_without_docstring
float64
loss_with_docstring
float64
factor
float64
return super(TelegramBotDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing Telegram Bot --- responseMessages: - code: 401 message: Not authenticated
3.786465
7.390755
0.512324
return super(KikBotList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of Kik bots --- serializer: KikBotSerializer responseMessages: - code: 401 message: Not authenticated
5.542435
5.83576
0.949737
return super(KikBotDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get KikBot by id --- serializer: KikBotSerializer responseMessages: - code: 401 message: Not authenticated
4.805732
6.159139
0.78026
return super(KikBotDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing KikBot --- serializer: KikBotUpdateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
5.04374
5.860379
0.860651
return super(KikBotDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing Kik Bot --- responseMessages: - code: 401 message: Not authenticated
4.609509
6.841979
0.67371
return super(MessengerBotList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of Messenger bots --- serializer: MessengerBotSerializer responseMessages: - code: 401 message: Not authenticated
4.97575
6.326568
0.786485
return super(MessengerBotDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get MessengerBot by id --- serializer: MessengerBotSerializer responseMessages: - code: 401 message: Not authenticated
4.376667
6.731905
0.650138
return super(MessengerBotDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing MessengerBot --- serializer: MessengerBotUpdateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
4.652496
6.225293
0.747354
return super(MessengerBotDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing Messenger Bot --- responseMessages: - code: 401 message: Not authenticated
4.25279
7.320403
0.58095
return super(StateList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of states --- serializer: StateSerializer responseMessages: - code: 401 message: Not authenticated
5.479867
7.342739
0.746297
return super(StateList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new state --- serializer: StateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.261466
7.577889
0.826281
return super(StateDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get state by id --- serializer: StateSerializer responseMessages: - code: 401 message: Not authenticated
4.519611
7.681066
0.588409
return super(StateDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing state --- serializer: StateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
4.86226
6.854145
0.70939
return super(StateDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing state --- responseMessages: - code: 401 message: Not authenticated
4.535839
8.169552
0.555213
return super(TelegramChatStateList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of chat state --- serializer: TelegramChatStateSerializer responseMessages: - code: 401 message: Not authenticated
7.307965
5.897793
1.239102
return super(TelegramChatStateList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new chat state --- serializer: TelegramChatStateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
8.144918
6.446352
1.263493
return super(TelegramChatStateDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get Telegram chat state by id --- serializer: TelegramChatStateSerializer responseMessages: - code: 401 message: Not authenticated
5.818972
6.625671
0.878246
return super(TelegramChatStateDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing Telegram chat state --- serializer: TelegramChatStateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.338237
6.053519
1.047033
return super(TelegramChatStateDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing Kik chat state --- responseMessages: - code: 401 message: Not authenticated
5.699964
10.544164
0.54058
return super(KikChatStateList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of chat state --- serializer: KikChatStateSerializer responseMessages: - code: 401 message: Not authenticated
7.946651
5.511677
1.441784
return super(KikChatStateList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new chat state --- serializer: KikChatStateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
8.842332
5.837521
1.514741
return super(KikChatStateDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get Kik chat state by id --- serializer: KikChatStateSerializer responseMessages: - code: 401 message: Not authenticated
6.186357
6.492018
0.952917
return super(KikChatStateDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing Kik chat state --- serializer: KikChatStateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.187702
5.355855
1.155315
return super(KikChatStateDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing Kik chat state --- responseMessages: - code: 401 message: Not authenticated
6.069927
6.694905
0.906649
return super(MessengerChatStateList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of chat state --- serializer: MessengerChatStateSerializer responseMessages: - code: 401 message: Not authenticated
8.351033
6.178861
1.351549
return super(MessengerChatStateList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new chat state --- serializer: MessengerChatStateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
9.388931
6.502864
1.443815
return super(MessengerChatStateDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get Messenger chat state by id --- serializer: MessengerChatStateSerializer responseMessages: - code: 401 message: Not authenticated
6.470938
7.044013
0.918644
return super(MessengerChatStateDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing Messenger chat state --- serializer: MessengerChatStateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.39395
5.807081
1.101061
return super(MessengerChatStateDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing Messenger chat state --- responseMessages: - code: 401 message: Not authenticated
6.417701
7.375036
0.870193
return super(HandlerList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of handlers --- serializer: HandlerSerializer responseMessages: - code: 401 message: Not authenticated
4.964982
7.604373
0.652911
return super(HandlerList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new handler --- serializer: HandlerSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
5.631114
7.862909
0.716162
return super(HandlerDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get handler by id --- serializer: HandlerSerializer responseMessages: - code: 401 message: Not authenticated
4.483202
8.163481
0.549178
return super(HandlerDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing handler --- serializer: HandlerUpdateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
4.748856
7.391488
0.642476
return super(HandlerDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing handler --- responseMessages: - code: 401 message: Not authenticated
4.365887
8.187748
0.533222
return super(UrlParameterList, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get list of url parameters of a handler --- serializer: AbsParamSerializer responseMessages: - code: 401 message: Not authenticated
5.772719
8.729014
0.661325
return super(UrlParameterList, self).post(request, bot_id, id, format)
def post(self, request, bot_id, id, format=None)
Add a new url parameter to a handler --- serializer: AbsParamSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.660919
8.641916
0.770769
return super(HeaderParameterList, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get list of header parameters of a handler --- serializer: AbsParamSerializer responseMessages: - code: 401 message: Not authenticated
6.459845
8.630243
0.748512
return super(HeaderParameterList, self).post(request, bot_id, id, format)
def post(self, request, bot_id, id, format=None)
Add a new header parameter to a handler --- serializer: AbsParamSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
7.491643
8.530223
0.878247
return super(UrlParameterDetail, self).get(request, bot_id, handler_id, id, format)
def get(self, request, bot_id, handler_id, id, format=None)
Get url parameter by id --- serializer: AbsParamSerializer responseMessages: - code: 401 message: Not authenticated
3.966564
6.428575
0.617021
return super(SourceStateList, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get list of source state of a handler --- serializer: StateSerializer responseMessages: - code: 401 message: Not authenticated
6.305192
7.444091
0.847006
return super(SourceStateList, self).post(request, bot_id, id, format)
def post(self, request, bot_id, id, format=None)
Add a new source state to a handler --- serializer: StateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
7.291027
7.232252
1.008127
try: bot = caching.get_or_set(MessengerBot, hook_id) except MessengerBot.DoesNotExist: logger.warning("Hook id %s not associated to a bot" % hook_id) return Response(status=status.HTTP_404_NOT_FOUND) if request.query_params.get('hub.verify_token') == ...
def get(self, request, hook_id)
Verify token when configuring webhook from facebook dev. MessengerBot.id is used for verification
3.323152
2.926375
1.135587
try: bot = caching.get_or_set(MessengerBot, hook_id) except MessengerBot.DoesNotExist: logger.warning("Hook id %s not associated to a bot" % hook_id) return Response(status=status.HTTP_404_NOT_FOUND) logger.debug("Messenger Bot %s attending request %s...
def post(self, request, hook_id)
Process Messenger webhook. 1. Get an enabled Messenger bot 3. For each message serialize 4. For each message create :class:`MessengerMessage <permabots.models.messenger_api.MessengerMessage>` 5. Delay processing of each message to a task 6. Response prov...
2.901295
2.696919
1.075781
return super(HookList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of hooks --- serializer: HookSerializer responseMessages: - code: 401 message: Not authenticated
5.599234
7.870883
0.711386
return super(HookList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new hook --- serializer: HookSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.419544
8.112032
0.791361
return super(HookDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get hook by id --- serializer: HookSerializer responseMessages: - code: 401 message: Not authenticated
4.755011
7.999709
0.594398
return super(HookDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing hook --- serializer: HookUpdateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
4.955599
7.369872
0.672413
return super(HookDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing hook --- responseMessages: - code: 401 message: Not authenticated
4.542315
8.577813
0.529542
return super(TelegramRecipientList, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get list of telegram recipients of a hook --- serializer: TelegramRecipientSerializer responseMessages: - code: 401 message: Not authenticated
5.949158
5.995804
0.99222
return super(TelegramRecipientList, self).post(request, bot_id, id, format)
def post(self, request, bot_id, id, format=None)
Add a new telegram recipient to a handler --- serializer: TelegramRecipientSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.399235
6.08386
1.051838
bot = self.get_bot(bot_id, request.user) hook = self.get_hook(hook_id, bot, request.user) recipient = self.get_recipient(id, hook, request.user) serializer = self.serializer(recipient) return Response(serializer.data)
def get(self, request, bot_id, hook_id, id, format=None)
Get recipient by id --- serializer: TelegramRecipientSerializer responseMessages: - code: 401 message: Not authenticated
2.180969
2.416149
0.902663
bot = self.get_bot(bot_id, request.user) hook = self.get_hook(hook_id, bot, request.user) recipient = self.get_recipient(id, hook, request.user) serializer = self.serializer(recipient, data=request.data) if serializer.is_valid(): serializer.save() ...
def put(self, request, bot_id, hook_id, id, format=None)
Update existing telegram recipient --- serializer: TelegramRecipientSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
1.83218
1.92783
0.950385
bot = self.get_bot(bot_id, request.user) hook = self.get_hook(hook_id, bot, request.user) recipient = self.get_recipient(id, hook, request.user) recipient.delete() return Response(status=status.HTTP_204_NO_CONTENT)
def delete(self, request, bot_id, hook_id, id, format=None)
Delete an existing telegram recipient --- responseMessages: - code: 401 message: Not authenticated
1.911044
1.991971
0.959373
return super(KikRecipientList, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get list of kik recipients of a hook --- serializer: KikRecipientSerializer responseMessages: - code: 401 message: Not authenticated
5.912724
5.933748
0.996457
return super(KikRecipientList, self).post(request, bot_id, id, format)
def post(self, request, bot_id, id, format=None)
Add a new kik recipient to a handler --- serializer: KikRecipientSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.338254
5.511756
1.149952
return super(MessengerRecipientList, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get list of Messenger recipients of a hook --- serializer: MessengerRecipientSerializer responseMessages: - code: 401 message: Not authenticated
5.818322
6.405131
0.908385
return super(MessengerRecipientList, self).post(request, bot_id, id, format)
def post(self, request, bot_id, id, format=None)
Add a new messenger recipient to a handler --- serializer: MessengerRecipientSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
6.354252
5.889665
1.078882
return super(EnvironmentVarList, self).get(request, bot_id, format)
def get(self, request, bot_id, format=None)
Get list of environment variables --- serializer: EnvironmentVarSerializer responseMessages: - code: 401 message: Not authenticated
6.496031
6.827648
0.95143
return super(EnvironmentVarList, self).post(request, bot_id, format)
def post(self, request, bot_id, format=None)
Add a new environment variable --- serializer: EnvironmentVarSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
7.757222
6.987386
1.110175
return super(EnvironmentVarDetail, self).get(request, bot_id, id, format)
def get(self, request, bot_id, id, format=None)
Get environment variable by id --- serializer: EnvironmentVarSerializer responseMessages: - code: 401 message: Not authenticated
5.314588
7.363358
0.721761
return super(EnvironmentVarDetail, self).put(request, bot_id, id, format)
def put(self, request, bot_id, id, format=None)
Update existing environment variable --- serializer: EnvironmentVarSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
5.666688
6.50521
0.8711
return super(EnvironmentVarDetail, self).delete(request, bot_id, id, format)
def delete(self, request, bot_id, id, format=None)
Delete existing environment variable --- responseMessages: - code: 401 message: Not authenticated
5.34458
9.158593
0.583559
try: hook = Hook.objects.get(key=key, enabled=True) except Hook.DoesNotExist: msg = _("Key %s not associated to an enabled hook or bot") % key logger.warning(msg) return Response(msg, status=status.HTTP_404_NOT_FOUND) if hook.bot.owner != ...
def post(self, request, key)
Process notitication hooks: 1. Obtain Hook 2. Check Auth 3. Delay processing to a task 4. Respond requester
2.422204
2.373307
1.020603
try: bot = caching.get_or_set(KikBot, hook_id) except KikBot.DoesNotExist: logger.warning("Hook id %s not associated to a bot" % hook_id) return Response(status=status.HTTP_404_NOT_FOUND) signature = request.META.get('HTTP_X_KIK_SIGNATURE') if...
def post(self, request, hook_id)
Process Kik webhook: 1. Get an enabled Kik bot 2. Verify Kik signature 3. Serialize each message 4. For each message create :class:`KikMessage <permabots.models.kik_api.KikMessage>` and :class:`KikUser <permabots.models.kik_api.KikUser>` 5. Delay each message ...
2.71461
2.563097
1.059113
# Use renamed format_name() for Django versions >= 1.10. if hasattr(self, 'format_value'): return super(DateTimePicker, self).format_value(value) # Use old _format_name() for Django versions < 1.10. else: return super(DateTimePicker, self)._format_value(v...
def _format_value(self, value)
This function name was changed in Django 1.10 and removed in 2.0.
4.395389
3.636826
1.208578
params = [ ('client_id', client_id), ('redirect_uri', redirect_uri), ('scope', scope) ] if state: params.append(('state', state)) return "%s?%s" % (CreateSend.oauth_uri, urlencode(params))
def authorize_url(self, client_id, redirect_uri, scope, state=None)
Get the authorization URL for your application, given the application's client_id, redirect_uri, scope, and optional state data.
2.826465
2.77028
1.020281
params = [ ('grant_type', 'authorization_code'), ('client_id', client_id), ('client_secret', client_secret), ('redirect_uri', redirect_uri), ('code', code), ] response = self._post('', urlencode(params), ...
def exchange_token(self, client_id, client_secret, redirect_uri, code)
Exchange a provided OAuth code for an OAuth access token, 'expires in' value and refresh token.
2.400092
2.315163
1.036684
if (not self.auth_details or not 'refresh_token' in self.auth_details or not self.auth_details['refresh_token']): raise Exception( "auth_details['refresh_token'] does not contain a refresh token.") refresh_token = self.auth_details['r...
def refresh_token(self)
Refresh an OAuth token given a refresh token.
2.63883
2.533175
1.041709
self.fake_web = True self.faker = get_faker(expected_url, filename, status, body)
def stub_request(self, expected_url, filename, status=None, body=None)
Stub a web request for testing.
12.170566
9.66166
1.259676
headers = { 'User-Agent': CreateSend.user_agent, 'Content-Type': 'application/json; charset=utf-8', 'Accept-Encoding': 'gzip, deflate'} if content_type: headers['Content-Type'] = content_type parsed_base_uri = urlparse( CreateSend.base_...
def make_request(self, method, path, params={}, body="", username=None, password=None, base_uri=None, content_type=None)
username and password should only be set when it is intended that the default basic authentication mechanism using the API key be overridden (e.g. when using the apikey route with username and password).
2.104776
2.089705
1.007212
body = { "Email": email, "Chrome": chrome, "Url": url, "IntegratorID": integrator_id, "ClientID": client_id} response = self._put('/externalsession.json', json.dumps(body)) return json_to_py(response)
def external_session_url(self, email, chrome, url, integrator_id, client_id)
Get a URL which initiates a new external session for the user with the given email. Full details: http://www.campaignmonitor.com/api/account/#single_sign_on :param email: String The representing the email address of the Campaign Monitor user for whom the login session should be create...
3.310068
3.449802
0.959495
params = {"email": email_address or self.email_address} response = self._get("/clients/%s/people.json" % (client_id or self.client_id), params=params) return json_to_py(response)
def get(self, client_id=None, email_address=None)
Gets a person by client ID and email address.
4.102211
3.801839
1.079007
body = { "EmailAddress": email_address, "Name": name, "AccessLevel": access_level, "Password": password} response = self._post("/clients/%s/people.json" % client_id, json.dumps(body)) return json_to_py(respons...
def add(self, client_id, email_address, name, access_level, password)
Adds a person to a client. Password is optional and if not supplied, an invitation will be emailed to the person
3.41682
3.213449
1.063287
params = {"email": self.email_address} body = { "EmailAddress": new_email_address, "Name": name, "AccessLevel": access_level, "Password": password} response = self._put("/clients/%s/people.json" % self.client_id, ...
def update(self, new_email_address, name, access_level, password=None)
Updates the details for a person. Password is optional and is only updated if supplied.
3.58305
3.431598
1.044135
body = { "Subject": subject, "Name": name, "FromName": from_name, "FromEmail": from_email, "ReplyTo": reply_to, "HtmlUrl": html_url, "TextUrl": text_url, "ListIDs": list_ids, "SegmentIDs": segmen...
def create(self, client_id, subject, name, from_name, from_email, reply_to, html_url, text_url, list_ids, segment_ids)
Creates a new campaign for a client. :param client_id: String representing the ID of the client for whom the campaign will be created. :param subject: String representing the subject of the campaign. :param name: String representing the name of the campaign. :param from_name: ...
2.330789
2.414926
0.96516
body = { "Subject": subject, "Name": name, "FromName": from_name, "FromEmail": from_email, "ReplyTo": reply_to, "ListIDs": list_ids, "SegmentIDs": segment_ids, "TemplateID": template_id, "Templat...
def create_from_template(self, client_id, subject, name, from_name, from_email, reply_to, list_ids, segment_ids, template_id, template_content)
Creates a new campaign for a client, from a template. :param client_id: String representing the ID of the client for whom the campaign will be created. :param subject: String representing the subject of the campaign. :param name: String representing the name of the campaign. :...
2.263929
2.392296
0.946342
body = { "PreviewRecipients": [recipients] if isinstance(recipients, str) else recipients, "Personalize": personalize} response = self._post(self.uri_for("sendpreview"), json.dumps(body))
def send_preview(self, recipients, personalize="fallback")
Sends a preview of this campaign.
5.422686
5.066962
1.070205
body = { "ConfirmationEmail": confirmation_email, "SendDate": send_date} response = self._post(self.uri_for("send"), json.dumps(body))
def send(self, confirmation_email, send_date="immediately")
Sends this campaign.
4.419944
4.046382
1.09232
params = { "date": date, "page": page, "pagesize": page_size, "orderfield": order_field, "orderdirection": order_direction} response = self._get(self.uri_for("opens"), params=params) return json_to_py(response)
def opens(self, date="", page=1, page_size=1000, order_field="date", order_direction="asc")
Retrieves the opens for this campaign.
2.612015
2.585992
1.010063
body = { "CompanyName": company, "TimeZone": timezone, "Country": country} response = self._post("/clients.json", json.dumps(body)) self.client_id = json_to_py(response) return self.client_id
def create(self, company, timezone, country)
Creates a client.
4.377964
3.863421
1.133183
params = {"email": email_address} response = self._get(self.uri_for("listsforemail"), params=params) return json_to_py(response)
def lists_for_email(self, email_address)
Gets the lists across a client to which a subscriber with a particular email address belongs.
6.529829
6.6831
0.977066
params = { "page": page, "pagesize": page_size, "orderfield": order_field, "orderdirection": order_direction} response = self._get(self.uri_for("suppressionlist"), params=params) return json_to_py(response)
def suppressionlist(self, page=1, page_size=1000, order_field="email", order_direction="asc")
Gets this client's suppression list.
2.81407
2.743225
1.025826
body = { "EmailAddresses": [email] if isinstance(email, str) else email} response = self._post(self.uri_for("suppress"), json.dumps(body))
def suppress(self, email)
Adds email addresses to a client's suppression list
5.576146
4.875605
1.143683
params = {"email": email} response = self._put(self.uri_for("unsuppress"), body=" ", params=params)
def unsuppress(self, email)
Unsuppresses an email address by removing it from the the client's suppression list
10.022245
11.947077
0.838887
body = { "Currency": currency, "CanPurchaseCredits": can_purchase_credits, "ClientPays": client_pays, "MarkupPercentage": markup_percentage, "MarkupOnDelivery": markup_on_delivery, "MarkupPerRecipient": markup_per_recipient, ...
def set_payg_billing(self, currency, can_purchase_credits, client_pays, markup_percentage, markup_on_delivery=0, markup_per_recipient=0, markup_on_design_spam_test=0)
Sets the PAYG billing settings for this client.
1.830949
1.837183
0.996607
body = { "Currency": currency, "ClientPays": client_pays, "MarkupPercentage": markup_percentage} if monthly_scheme is not None: body["MonthlyScheme"] = monthly_scheme response = self._put(self.uri_for( 'setmonthlybilling'), j...
def set_monthly_billing(self, currency, client_pays, markup_percentage, monthly_scheme=None)
Sets the monthly billing settings for this client.
2.651411
2.585635
1.025439
body = { "Credits": credits, "CanUseMyCreditsWhenTheyRunOut": can_use_my_credits_when_they_run_out} response = self._post(self.uri_for('credits'), json.dumps(body)) return json_to_py(response)
def transfer_credits(self, credits, can_use_my_credits_when_they_run_out)
Transfer credits to or from this client. :param credits: An Integer representing the number of credits to transfer. This value may be either positive if you want to allocate credits from your account to the client, or negative if you want to deduct credits from the client back int...
3.350421
3.240959
1.033775
params = {"email": email} response = self._put(self.uri_for('primarycontact'), params=params) return json_to_py(response)
def set_primary_contact(self, email)
assigns the primary contact for this client
5.950063
5.737698
1.037012
if client_id is None: response = self._get( "/transactional/smartEmail?status=%s" % status) else: response = self._get( "/transactional/smartEmail?status=%s&clientID=%s" % (status, client_id)) return json_to_py(response)
def smart_email_list(self, status="all", client_id=None)
Gets the smart email list.
2.977957
2.80895
1.060167
validate_consent_to_track(consent_to_track) body = { "To": to, "CC": cc, "BCC": bcc, "Attachments": attachments, "Data": data, "AddRecipientsToList": add_recipients_to_list, "ConsentToTrack": consent_to_track, ...
def smart_email_send(self, smart_email_id, to, consent_to_track, cc=None, bcc=None, attachments=None, data=None, add_recipients_to_list=None)
Sends the smart email.
2.50253
2.54429
0.983587
validate_consent_to_track(consent_to_track) body = { "Subject": subject, "From": from_address, "To": to, "CC": cc, "BCC": bcc, "HTML": html, "Text": text, "Attachments": attachments, "Tra...
def classic_email_send(self, subject, from_address, to, consent_to_track, client_id=None, cc=None, bcc=None, html=None, text=None, attachments=None, track_opens=True, track_clicks=True, inline_css=True, group=None, add_recipients_to_list=None)
Sends a classic email.
1.823312
1.824491
0.999354
if client_id is None: response = self._get("/transactional/classicEmail/groups") else: response = self._get( "/transactional/classicEmail/groups?clientID=%s" % client_id) return json_to_py(response)
def classic_email_groups(self, client_id=None)
Gets the list of classic email groups.
3.430549
3.161536
1.085089
response = self._get( "/transactional/messages/%s?statistics=%s" % (message_id, statistics)) return json_to_py(response)
def message_details(self, message_id, statistics=False)
Gets the details of this message.
5.288929
5.056229
1.046022
body = { "Title": title, "RuleGroups": rulegroups} response = self._post("/segments/%s.json" % list_id, json.dumps(body)) self.segment_id = json_to_py(response) return self.segment_id
def create(self, list_id, title, rulegroups)
Creates a new segment.
4.20948
3.681483
1.14342
body = { "Title": title, "RuleGroups": rulegroups} response = self._put("/segments/%s.json" % self.segment_id, json.dumps(body))
def update(self, title, rulegroups)
Updates this segment.
4.859994
3.626444
1.340154
body = rulegroup response = self._post("/segments/%s/rules.json" % self.segment_id, json.dumps(body))
def add_rulegroup(self, rulegroup)
Adds a rulegroup to this segment.
7.239907
5.390152
1.343173
params = { "date": date, "page": page, "pagesize": page_size, "orderfield": order_field, "orderdirection": order_direction, "includetrackinginformation": include_tracking_information } response = self._get(self.uri_...
def subscribers(self, date="", page=1, page_size=1000, order_field="email", order_direction="asc", include_tracking_information=False)
Gets the active subscribers in this segment.
2.442999
2.381483
1.025831
body = { "Name": name, "HtmlPageURL": html_url, "ZipFileURL": zip_url} response = self._post("/templates/%s.json" % client_id, json.dumps(body)) self.template_id = json_to_py(response) return self.template_id
def create(self, client_id, name, html_url, zip_url)
Creates a new email template.
4.309235
3.959829
1.088237
body = { "Name": name, "HtmlPageURL": html_url, "ZipFileURL": zip_url} response = self._put("/templates/%s.json" % self.template_id, json.dumps(body))
def update(self, name, html_url, zip_url)
Updates this email template.
4.339809
3.838673
1.130549
body = { "EmailAddress": email_address, "Name": name} response = self._post("/admins.json", json.dumps(body)) return json_to_py(response)
def add(self, email_address, name)
Adds an administrator to an account.
5.411591
4.377774
1.236151