云之家待办处理接口不生效
金蝶云社区-颜平
颜平
0人赞赏了该文章 1,114次浏览 未经作者许可,禁止转载编辑于2018年05月20日 15:43:50

[code]///


/// 待办处理
///

/// 即sourceId,生成的待办所关联的第三方服务业务记录的ID,是待办的批次号
/// 可填多人,不填则更改sourceitemid下所有人员的待办状态
/// 目标处理状态,0表示未办,1表示已办,默认为0
/// 目标读状态,0表示未读,1表示已读,默认为0
/// 目标删除状态,0表示未删除,1表示已删除
///
public string ActionTodo(string k3cloudUrl, string dbId, string usr, string pwd, string SourceId, string OpenIds = "", int Deal = 1, int Read = 1, int Delete = 0)
{
if (!InitParameters(k3cloudUrl, dbId, usr, pwd))
{
return null;
}
String accessToken = GetAccessToken();
if (accessToken == null)
{
return null;
}
JObject ps = new JObject();
ps.Add("sourcetype", APPID);
ps.Add("sourceitemid", SourceId);
if (!string.IsNullOrWhiteSpace(OpenIds))
{
List ids = new List();
var array = JArray.Parse(OpenIds);
foreach (var a in array)
{
ids.Add(a.ToString());
}
ps.Add("openids", string.Join(",", ids));
}

JObject actiontype = new JObject();
actiontype.Add("read", Read);
actiontype.Add("deal", Deal);
actiontype.Add("delete", Delete);
ps.Add("actiontype", actiontype);

HttpClientUtil httpClient = new HttpClientUtil();
httpClient.Url = "https://www.yunzhijia.com/gateway/newtodo/open/action.json?accessToken=" + accessToken;
//提交上下文,通过JsonConvert.SerializeObject序列化数组
httpClient.Content = JsonConvert.SerializeObject(ps);
//提交请求并返回结果
string resultString = httpClient.SysncRequest("application/json");

return resultString;
}[/code]如上所示代码调用待办处理接口,read、deal值设置为1均不影响云之家待办消息内的状态,一直无法通过接口将待办消息移到已处理中。

文档链接:https://open.yunzhijia.com/openplatform/resourceCenter/doc#/gitbook-wiki/server-api/newTodo.html
官方示例: