HI,
I am trying to request the mattermost API suing Angular JS + Nodejs + Gulp + Bower.
But I get below error
Please help me ASAP.
Thanks & Regards
HI,
I am trying to request the mattermost API suing Angular JS + Nodejs + Gulp + Bower.
But I get below error
Please help me ASAP.
Thanks & Regards
Hi @ravidverve
If you go to the System Console -> Security -> Connections you’ll find an option to Enable cross-origin requests from a domain, if you set that then CORS is enabled and preflight of ajax requests work as expected, if you’re unsure what host to use then you can use *
but I don’t recomend doing it that way.
If this solved your problem, can you be so kind to add a [SOLVED] in the thread title.
Thanks my friend
Hi @elias
Thanks for reply
I have checked that security settings and set the * for now, and try to call the API but now I get bad request error.
I have checked for bad request error and get this https://github.com/mattermost/platform/issues/2506 .
So in my case I am calling API from angular JS so can you help me to fix it.
Thanks & Ragards
Hi @ravidverve
Here’s an example with plain javascript
And as you can see here I have a valid response
I’ve have two possible solutions for you:
/api/v1
instead of version 3 like in my example. Version 3 is the current version of the API.Hope this helps.
Hi @ravidverve any luck solving this one?