0

I tried to integrate Asana API in my HTML, CSS and Jquery Only projects. I get the response but i get Invalid Syntax error please guide what am doing wrong for using Client side available Features only.. I can't use any server side solution. So required help in finding Client side solution only am grateful to you Thanks.

$.ajax({
          url : 'https://app.asana.com/api/1.0/workspaces/',
          username : API_KEY,
          dataType: 'jsonp',
          contentType:"application/json",
          success: function (response) {
              console.log(response["data"]);
          },
          error: function (xhr, ajaxOptions, thrownError) {
              console.log(xhr.status);
              console.log(xhr.thrownError);
      }
});
Syed Raza
  • 1,070
  • 3
  • 14
  • 36

1 Answers1

0

(I work at Asana.)

The Asana API does not currently support jsonp as a data type. The error you are getting is probably the jQuery engine trying to interpret an incompatible response from the Asana server.

Using the API key for authentication from Javascript means having the full client credentials exposed on the client, which is an insecure practice we discourage; that's why we do not support jsonp today.

However, we just recently launched OAuth, which is a more secure means of authentication. We expect to add jsonp support at some point soon for OAuth-connected clients, so stay tuned.

Greg S
  • 2,079
  • 1
  • 11
  • 10
  • Is there is a way i can use it on client side with JQuery and JavaScript no server side Language Involve.. – Syed Raza Apr 15 '13 at 06:18
  • I mean to say requirement is to only use Javascript and HTML.So i have to deliver to client HTML and JS files. I can't use any server related stuff. – Syed Raza Apr 15 '13 at 07:06