Skip to content

Instantly share code, notes, and snippets.

@vdubyna
Created August 10, 2018 11:54
Show Gist options
  • Save vdubyna/2381dd31a411cfe69c121fd0f1f0dcd7 to your computer and use it in GitHub Desktop.
Save vdubyna/2381dd31a411cfe69c121fd0f1f0dcd7 to your computer and use it in GitHub Desktop.
jQuery.ajax({
contentType: 'application/json',
data: JSON.stringify({"username": "[email protected]", "password": "Qwer1234"}),
dataType: 'json',
processData: false,
type: 'POST',
url: 'https://pha-m2-stg.lcgosc.com/rest/default/V1/integration/customer/token'
}).done(function (token) {
jQuery.ajax({
contentType: 'application/json',
headers: {
"Authorization": "Bearer " + token
},
dataType: 'json',
processData: false,
type: 'GET',
url: 'https://pha-m2-stg.lcgosc.com/rest/default/V1/customers/me'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment