【问题标题】:401 unauthorized when trying to insert (create) new table尝试插入(创建)新表时出现 401 未授权
【发布时间】:2012-07-20 17:06:04
【问题描述】:

我正在尝试使用 google-api-services-fusiontables-v1-rev1-1.7.2-beta api 从我的 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

{

“代码”:401,

“错误”:[

{

  "domain": "global",

  "location": "Authorization",

  "locationType": "header",

  "message": "Invalid Credentials",

  "reason": "authError"

}

],

“消息”:“无效凭据”

}

你能建议我做错了什么吗?

【问题讨论】:

    标签: google-fusion-tables


    【解决方案1】:

    不使用fusiontables 代替AUTH_TOKEN_TYPE,如果使用oauth2:https://www.googleapis.com/auth/fusiontables 会发生什么?

    【讨论】:

    • 太好了,有了这个范围,我可以连接到服务。那是缺少“oauth2:”感谢您的提示!!!!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    • 2011-09-15
    • 1970-01-01
    • 1970-01-01
    • 2022-08-20
    • 2021-06-01
    • 1970-01-01
    相关资源
    最近更新 更多