Question

I have a link like "https://podio.com/.../apps/candidates/items/3"

How to get this item?

in PHP maybe PodioItem::get_by_app_item_id( $app_id, $app_item_id ); will work. But I cannot find this method in C#.

ItemService.FilterItem may work but I really don't know how to use it..

Était-ce utile?

La solution 2

Not all Podio API operations have been added to the .NET client. The bottom part of this page tells you how to make custom calls using the rest helper: https://developers.podio.com/clients/dotnet

// creates a Podio.API.Client used to communicate with the Podio API
var client = Podio.API.Client.ConnectAsUser(client_id, client_secret, username, password);

int AppId = 9999;
string requestUrl = Podio.API.Constants.PODIOAPI_BASEURL + "/tag/app/" + AppId + "/";

// request the api
Podio.API.Utils.PodioRestHelper.PodioResponse response = Podio.API.Utils.PodioRestHelper.Request(requestUrl, client.AuthInfo.access_token);

In your specific case: If you really only have a URL you can resolve it into a reference. This will give you the item_id you need to fetch the item itself. See: https://developers.podio.com/doc/reference/resolve-url-66839423

This is the most solid way of turning a URL into a reference. If you have the app_item_id and the app_id you can use https://developers.podio.com/doc/items/get-item-by-app-item-id-66506688 to fetch the item directly.

Neither of those operations have methods in the .NET client and you'll have to use the rest helper to make the calls. Or add the methods yourself, of course.

Autres conseils

If the method does not exist it is quite likely that you have not referenced your project correctly to communicate with the Podio API.

// creates a Podio.API.Client used to communicate with the Podio API
var client = Podio.API.Client.ConnectAsUser(client_id, client_secret, username, password);

// Get a single item
int itemId = 123;
var item = client.ItemService.GetItem(itemId);

// Get many items from an app
int appId = 123;
int limit = 100 // Max allowed is 500 items per request;
int offset = 0;
var items = client.ItemService.GetItems(appId, limit, offset);

Podio API Documentation for .NET

Please read the documentation. It tells you how to read an item given an itemID.

Please refer this documentation for C# Client Library

Sample Code:

var item = podio.ItemService.GetItemBasic(123); // Get item with item_id = 123
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top