2016-03-28 26 views
0

E-tablolar listesini almak için google REST API kullanıyorum. Her şey hesabım tarafından erişildiğinde çalışır.GoogleJsonResponseException 403 Yasak PERMISSION_DENIED

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { 
"code" : 403, 
"errors" : [ { 
"domain" : "global", 
"message" : "The caller does not have permission", 
"reason" : "forbidden" 
} ], 
"message" : "The caller does not have permission", 
"status" : "PERMISSION_DENIED" 
} 

O benim google komut erişimi yok diyor, ama senaryo olarak görünür ayarlayabilir ve herkes için paylaşılan: Ben yabancı hesabını kullanmaya çalıştığınızda

Ama, bu hatayı alıyorum.

Kodu:

private Object getDataFromApi(ExecutionRequest request) 
      throws IOException 
    { 

     if (BuildConfig.DEBUG) { 
      request.setDevMode(true); // it will take saved version of script and not the published one 
     } 

     // Make the request. 
     Operation op = 
       mService.scripts().run(SCRIPT_ID, request).execute(); 

cevap

-1

sorun buldum kodunda oldu: yerine her zaman erişim kaydedilmiş sürüme zorlamak ve yayınlanmamış gibi

if (BuildConfig.DEBUG) { 
    request.setDevMode(true); // it will take saved version of script and not the published one 
} 

görünüyor. Daha sonra yabancı hesap kaydedilen versiyona erişemedi ve 403 hatası verdi.

Bu dev modu devre dışı bıraktığımda veya sürüm sürümünü yüklediğimde, her şey yolunda.

+0

neden oylanmıştı? –

İlgili konular