Exporting Customers

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/sync?endpointId={unique ID of site/mobile app/etc.}&operation={operation name}

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

<operation>
  <customersPage>
    <sinceDateTimeUtc>{upload data since (inclusive)}</sinceDateTimeUtc>
    <tillDateTimeUtc>{upload data until (non-inclusive)}</tillDateTimeUtc>
    <pageNumber>{page number}</pageNumber>
    <itemsPerPage>{customers per page}</itemsPerPage>
  </customersPage>
</operation>
  • The request returns all customers who signed up or edited their profile from 'sinceDateTimeUtc' up to 'tillDateTimeUtc'.
  • Page numbers start at 1.
  • Maximum customers per page is 1000.

Sample Operation

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

Accept: application/xml
Content-Type: application/xml

<operation>
  <customersPage>
    <sinceDateTimeUtc>2017-09-01 00:00:00.000</sinceDateTimeUtc>
    <tillDateTimeUtc>2017-09-02 00:00:00.000</tillDateTimeUtc>
    <pageNumber>1</pageNumber>
    <itemsPerPage>50</itemsPerPage>
  </customersPage>
</operation>

The request returns top 50 customers who signed up or edited their profile on 2017-09-01.

Response

<result>
  <status>Success</status>
  <customers>
    <customer>
      <ids>
        <customerId>{Maestra id}</customerId>
        <webSiteId>{customer ID}</webSiteId>
      </ids>
      <email>{customer email}</email>
      <isEmailInvalid>{is customer email invalid, true/false}</isEmailInvalid>
      <isEmailConfirmed>{is customer email confirmed, true/false}</isEmailConfirmed>
      <pendingEmail>{email pending confirmation after update}</pendingEmail>
      <mobilePhone>{mobile phone}</mobilePhone>
      <isMobilePhoneInvalid>{is mobile phone invalid, true/false}</isMobilePhoneInvalid>
      <isMobilePhoneConfirmed>{is mobile phone confirmed, true/false}</isMobilePhoneConfirmed>
      <pendingMobilePhone>{mobile phone pending confirmation after update}</pendingMobilePhone>
      <sex>{gender, male/female}</sex>
      <lastName>{last name}</lastName>
      <firstName>{first name}</firstName>
      <middleName>{middle name}</middleName>
      <birthDate>{date of birth as YYYY-MM-DD}</birthDate>
      <area>
        <ids>
          <externalId>{customer area ID}</externalId>
        </ids>
        <name>{customer area name}</name>
      </area>
      <subscriptions>
        <subscription>
          <brand>{brand}</brand>
          <pointOfContact>{channel}</pointOfContact>
          <topic>{topic}</topic>
          <isSubscribed>{true/false}</isSubscribed>
        </subscription>
      </subscriptions>
      <customFields>
        <custom field>{custom field value}</custom field>
        <custom multi-value field>
          <value>{custom field value}</value>
          <value>{custom field value}</value>
        </custom multi-value field>
      </customFields>
      <changeDateTimeUtc>{sign-up/update date as YYYY-MM-DD hh:mm:ss.fff}</changeDateTimeUtc>
    </customer>
  </customers>
</result>