Skip to content

Instantly share code, notes, and snippets.

@kayalshri
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kayalshri/73dddbd2e3189af9b07f to your computer and use it in GitHub Desktop.
Save kayalshri/73dddbd2e3189af9b07f to your computer and use it in GitHub Desktop.
Asana Api
Login User Info:
================
asana.request("GET", "users/me?opt_fields=id,name,photo", function(ierr, userresponse) {
if (ierr){ console.error("Error:", ierr)}else{
//console.log("user data:", userresponse.data);
$("#a_username").html("<center><p>Hello,"+userresponse.data.name+"</p></center>"); //image
if( userresponse.data.photo == null){
$("#user_image").html("<center><img src='../img/default.png' class='img-circle' ></center>");
}else{
$("#user_image").html("<center><img src="+userresponse.data.photo.image_60x60+" class='img-circle' ></center>");
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment