Skip to content

@fadrizul /gist:3891284 forked from jibone/gist:3891262
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var url = server + '/customers/activate';
var activateJSON = { id:"0192268455",activationCode:"6450" };
$.ajax({
url: server + '/customers/activate',
type: 'POST',
async: true,
data: activateJSON,
contentType: "application/json",
dataType: 'json',
xhrFields: {
withCredentials: true
},
success: function(data) {
var bookings = {
name: 'Passenger' // Name of the passenger
, phoneNumber: '0123456789' // Passenger's phone number
, date: '16/01/2015' // Format should be in DD/MM/YYY
, time: '05:55 PM' // Format should be in HH:mm A
, pickUp : {
keyword: 'Jalan Kemajuan' // Pick up keyword
, location: 'Jalan Kemajuan, Seksyen 12 Petaling Jaya' // Full address of the pickup address *Optional*
, latlong: '3.1110223, 101.63866970000004' // Latlng of the pickUp point
, notes: 'Yellow building' // *Optional*
}
, dropOff: {
keyword: 'Jalan Kemajuan' // Pick up keyword
, location: 'Jalan Kemajuan, Seksyen 12 Petaling Jaya' // Full address of the pickup address *Optional*
, latlong: '3.1110223, 101.63866970000004' // Latlng of the pickUp point
, notes: 'Yellow building' // *Optional*
}
, immediate: true // If advance booking set this to false.
, remarks: '+RM5 Please honk when arrive, will be standing at the bus stop' // Notes to send to drivers.
, mobile: true // Always set this to true
, type: 'web' // Options are; ios, venue, ios2, android, windows, winphone, web
, taxiType: 'budget' // Options are: budget, executive, premium or all
};
console.log(bookings);
$.ajax({
url: server + '/book/createBooking',
type: 'POST',
async: true,
data: bookings,
contentType: "application/json",
dataType: 'json',
xhrFields: {
withCredentials: true
},
success: function(data) {
console.log('success');
console.log(data);
},
error: function(data) {
console.log('error');
console.log(data);
},
complete: function(data) {
console.log('complete:');
console.log(data);
}
});
},
error: function(data) {
console.log('error');
console.log(data);
},
complete: function(data) {
console.log('complete:');
console.log(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.