如何获得在“应用程序设置”中找到的Podio应用程序项目名称?

时间:2019-05-25 22:03:18

标签: c# podio

如何在这张图片中使用C#获取应用项目名称?

Picture

1 个答案:

答案 0 :(得分:0)

您是否看过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类。