 $.ajax({

        type: "POST",
        url: "client_url_field/oauth/v2/token",

        data: {
            'grant_type': 'client_credentials',
            'client_id': 'client_id_field',
            'client_secret': 'client_secret_field'
        },
        contentType: "application/x-www-form-urlencoded",
        dataType: "text",

        success: function (msg, status, jqXHR) {

           success_body
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            $("#loader-1").hide();
            console.log(errorThrown);
            showErrorMsg();
        }
    });