Get all related item ids of an item

Comments

5 comments

  • Andreas Garnæs

    Hi Rudolph,

    You can use the endpoint Get references to item by field to get references to the item.

    The request will be something like GET https://api.podio.com/item/150622336/reference/field/43738642 for item id 150622336 and field id 43738642. The response will look like this:

    [
      {
        "app_item_id": 1640,
        "item_id": 187458953,
        "title": "Some title",
        "link": "https:\/\/podio.com\/myorg\/myspace\/apps\/myapp\/items\/1640",
        "revision": 8
      },
      {
        "app_item_id": 1550,
        "item_id": 182785131,
        "title": "Another title",
        "link": "https:\/\/podio.com\/myorg\/myspace\/apps\/myapp\/items\/1550",
        "revision": 1
      }
    ]
    

    Hope it helps!

    Best,
    Andreas

    0
    Comment actions Permalink
  • Rudolph de Kock

    Thx I think this is exactly what i'm looking for , I've been using the PHP PODIO API Library. Just to check if I'm on the right track I should send a normal get request to the URL and it will return a json string that I will have to decode? This request doesn't exist inside the Library, right?

    0
    Comment actions Permalink
  • Rudolph de Kock

    :) Sorry I didn't follow the link , perfect explanation thx

    0
    Comment actions Permalink
  • Andreas Garnæs

    If you're using the PHP client it might be even easier to do this:

    $references = PodioItem::get_references(123);
    

    It will call a slight different endpoint, Get item references, and return the result in the following format:

    [
      {
        "field": {
          "field_id": 43738642,
          "type": "app",
          JSON REMOVED FOR BREVITY
        },
        "app": {
          "app_id": 5618736,
          JSON REMOVED FOR BREVITY
        },
        "items": [
          {
            "app_item_id": 1640,
            "item_id": 187458953,
            "title": "Some title",
            "link": "https:\/\/podio.com\/myorg\/myspace\/apps\/myapp\/items\/1640",
            "revision": 8
          },
          {
            "app_item_id": 1550,
            "item_id": 182785131,
            "title": "Another title",
            "link": "https:\/\/podio.com\/myorg\/myspace\/apps\/myapp\/items\/1550",
            "revision": 1
          }
        ]
      }
    ]
    
    0
    Comment actions Permalink
  • Rudolph de Kock

    What! , Andreas you're a Legend. I think what I'm working on will be a nice feature to the core , our company is struggling a lot with duplicate items created , and this script will hopefully fix it , luckily the only part of this script that had me worried you just fixed :)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk