3
from pypodio2 import api

# Authenticate as App
podio_client = api.OAuthAppClient(
    client_id=PODIO_CLIENT_ID,
    client_secret=PODIO_CLIENT_SECRET,
    app_id=PODIO_APP_ID,
    app_token=PODIO_APP_TOKEN,    
)

# Set limit to 100
items = podio_client.Item.filter(app_id=PODIO_APP_ID, attributes={}, limit=100)

My app has a total of 251 items and I expect that the API would return 100 items but it only returns 20... How to fix this?

print(items['total'])

251

print(items['filtered'])

251

print(len(items['items'])

20

Update

I tried it with the requests library but still no success...

import requests
payload = {
  "filters":{},
  "limit": 30
}
resp = requests.post(url="https://api.podio.com/item/app/randomappid/filter/", 
                    headers={'authorization': 'OAuth2 randomn0mber'},
                    data=payload)

len(resp.json()['items'])

20

API call docs: https://developers.podio.com/doc/items/filter-items-4496747

4
  • Can you post a snippet of your items object ? from a first glance, it only looks like your object items has a key 'items' that holds 20 elements. Commented Apr 14, 2019 at 15:18
  • The object items has three keys: total, filtered and items. Total indicates how much items the application has, filtered says how much items are left after applying the filter and items has al the items. I want to get 251 items by applying no filter, I added the 100 limit to show that it is broken because I only get 20 items. Commented Apr 14, 2019 at 15:30
  • Shouldn't the items['filtered'] return 100 items as well? Commented Apr 14, 2019 at 15:49
  • @nimish666 It only contains an integer. Commented Apr 14, 2019 at 16:36

2 Answers 2

5

limit must pass thru the attributes parameter.

# Set limit to 100
items = podio_client.Item.filter(app_id=PODIO_APP_ID, attributes={"limit": 100})
Sign up to request clarification or add additional context in comments.

Comments

0

Not ideal but using the deprecated api call I get the desired results... Would still like to know how to do it using the filter api call.

params = {"limit": 300}
resp = requests.get(url="https://api.podio.com/item/app/randomappid/", 
                    headers={'authorization': 'OAuth2 randomn0mber'},
                    params=params)

len(resp.json()['items'])

251

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.