我正在尝试使用google-api-services-fusiontables-v1-rev1-1.7.2-beta apis从我的Android应用程序创建新表。 我正在使用任务示例中描述的客户经理,并成功地使用范围(AUTH_TOKEN_TYPE)作为“fusiontables”获取令牌。 但是,当尝试使用该服务插入新表时,我收到401未经授权的错误。 //创建列
List <Column> coulmns = createColumn(3,basicCoulmn);
//Create the table
Table table = createTable("TestTable","fusiontables#table","Description", coulmns);
//Call the service
service.table().insert(table).execute();
这是错误:
com.google.api.client.googleapis.json.GoogleJsonResponseException:401 Unauthorized
{
“code”:401,
“错误”:[
{
"domain": "global",
"location": "Authorization",
"locationType": "header",
"message": "Invalid Credentials",
"reason": "authError"
}
],
“message”:“凭据无效”
}
你能告诉我我做错了吗?
答案 0 :(得分:0)
如果您使用fusiontables
会发生什么,而不是AUTH_TOKEN_TYPE
使用oauth2:https://www.googleapis.com/auth/fusiontables
?