Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Method
POST
Comments
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 Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives JsonChangePasswordRequest 
Returns Jsonnothing (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
themeDJango
languagejavascript
linenumberstrue
  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

Method
POST
Comments
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 Parametersnone 
Query Parameters

 

 
Headers

none

 
Receives JsonChangePasswordRequest 
Returns Jsonnothing (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
themeDJango
languagejavascript
linenumberstrue
  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)

...