2014-04-08 108 views
0

谷歌URL縮短API我用代碼通過Java腳本不工作

var api_key = 'Api-key'; 

function makeRequest() { 
    var request = gapi.client.urlshortener.url.insert({'resource': {'longUrl': longurl}}); 
    request.execute(function (response) { 
     console.log(JSON.stringify(window.got = response)); 
    }); 
} 

function load() { 
    gapi.client.setApiKey(api_key); 
    gapi.client.load('urlshortener', 'v1', makeRequest); 
} 

,並有響應

{"code":404,"message":"Not Found","data":[{"domain":"global","reason":"notFound","message":"Not Found"}],"error":{"code":404,"message":"Not Found","data":[{"domain":"global","reason":"notFound","message":"Not Found"}]}} 

有什麼不好?

+0

見https://code.google.com/p/google-api-javascript-client/issues/detail?id=136 –

回答