Mautic Community Forums

Invalid user credentials

I’m trying to send post request(as said in docs) to get access token but instead of token I’m getting this:

{"error":"invalid_client","error_description":"The client credentials are invalid"}

client_secret & client_id are right. I even tried to create a new keys but it didn’t make it work.



part of my code.

Code:
var params = "client_id=" + id + "&client_secret" + secret +"&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fsnackimpact.mautic.net%2F&code=UNIQUE_CODE_STRING"; console.log('in...'); xhr.open("POST", combo1); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function() { console.log(xhr.responseText); if(xhr.readyState == 4 && xhr.status === 200) { var res = xhr.response; var parse = JSON.parse(res); } console.log(status); }; xhr.send(params);
I don't think that it is error on my side i.e. all credentials are right.
Cheers,
Ivan.

I’m trying to send post request(as said in docs) to get access token but instead of token I’m getting this:
{"error":"invalid_client","error_description":"The client credentials are invalid"}
client_secret & client_id are right. I even tried to create a new keys but it didn’t make it work.

part of my code.

var params = "client_id=" + id + "&client_secret" + secret +"&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fsnackimpact.mautic.net%2F&code=UNIQUE_CODE_STRING"; console.log('in...'); xhr.open("POST", combo1); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function() { console.log(xhr.responseText); if(xhr.readyState == 4 && xhr.status === 200) { var res = xhr.response; var parse = JSON.parse(res); } console.log(status); }; xhr.send(params);
I don’t think that it is error on my side i.e. all credentials are right.
Cheers,
Ivan.