Gigya ids.setAccountInfo 错误架构验证失败
Gigya ids.setAccountInfo error Schema validation failed
我正在尝试设置帐户数据
我用 ids.setAccountInfo
GSObject param = new GSObject();
GSObject profile = new GSObject();
param.put("UID", user.getString("UID"));
profile.put("firstName", "FirstName");
param.put("profile", profile);
GSAPI.getInstance().sendRequest("ids.setAccountInfo", param, new GSResponseListener() {
@Override
public void onGSResponse(String s, GSResponse gsResponse, Object o) {
Log.d("ids.setAccountInfo", "----------------------------");
Log.d("ids.setAccountInfo", "s " + s);
Log.d("ids.setAccountInfo", "gsResponse " + gsResponse);
Log.d("ids.setAccountInfo", "----------------------------");
}
}, null);
并有回应
errorCode:400006
errorMessage:Invalid parameter value
errorDetails:Schema validation failed
data:{"validationErrors":[{"message":"write access mode violation","fieldName":"profile.firstName","errorCode":400025}],"statusCode":400,"errorMessage":"Invalid parameter value","time":"2015-08-13T11:48:14.664Z","errorDetails":"Schema validation failed","statusReason":"Bad Request","errorCode":400006,"callId":"e0ed6aebea144323b095849ae3ed40ee"}
如果我发送空配置文件或不发送它则成功
errorCode:0
errorMessage:null
errorDetails:null
data:{"statusCode":200,"errorCode":0,"time":"2015-08-13T11:53:19.738Z","callId":"e59b00cd09bf48a398586219f817930d","statusReason":"OK"}
由于对 ids.setAccountInfo 的调用是从客户端完成的(假设使用 android SDK),而这些字段写访问权限的配置文件架构是 'serverOnly' 或 'clientCreate'.为了使其正常工作,这些字段需要具有 'clientModify' 写入权限。
使用 ids.getSchema 获取架构并查看字段写入权限。
可以通过调用 ids.setSchema 来更改它,查看 link 了解更多详细信息。
writeAccess - Specifies whether to allow unsigned requests to write into this field. This property applies when using the ids.getAccountInfo method, or when setting fields through the usage of a Screen-Set. The supported values are:
- "serverOnly" (default) - Only signed requests coming from the server are allowed.
- "clientCreate" - Unsigned requests coming from the client are allowed to write into this field, only if it wasn't set before.
- "clientModify" - Unsigned requests coming from the client are allowed to write into this field and modify existing values.
我正在尝试设置帐户数据
我用 ids.setAccountInfo
GSObject param = new GSObject();
GSObject profile = new GSObject();
param.put("UID", user.getString("UID"));
profile.put("firstName", "FirstName");
param.put("profile", profile);
GSAPI.getInstance().sendRequest("ids.setAccountInfo", param, new GSResponseListener() {
@Override
public void onGSResponse(String s, GSResponse gsResponse, Object o) {
Log.d("ids.setAccountInfo", "----------------------------");
Log.d("ids.setAccountInfo", "s " + s);
Log.d("ids.setAccountInfo", "gsResponse " + gsResponse);
Log.d("ids.setAccountInfo", "----------------------------");
}
}, null);
并有回应
errorCode:400006
errorMessage:Invalid parameter value
errorDetails:Schema validation failed
data:{"validationErrors":[{"message":"write access mode violation","fieldName":"profile.firstName","errorCode":400025}],"statusCode":400,"errorMessage":"Invalid parameter value","time":"2015-08-13T11:48:14.664Z","errorDetails":"Schema validation failed","statusReason":"Bad Request","errorCode":400006,"callId":"e0ed6aebea144323b095849ae3ed40ee"}
如果我发送空配置文件或不发送它则成功
errorCode:0
errorMessage:null
errorDetails:null
data:{"statusCode":200,"errorCode":0,"time":"2015-08-13T11:53:19.738Z","callId":"e59b00cd09bf48a398586219f817930d","statusReason":"OK"}
由于对 ids.setAccountInfo 的调用是从客户端完成的(假设使用 android SDK),而这些字段写访问权限的配置文件架构是 'serverOnly' 或 'clientCreate'.为了使其正常工作,这些字段需要具有 'clientModify' 写入权限。
使用 ids.getSchema 获取架构并查看字段写入权限。
可以通过调用 ids.setSchema 来更改它,查看 link 了解更多详细信息。
writeAccess - Specifies whether to allow unsigned requests to write into this field. This property applies when using the ids.getAccountInfo method, or when setting fields through the usage of a Screen-Set. The supported values are:
- "serverOnly" (default) - Only signed requests coming from the server are allowed.
- "clientCreate" - Unsigned requests coming from the client are allowed to write into this field, only if it wasn't set before.
- "clientModify" - Unsigned requests coming from the client are allowed to write into this field and modify existing values.