我对c# .net中的Podio和Podio很陌生。我能够获取项集合,使用.Net中的API和webhooks创建项。但是我被困在更新项目上了。我在ITEMX.Update的项目更新上使用web钩子。但是我在更新项目时出错了。
我试过的时候,
但还是会犯错误。错误信息的最后一句是:
\"request\":{\"url\":\"http://api.podio.com/item/9999999\",\“item_id\”:99999999,\“item_id\\”:0} (对象):必须是整数\“,\”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());
}
}
}'发布于 2016-12-15 08:44:13
您可能正在使用获取的item对象本身更新回Podio。那是行不通的。您需要创建一个全新的Item对象并执行更新工作。参见这里的文档:http://podio.github.io/podio-dotnet/items/
发布于 2021-06-29 17:06:05
https://stackoverflow.com/questions/41141982
复制相似问题