MPZ API > Add a Segment

Use the API to add a new segment to a group.

Request

Submit an XML Request with the following details:
Post URL: https://mpzmail.com/api/v3.0/groups/addSegment/
Fields to Post
apiKey String REQUIRED The APIKey of the requesting user.
groupID Int REQUIRED The ID of the group to add the segment for.
segmentName String REQUIRED A reference name for the segment.
matchType Int REQUIRED 0 = Match ANY of the rules
1 = Match ALL of the rules
segmentRules Xml REQUIRED  
--> rule Xml REQUIRED  
----> field String REQUIRED The field affected. Fields can be any of the following:
  • firstName
  • lastName
  • email
  • houseNo
  • address1
  • address2
  • town
  • county
  • country
  • postCode
  • dateOfBirth
  • gender
  • job
  • dateAdded
  • customField1
  • customField2
  • customField3
  • customField4
  • customField5
  • customField6
  • customField7
  • customField8
  • customField9
  • customField10
----> modifier String REQUIRED The modifier. Modifiers can include...

For Text / Number Fields:
  • Equals
  • Doesnt Equal
  • Contains
  • Does Not Contain
  • Is Provided
  • Is Not Provided
For Date Fields:
  • Is
  • Is After
  • Is Before
  • Day Is
  • Month Is
  • Year Is
----> value String REQUIRED The value to segment on.

Response

Data Sent Back
error Int Indicated wether an error has occured. 0 for no error. 1 for error.
status String If there's been an error, a text description of the error that occured will be here.
segmentID String If successful you will receive the ID of the new segment.

Sample request XML

<xml>
     <apiKey>44-121312131223</apiKey>
     <groupID>42131</groupID>
     <segmentName>My New Segment</segmentName>
     <matchType>1</matchType>
     <segmentRules>
          <rule>
               <field>firstName</field>
               <modifier>Contains</modifier>
               <value>hotmail.com</value>
          </rule>
          <rule>
               <field>dateAdded</field>
               <modifier>Is After</modifier>
               <value>2014-04-21</value>
          </rule>
     </segmentRules>
</xml>

Sample response XML

<xml>
     <error>0</error>
     <status>Success</status>
     <segmentID>1234</segmentID>
</xml>

Comments