JavaScript

Method Description

Implemented in tracker with an async call with additional fields. Operation name and input fields can be set up via Maestra framework.

Authentication ticket must be supplied along any edits. This is necessary to protect from malicious updates. Ticket is valid for half an hour, so you need to create it every time before an update operation is invoked.

maestra('async', {
  operation: '<operation name>',
  data: {
    customer: {
      authenticationTicket: '<authentication ticket>',
      lastName: '<customer last name>',
      firstName: '<customer first name>',
      middleName: '<customer middle name>',
      mobilePhone: '<customer mobile number>',
      email: '<customer email>',
      password: '<password>',
      customFields: {
          <custom field>: '<custom field value>',
          <custom multi-value field>: [
            '<custom field value>',
            '<custom field value>'
        ],
      },
      subscriptions:[
        {
          pointOfContact: '<communication channel, email/SMS/etc.>',
          topic: '<emailing topic>',
          isSubscribed: <subscription status, true/false>
        }
      ]
  	}
  }
});
  • Ticket generation algorithm is outlined here.

Sample Operations

maestra('async', {
  operation: 'EditCustomer',
  data: {
    customer: {
      authenticationTicket: '56D6169641757468656E74696361746|CA49A96250AB940A81C1E48BEF66BC48B8711',
      lastName: 'Smith',
      firstName: 'John',
      middleName: 'Michael',      
      mobilePhone: '5554134389',
      email: '[email protected]',
      password: 'Qwerty',
      subscriptions: [
        {
          pointOfContact: 'Sms',
          topic: 'SweetsOfLife',
          isSubscribed: true
        }
      ]
    }
  }
});