【发布时间】:2019-05-25 22:03:18
【问题描述】:
如何在 C# 中获取这张图片中的 App Item 名称?
【问题讨论】:
如何在 C# 中获取这张图片中的 App Item 名称?
【问题讨论】:
你看过Podio API吗?
应用程序:获取应用程序
GET /app/{app_id}
获取应用的定义,可以包括配置和字段。此方法将始终返回应用定义的最新版本。
结果(微结果):
{
"app_id": The id of the app,
"name": The name of the app,
"item_name": The name of each item in an app,
"icon": The name of the icon used to represent the app
}
您只需使用HttpClient 发出一个简单的REST 请求或开始使用Podio-dotnet NUGET package。
using PodioAPI;
var podio = new Podio(clientId, clientSecret);
podio.AuthenticateWithApp(appId, appSecret);
var application = await podio.ApplicationService.GetApp(appId, "micro");
ItemName 可以通过application.ItemName 访问。
更多信息,这是GetApp方法的签名。
/// <summary>
/// Gets the definition of an app and can include configuration and fields.
/// <para>Podio API Reference: https://developers.podio.com/doc/applications/get-app-22349 </para>
/// </summary>
/// <param name="appId"></param>
/// <param name="view">
/// The type of the view of the app requested. Can be either "full", "short", "mini" or "micro". Default
/// value: full
/// </param>
/// <param name="fields">
/// This parameter can be used to include more or less content in responses than the defaults provided by Podio.
/// E.g. space.view(full)
/// </param>
/// <returns></returns>
public async Task<Application> GetApp(int appId, string view = "full", string fields = null)
如果您需要了解Application 类还有哪些其他字段,请查看其source。
【讨论】: