Version 4.0.0
- Removed
CreateSend.apikey
to promote using OAuth rather than basic auth with an API key. - Started using the
https://api.createsend.com/api/v3.1/
API endpoint. - Added support for new segments structure.
-
Segments now includes a new
RuleGroups
member, instead of aRules
member.So for example, when you previously would have created a segment like so:
segment.create(list.ListID, 'Python API Segment', [ { "Subject": "EmailAddress", "Clauses": ["CONTAINS pyapi.com"] } ])
You would now do this:
segment.create(list.ListID, 'Python API Segment', [ { "Rules": [ { "RuleType": "EmailAddress", "Clause": "CONTAINS pyapi.com" } ] } ])
-
The Add Rule call is now Add Rule Group, taking a
rulegroup
argument instead of asubject
&clauses
argument.Segment.add_rulegroup(self, rulegroup):
So for example, when you previously would have added a rule like so:
segment.add_rule( "EmailAddress", ["CONTAINS pyapi.com"] )
You would now do this:
segment.add_rulegroup( { "Rules": [ { "RuleType": "EmailAddress", "Clause": "CONTAINS pyapi.com" } ] } )
-