Getting Customer Segments

Method Description

Invoked with a POST request. Operation name is set up via Maestra framework. Details of method invocation can be found here.

POST https://api.maestra.io/v3/operations/{synch/asynch operation}?endpointId={unique ID of site/mobile app/etc.}&operation={operation name}&deviceUUID={unique device ID}


Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey {Secret Key, check with the manager if it's mandatory}

<operation>
  <customer>
    <ids>
      <webSiteUserId>{customer ID}</webSiteUserId>
    </ids>
  </customer>
</operation>

Sample Operation

POST https://api.maestra.io/v3/operations/sync?endpointId=Maestra&operation=GetSegments

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey 2a4wVO
Content-Length: 123

<operation>
  <customer>
    <ids>
      <webSiteUserId>5384275</webSiteUserId>
    </ids>
  </customer>
</operation>
POST https://api.maestra.io/v3/operations/sync?endpointId=Maestra&operation=GetSegments&deviceUUID=6740eb79-8311-4518-b50c-86a879709044

Accept: application/xml
Authorization: SecretKey 2a4wVO
Content-Length: 0

Response

<result>
  <status>Success</status>
  <customerSegmentations>
    <customerSegmentation>
      <segmentation>
        <systemName>{internal segmentation name}
        </systemName>
      </segmentation>
      <segment>
        <systemName>{internal segment name}</systemName>
      </segment>
    </customerSegmentation>
    <customerSegmentation>
      <segmentation>
        <systemName>{internal segmentation name}</systemName>
      </segmentation>
    </customerSegmentation>
  </customerSegmentations>
</result>

A missing ‘segment’ means that the customer is not in segmentation.