I have this query that basically paginates the board until reaching the end. However, I don’t know if it’s something I did in my code or if it’s something with the API itself, but the JSON response always arrives with the link columns empty.
def get_items_from_board(self, cursor=None):
query = {
"query": f"""
{{
boards(ids: {self.board_id}) {{
items_page(limit: 100{f', cursor: "{cursor}"' if cursor else ''}) {{
cursor
items {{
id
name
column_values {{
column {{
title
id
}}
text
}}
}}
}}
}}
}}
"""
}
response = requests.post(self.URL, headers=self.headers, json=query)
if response.status_code == 200:
return response.json()
else:
print(f"Erro: {response.status_code}, {response.text}")
return None
def fetch_all_items(self):
all_items = []
cursor = None
while True:
data = self.get_items_from_board(cursor)
if data:
items_page = data["data"]["boards"][0]["items_page"]
items = items_page["items"]
cursor = items_page["cursor"]
all_items.extend(items)
if not cursor:
break
else:
break
return all_items
Sorry if this is poorly formatted or if there’s already an open topic that solves this; I’ve never used this forum before. Thank you in advance