MPZ API > Update a Segment

Use the API to update a segment.

Request

Submit an XML Request with the following details:
Post URL: https://mpzmail.com/api/v3.0/groups/updateSegment/
Fields to Post
apiKey String REQUIRED The APIKey of the requesting user.
groupID Int REQUIRED The ID of the group the segment is in.
segmentID Int REQUIRED The ID of the segment to update.
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.
segmentName String OPTIONAL A reference name for the segment.

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 segment you have updated.

Sample request XML

<xml>
     <apiKey>44-121312131223</apiKey>
     <groupID>42131</groupID>
     <segmentID>512412</segmentID>
     <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