Python API version 10 update at

Hello,
I have a problem with Monday API version 10 in python. Since it changed on February 15, not all information from Monday is taken, because column “update at” doesn’t update if you change time on Monday platform. Is there a possibility to update code a little bit so it takes all information, or I just need to write all new code with different perspective (not thinking about update at)?

Hello there @agness15 and welcome to the community!

I hope you like it here :muscle:

What query where you using before, and what result were you seeing? What are you expecting to get exactly, can you show an example?

Looking forward to hearing from you :slightly_smiling_face:

Cheers,
Matias

This is python code part in which I get errors. I dont know how to change the code that version10 will work like version 7 did work :
pulse_1 = pd.DataFrame()
for i in range(len(df_boards_norm)):
q_pulses = (
“{boards(limit:100000 ids:”
+ df_boards_norm.loc[i, “id”]
+ “) {items{id name updated_at column_values (ids:time_tracking){value}}}}”
)
data_pulses = {“query”: q_pulses}
r_pulses = requests.post(url=apiUrl, json=data_pulses, headers=headers)

pulses_json = r_pulses.json()
df_pulses_norm = pd.json_normalize(
    pulses_json['data']['boards'],
    record_path=['items', 'column_values'],
    meta=[
        ['items', 'id'],
        ['items', 'name'],
        ['items', 'updated_at']
    ],
    errors="ignore",
)
df_pulses_norm.insert(0, "board_id", df_boards_norm.loc[i, "id"])
pulse_1 = pd.concat([pulse_1, df_pulses_norm], ignore_index=True)

pulse_1[‘value’] = pulse_1[‘value’].apply(lambda x: {} if pd.isna(x) else x)
pulse_1 = pulse_1[pulse_1[‘value’] != {}].reset_index()
pulse_1.head()

Hello again @agness15,

This query should work for you:

{ items (ids: 1234567890) { id name updated_at column_values(ids: "time_tracking") { ... on TimeTrackingValue { running started_at value duration started_at updated_at  } } } }

You need to pass an ID for it. You can check all the fields you can ask for here :grin:

Let me know how that goes!

Cheers,
Matias

i changed it, but still shows an error about data:
pulse_1 = pd.DataFrame()
for i in range(len(df_boards_norm)):
q_pulses = (
“{boards(limit:100000 ids:”
+ df_boards_norm.loc[i, “id”]
+ “) {items{id name updated_at column_values (ids:time_tracking){value}}}}”
)
data_pulses = {“query”: q_pulses}
r_pulses = requests.post(url=apiUrl, json=data_pulses, headers=headers)

pulses_json = r_pulses.json()
df_pulses_norm = pd.json_normalize(
    pulses_json['data']['boards'],
    record_path=['items', 'column_values'],
    meta=[
        ['items', 'id'],
        ['items', 'name'],
        ['items', 'updated_at']
    ],
    errors="ignore",
)
df_pulses_norm.insert(0, "board_id", df_boards_norm.loc[i, "id"])
pulse_1 = pd.concat([pulse_1, df_pulses_norm], ignore_index=True)

pulse_1[‘value’] = pulse_1[‘value’].apply(lambda x: {} if pd.isna(x) else x)
pulse_1 = pulse_1[pulse_1[‘value’] != {}].reset_index()
pulse_1.head()

Hello again,

You are using a deprecated boards->items query.

If you are going to use the “boards” object, you need to use the items_page object as explained here, so that it goes boards->item_page->items instead of boards->items

Cheers,
Matias