Powered By Blogger

Wednesday, May 30, 2018

login from javascript OR AJAX or from third party location in magento 2

<script>

 $.ajax({
        method: 'POST',
        url: 'http://127.0.0.1/projectname/rest/all/V1/customersession',
        data: JSON.stringify({
            username: 'gnanasekaran@xxxxxx.com',
            password: 'admin@123'
        }),
        dataType: 'JSON',
        contentType: 'application/json'
    }).done(function(response) {
        console.log(response);
    });


</script>

No comments:

Post a Comment