Community Forums/Get help with Kontagent/REST API

Answered

Can I call REST API using Javascript AJAX calls?

Salman Riaz
asked this on December 01, 2010 12:09 pm

According to theory, the rest api suppose to work with any way. I am trying to get my calls running using jquery but it is giving me error. But when I try to call the same api by putting that url in browser it gives me OK.

Any comments on that please?

 

Comments

User photo
Salman Riaz
Bombastic Deals

I got the answer, I must have studies before posting this.

Can't make cross-domain ajax calls. If someone else is trying this thing.

December 02, 2010 10:35 am
User photo
Mahmoud Arram
winstreak

Yes you can. You can use an image request to get around cross domain restrictions. This works because you do not need to read the responses for the calls. Here is an example of how to do it in prototype.js:

http://pastebin.com/Wk1YNETJ

March 21, 2011 11:08 pm