Could anyone provide example Python scripts?

I have just started to use some of the API features and have made it through some of the tutorial items but I’m pretty new at this type of work. I would really love to see more example scripts of basic operations.

I know that updating an item requires an Item ID but I’m having trouble querying that successfully.

Could anyone provide a python script that finds an Item ID on a specific board based on a column value like “Employee Number”? Bonus points if the response could include the next logical leap of editing a text column and a status column. I have looked through many of the forum posts and I see most common responses are just snippets and I’m not confident I would know what to do with a response that doesn’t include all portions of the script needed with the variables changed to something like “API_Key”, “Board_ID” etc. Please and thank you in advance.

Hey Bryce!

First things first – have you tried our sample Python tutorial? I haven’t reviewed it in a while, but it should cover the basics of using our API: https://support.monday.com/hc/en-us/articles/360013483119-API-Quickstart-Tutorial-Python

After that, I’d recommend trying out the items_by_column_values query to get items with a specific column value: Items by column values

I have, what I would really appreciate is more of the same type of content actually. Also, like I said in my previous message I’m not sure what to do with that info you linked. The tutorial mentioned does a much better job of providing the complete picture on those basic operations. What I’d love is a few complete examples showing how you would use the other queries so that I understand how to use them.

Hello there @Bnichols,

You can check out our Postman collection here. In it you will find many examples, and if you click on the </> button, you can export them as Python scripts.

For example, here would be a script for using items_by_column_values (you would need to change the board ID, column ID and value):

import requests
import json

url = "https://api.monday.com/v2"

payload = json.dumps({
  "query": "query {items_by_column_values (board_id: 1234567890, column_id: \"date\", column_value: \"2019-02-06\") {id name}}"
})
headers = {
  'Authorization': 'RELEVANT_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Cheers,
Matias

Bless you Matias. This is exactly what I was hoping for!

I am glad I could help @Bnichols :grin: