gpt4 book ai didi

c# - 在 C# .Net 中使用 Podio API 更新 Podio Item

转载 作者:太空宇宙 更新时间:2023-11-03 21:05:58 25 4
gpt4 key购买 nike

我是 Podio 的新手,在 c# .net 中使用 Podio API。我能够获取项目集合,使用 .Net 中的 API 和 webhook 创建项目。但我坚持更新项目。我在 ITEMX.Update 的项目更新上使用 webhook。但是我在更新项目时遇到错误。

虽然我已经尝试过测试,

  • 为字段分配新值。
  • 刚刚使用 ItemId 获取项目并立即调用ItemUpdate() 方法,不对获取的项目进行任何更改

但是还是报错。错误消息的最后一句话是:

"\\"item_id\\": 99999999,\\"revision\\": 0} (object): must be integer\",\"request\":{\"url\":\"http://api.podio.com/item/9999999\",\"query_string\":\"\",\"method\":\"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());
}
}
}'

最佳答案

您可能正在使用获取的项目对象本身来更新回跑道。这是行不通的。您需要创建一个全新的 Item 对象并执行更新工作。请参阅此处的文档:http://podio.github.io/podio-dotnet/items/

关于c# - 在 C# .Net 中使用 Podio API 更新 Podio Item,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41141982/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com