...
| | |
---|
Description | Updates password | This is the only way for a user to change their password |
Cookies | UltraCartShoppingCartId - Cart ID
UltraCartMerchantID = Merchant ID
| The customer must be successfully logged in to change their password. |
Path Parameters | none | |
Query Parameters | none | |
Headers | none | |
Receives Json | ChangePasswordRequest | |
Returns Json | nothing (204 on success) | A failed login will result in a 401 Unauthorized http status. Any missing parameers will result in a 400 Bad Request http status. Any parameters too long will result in a 400 Bad Request http status |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| this.changePassword = function (oldPassword, newPassword, options) {
options = options || {};
jQuery.ajax({
url: '/rest/myaccount/changePassword',
data: JSON.stringify({oldPassword: oldPassword, newPassword: newPassword}),
type: 'post',
async: (options.success || options.failure) ? true : false,
headers: { "cache-control": "no-cache" },
cache: false,
contentType: 'application/json; charset=UTF-8',
dataType: 'json'
}).done(function () {
if (options.success) {
options.success();
}
})
.fail(function (jqXHR, textStatus, errorThrown) {
if (options.failure) {
options.failure(jqXHR, textStatus, errorThrown);
}
});
}; |
|
TODO:
/rest/myaccount/
...
forgotPassword
| | |
---|
Description | Emails customer new password | |
Cookies | UltraCartMerchantID = Merchant ID
| The customer doesn't need to be logged in (obviously), but the Merchant ID is required. |
Path Parameters | none | |
Query Parameters | | |
Headers | none | |
Receives Json | ChangePasswordRequest | |
Returns Json | nothing (204 on success) | A failed login will result in a 401 Unauthorized http status. Any missing parameers will result in a 400 Bad Request http status. Any parameters too long will result in a 400 Bad Request http status |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| this.changePassword = function (oldPassword, newPassword, options) {
options = options || {};
jQuery.ajax({
url: '/rest/myaccount/changePassword',
data: JSON.stringify({oldPassword: oldPassword, newPassword: newPassword}),
type: 'post',
async: (options.success || options.failure) ? true : false,
headers: { "cache-control": "no-cache" },
cache: false,
contentType: 'application/json; charset=UTF-8',
dataType: 'json'
}).done(function () {
if (options.success) {
options.success();
}
})
.fail(function (jqXHR, textStatus, errorThrown) {
if (options.failure) {
options.failure(jqXHR, textStatus, errorThrown);
}
});
}; |
|
TODO:
/myaccount/forgotPassword (POST)
...