Hey!
I’m integrating mattermost endpoints within my webapp, initially I have logged in the user and store its token from the headers and after that what so ever endpoint I’m hitting with sending that stored token into the headers always gives 401.
Does we have to send anything else from the token.
Below is the request that I’m sending using the ajax pls help me in that I’m stuck and running out of time now for the project delivery.
$.ajax({
url:‘http://**************/api/v4/users/1dwmha7fybn8bdygwwqygckbth’,
type:‘GET’,
crossDomain: true,
dataType: ‘jsonp’,
headers:{
‘Authorization’: 'Bearer '+ token,
‘Content-Type’: ‘application/json’,
‘X-Requested-With’:‘XMLHttpRequest’
},
success:function(){
console.log(‘hey success’)
}
});