Search code examples
c#podio

how to get an item with a link


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..


Solution

  • 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.