【发布时间】:2016-12-14 11:53:50
【问题描述】:
我是 Podio 新手,在 c# .net 中使用 Podio API。我能够在 .Net 中获取项目集合、使用 API 和 webhook 创建项目。但我坚持更新项目。我在 ITEMX.Update 的项目更新上使用 webhook。 但是我在更新项目时遇到了错误。
虽然我尝试过测试,
- 为字段分配新值。
- 刚刚使用 ItemId 获取项目并立即调用 ItemUpdate() 方法对获取的项目没有任何更改
但仍然出现错误。 错误信息的最后一句说:
"\\"item_id\\": 99999999, \\"revision\\": 0} (object): 必须是整数\",\"request\":{\"url\":\"http://api.podio.com/item/9999999\",\"query_string\":\"\ ",\"方法\":\"PUT\"}}"}
我尝试了很多方法并参考了很多文档,但没有找到解决方案。 有人可以帮忙完成这项工作吗?
'
public static async Task<int> UpdateCalculationsInGMApp(int appItemId)
{
//Get related GMApp
try
{
var _Podio = new Podio(Helper.ApiClientId, Helper.ClientSecret);
AppMaster Ratesapp = Helper.GetAppToken("Costing Rates", "VikramTestWS");
await _Podio.AuthenticateWithApp(Ratesapp.AppId, Ratesapp.Token);
Item ratesPodioItem = await _Podio.ItemService.GetItem(appItemId);
//Item fetched successfully here
//thentried to set one of the field with new value. Later on commented and tested but didn't worked
//var pm_Rate = ratesPodioItem.Field<NumericItemField>("pm-rate");
//pm_Rate.Value = 100;
try
{
int x = (int)await _Podio.ItemService.UpdateItem(ratesPodioItem, null, null, true, true);
}
catch (Exception excp)
{
Logger.AddToLog(DateTime.Now, excp.Message, "Error: updating podio item" + ratesPodioItem.ItemId.ToString());
}
}
}'
【问题讨论】:
-
您能否提供您的源代码(当然没有任何访问令牌和登录名/密码),以便更容易理解出了什么问题?