Andrea Vargas@andreavargas
Hola comunidad. Estoy intentando hacer el llamado a un token por medio de un ajax y solo obtengo error 403, quisiera saber que estoy haciendo mal. Todas las credenciales estan bien. Este es mi código
function make_base_auth(user, password) {
var tok = user + ':' + password;
var hash = window.btoa(tok);
return "Basic " + hash;
}
var auth = make_base_auth("4148974182", "GmiA2SspqT23RerXUts3xd4cCClnM6cl" );
$.ajax({
type: 'POST',
url: 'https://ngapi.freedompop.mx/api/auth/token/credentials',
dataType: 'json',
data: {"username": "freshdesk@freedompop.mx", "password": "jvgXvHBrTrxkKJSt"},
async: true,
headers: {
"Authorization": make_base_auth("4148974182","GmiA2SspqT23RerXUts3xd4cCClnM6cl")
},
success: function (response){
alert('Thanks for your comment!');
var tokenct = response.acces_token;
}, function(error){
console.log(error);
}
});
}); ~~~
Escribe una respuesta