我在更新自定义对象时遇到问题。奇怪的是,一个对象(我们称之为对象#1)更新得很好,而另一个(对象#2)返回“未授权更新 application_settings 对象”。
对象 #2 属于 Account Owner 用户(我说的是“用户 ID”字段的值),对象 #1 属于另一个用户。要注意即使我授权为帐户所有者用户也会出现问题:
QBASessionCreationRequest *extendedAuthRequest = [[QBASessionCreationRequest alloc] init];
extendedAuthRequest.userLogin = @"login";
extendedAuthRequest.userPassword = @"password";
[QBAuth createSessionWithExtendedRequest:extendedAuthRequest delegate:self];
这是我尝试更新对象 #2 时发生的情况:
PUT http://api.quickblox.com/data/application_settings/51d07504535c12a1ef000dd6.xml?push%5Bprofile_images_ids_180px%5D=987654321
headers:{
"QB-SDK" = "iOS 1.5.2";
"Qb-Token" = xxxxxxxxxxxxxxxxx;
"QuickBlox-REST-API-Version" = "0.1.1";
}
parameters:
raw body:
休息响应:
<QBASIHTTPRequest: 0xabca400>
headers:{
"Access-Control-Allow-Origin" = "*";
"Access-Control-Request-Method" = "*";
"Cache-Control" = "no-cache";
Connection = Close;
"Content-Length" = 191;
"Content-Type" = "application/xml; charset=utf-8";
Date = "Tue, 09 Jul 2013 17:03:07 GMT";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.0.15";
Status = "403 Forbidden";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = 732c8f2002b8bd03241d4c88288557fd;
"X-Runtime" = "0.043522";
"X-UA-Compatible" = "IE=Edge,chrome=1";
}
body:<?xml version="1.0" encoding="UTF-8"?>
<errors type="array">
<error>
<code nil="true"/>
<message>Not authorized to update application_settings object</message>
</error>
</errors>