We're Hiring!

Mattermost, Inc.

Active Session while integrating an API's in the webapp


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.
crossDomain: true,
dataType: ‘jsonp’,
‘Authorization’: 'Bearer '+ token,
‘Content-Type’: ‘application/json’,
console.log(‘hey success’)

Are you fetching the stored token to add to your requests back to the server?
And do you have your CORS policy set up to allow return requests from your application back to the server, with the header you are including the stored session in?