I already have the token and can access my token whose scopes are till fusiontable. http://www.udayan2k12.com/token.html
<script type="text/javascript">
(function() {
var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/auth";
var GOOGLE_CLIENT_ID = "365219651081-7onk7h52kas6cs5m17t1api72ur5tcrh.apps.googleusercontent.com";
var PLUS_ME_SCOPE = "https://www.googleapis.com/auth/fusiontables";
var button = document.createElement("button");
button.innerText = "Authenticate with Google";
button.onclick = function() {
var req = {
"authUrl" : GOOGLE_AUTH_URL,
"clientId" : GOOGLE_CLIENT_ID,
"scopes" : [ PLUS_ME_SCOPE ],
};
oauth2.login(req, function(token) {
alert("Got an OAuth token:\n" + token + "\n"
+ "Token expires in " + oauth2.expiresIn(req) + " ms\n");
document.getElementById('token').innerHTML = token;
}, function(error) {
alert("Error:\n" + error);
});
};
document.body.appendChild(button);
var clearTokens = document.createElement("button");
clearTokens.innerText = "Clear all tokens";
clearTokens.onclick = oauth2.clearAllTokens;
document.body.appendChild(clearTokens);
})();
</script>
But the problem is that i am unable to use that token to update the fusion table. I want to update it specifically by using JavaScript.
can some one provide me the code to use this token to update fusiontable using the fusion table sql