Api version 2023_10. issues with changes with python script, how do we define the usage?

Is the header variable for API_Version. supported in the python environment?

I was trying to set up an item query that works in the previous enviornment.

tried setting

apiUrl = “https://api.monday.com/v2
headers = {
“Authorization” : apiKey,
‘API-Version’ : ‘2023-10’

The query then fails with
errors: [{‘message’: ‘Type mismatch on variable $myBoardID and argument ids ([Int]! / [ID!])’, …

I found an older reference to this error “API Error - Dimension mismatch

but that doesnt help.

Want to first confirm that the header approach will work in Python?
The documentation seems to focus on javascript.

or, what is the correct way to reference the API version.

Hi @eric.white.au

Are you sure you are using the latest version of the API package? In NodeJS you need to update the npm package monday-sdk-js to the latest version, don’t know if there is something similar in Python.

Using the header is the correct method in Python.

As far as the error, I’d have to see your query - which is next step. It could be that you’re defining your variable types incorrectly. a board ID variable should be defined as [ID!]

1 Like

Thanks Guys.

Support got back to me, and Cody called it also.

Need to change the references to Workspace and Boards to type. ID not Int.

getitems = 'query ($myBoardID: ID!)

1 Like

funny the error makes sense when you know… :slight_smile:

1 Like

the ID/Int change is related to 2023-10, so it definitely was working with the header!

That said, in the playground, it reports that it must be [ID!] not ID! - meaning it expects an array of IDs for the board(ids: $boardIds){id, name} even if its just one.

Now its possible the GraphQL resolver tolerates either, and accepts an ID directly and not just an array of IDs - I would not count on it. The API schema specifies an array of IDs, and its entirely possible that the resolver could become more strict in the future and break your query.

Its easy enough to solve though, and doesn’t change the response. It could also just be a typo here in the community and not what you’re even doing and I wasted the last 90 seconds writing that out!

1 Like